Formalization: Minimax Estimation of Budgeted Treatment Value Curves 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. Note: this index was generated at a different commit than the paper's audited pin (c4f4de3) — statements may have moved since the audit.

CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Basic 63 declarations The finite observed and potential-outcome carriers reuse the earlier finite-PMF development.

Discrete budget value curves

The finite observed and potential-outcome carriers reuse the earlier finite-PMF development. The causal restrictions and budget functional are paper-specific.

def Cell

the cell definition specifies the stated object.

Definition (Lean source)
Cell :
Type
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Cell
CausalSmith.Stat.DiscreteBudgetvalueCurve.Cell · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:19

the obs definition specifies the stated object.

Definition (Lean source)
d :
ℕ
shared
Obs d :
Type
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Obs
CausalSmith.Stat.DiscreteBudgetvalueCurve.Obs · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:21
def DiscreteLaw

the discrete law definition specifies the stated object.

Definition (Lean source)
d :
ℕ
shared
DiscreteLaw d :
Type
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DiscreteLaw
CausalSmith.Stat.DiscreteBudgetvalueCurve.DiscreteLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:23

For d, the potential atom definition specifies the stated object.

Definition (Lean source)
d :
ℕ
PotentialAtom d :
Type
Fin d × Bool × Bool × Bool
CausalSmith.Stat.DiscreteBudgetvalueCurve.PotentialAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:26
def observedFromPotential Definition 1 in the paper ↗

For d, the observed from potential definition specifies the stated object.

Definition (Lean source)
d :
ℕ
observedFromPotential :
PotentialAtom d → CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FullObs d
fun z => (z.1, z.2.1, if z.2.1 then z.2.2.2 else z.2.2.1, z.2.2.1, z.2.2.2)
CausalSmith.Stat.DiscreteBudgetvalueCurve.observedFromPotential · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:29
def CanonicalObservedOutcome

For d, Q, the canonical observed outcome definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw d
CanonicalObservedOutcome Q :
Prop
∃ R : PMF (PotentialAtom d), Q.pmf = R.map observedFromPotential
CausalSmith.Stat.DiscreteBudgetvalueCurve.CanonicalObservedOutcome · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:35
theorem canonicalObservedOutcome_of_consistency

The canonical observed outcome of consistency result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw d
h :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency Q
Proof (Lean source)
lemma canonicalObservedOutcome_of_consistency {d : ℕ} (Q : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw d) (h : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency Q) : CanonicalObservedOutcome Q := by let forgetObserved : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FullObs d → PotentialAtom d := fun z => (z.1, z.2.1, z.2.2.2.1, z.2.2.2.2) let R : PMF (PotentialAtom d) := Q.pmf.map forgetObserved refine ⟨R, ?_⟩ rw [show R.map observedFromPotential = Q.pmf.map (observedFromPotential ∘ forgetObserved) by simp [R, PMF.map_comp]] apply PMF.ext intro z rw [PMF.map_apply] have hzero (w : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FullObs d) (hw : w.2.2.1 ≠ (if w.2.1 then w.2.2.2.2 else w.2.2.2.1)) : Q.pmf w = 0 := by have hr := h w hw unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass at hr apply ((ENNReal.toReal_eq_zero_iff _).mp hr).resolve_right exact PMF.apply_ne_top Q.pmf w by_cases hz : z.2.2.1 = (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) · have heqz : z = (observedFromPotential ∘ forgetObserved) z := by rcases z with ⟨x, a, y, y0, y1⟩ simp only [Function.comp_apply, observedFromPotential, forgetObserved, Prod.mk.injEq] at hz ⊢ aesop rw [tsum_eq_single z] · rw [if_pos heqz] · intro w hw split_ifs with heq · apply hzero w intro hcanonical apply hw rcases z with ⟨x, a, y, y0, y1⟩ rcases w with ⟨x', a', y', y0', y1'⟩ simp only [Function.comp_apply, observedFromPotential, forgetObserved, Prod.mk.injEq] at heq simp only [Prod.mk.injEq] at hz hcanonical ⊢ aesop · rfl · rw [hzero z hz] symm apply ENNReal.tsum_eq_zero.2 intro w split_ifs with heq · exfalso apply hz rcases z with ⟨x, a, y, y0, y1⟩ rcases w with ⟨x', a', y', y0', y1'⟩ simp only [Function.comp_apply, observedFromPotential, forgetObserved, Prod.mk.injEq] at heq ⊢ aesop · rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.canonicalObservedOutcome_of_consistency · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:41

The potential law structure records the data and laws for d.

Definition (Lean source)
d :
ℕ
fourPmf :
@realizes P(primary probability law of X,A,Y(0),Y(1))
val :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw d
canonical :
val.pmf = fourPmf.map observedFromPotential
@realizes P(observed Y is fixed by the four-coordinate law at the binder)
consistent :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency val
CausalSmith.Stat.DiscreteBudgetvalueCurve.PotentialLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:98
def pmf

For d, Q, the pmf definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
pmf Q :
PMF (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FullObs d)
Q.val.pmf
CausalSmith.Stat.DiscreteBudgetvalueCurve.PotentialLaw.pmf · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:108
theorem property

The property result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
conclusion 1
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency Q.val
conclusion 2
Proof (Lean source)
theorem property {d : ℕ} (Q : PotentialLaw d) : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency Q.val ∧ CanonicalObservedOutcome Q.val := ⟨Q.consistent, ⟨Q.fourPmf, Q.canonical⟩⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.PotentialLaw.property · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:111
instance instCoePotentialLawPotentialLaw

For d, this instance provides the stated structure.

Definition (Lean source)
instance {d : ℕ} : Coe (PotentialLaw d) (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw d) where coe Q := Q.val
CausalSmith.Stat.DiscreteBudgetvalueCurve.instCoePotentialLawPotentialLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:117
def FullObs

the full obs definition specifies the stated object.

Definition (Lean source)
d :
ℕ
shared
FullObs d :
Type
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FullObs
CausalSmith.Stat.DiscreteBudgetvalueCurve.FullObs · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:121
def jointMass

For d, P, j, a, the joint mass definition specifies the stated object.

Definition (Lean source)
d :
ℕ
P :
j :
Fin d
a y :
jointMass P j a y :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass P j a y
CausalSmith.Stat.DiscreteBudgetvalueCurve.jointMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:123
def fullMass

For d, Q, z, the full mass definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
z :
fullMass Q z :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass Q z
CausalSmith.Stat.DiscreteBudgetvalueCurve.fullMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:126
def cellVector

For d, P, j, the cell vector definition specifies the stated object.

Definition (Lean source)
d :
ℕ
P :
j :
Fin d
cellVector P j :
Cell → ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector P j
CausalSmith.Stat.DiscreteBudgetvalueCurve.cellVector · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:129

For d, P, j, the cell mass definition specifies the stated object.

Definition (Lean source)
d :
ℕ
P :
j :
Fin d
cellMass P j :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass P j
CausalSmith.Stat.DiscreteBudgetvalueCurve.cellMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:133
def armMass

For d, P, a, j, the arm mass definition specifies the stated object.

Definition (Lean source)
d :
ℕ
P :
a :
j :
Fin d
armMass P a j :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass P a j
CausalSmith.Stat.DiscreteBudgetvalueCurve.armMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:136
def propensity

For d, P, j, the propensity definition specifies the stated object.

Definition (Lean source)
d :
ℕ
P :
j :
Fin d
propensity P j :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.propensity P j
CausalSmith.Stat.DiscreteBudgetvalueCurve.propensity · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:139

For d, P, n, the product law definition specifies the stated object.

Definition (Lean source)
d :
ℕ
P :
n :
ℕ
productLaw P n :
Measure (Fin n → Obs d)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.productLaw P n
CausalSmith.Stat.DiscreteBudgetvalueCurve.productLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:143

For d, Q, the observed marginal definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
observedMarginal Q :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal Q
CausalSmith.Stat.DiscreteBudgetvalueCurve.observedMarginal · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:146

For d, Q, j, the po cell mass definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
j :
Fin d
poCellMass Q j :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass Q j
CausalSmith.Stat.DiscreteBudgetvalueCurve.poCellMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:150
def poRegression

For d, Q, a, j, the po regression definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
a :
Fin 2
j :
Fin d
poRegression Q a j :
ℝ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression Q a j
CausalSmith.Stat.DiscreteBudgetvalueCurve.poRegression · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:153
def ObservedRecord

The finite observation carrier.

Definition (Lean source)
d :
ℕ
ObservedRecord d :
Type
Obs d
CausalSmith.Stat.DiscreteBudgetvalueCurve.ObservedRecord · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:164

A finite observed sample.

Definition (Lean source)
n d :
ℕ
ObservedSample n d :
Type
Fin n → Obs d
CausalSmith.Stat.DiscreteBudgetvalueCurve.ObservedSample · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:169
def observedCellVector

The four nonnegative observed cell masses.

Definition (Lean source)
d :
ℕ
P :
j :
Fin d
observedCellVector P j :
ℝ
CausalSmith.Stat.DiscreteBudgetvalueCurve.observedCellVector · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:173
def IidSampling

For d, P, mu, the iid sampling definition specifies the stated object.

Definition (Lean source)
d n :
ℕ
P :
mu :
Measure (Fin n → Obs d)
IidSampling P mu :
Prop
mu = productLaw P n
CausalSmith.Stat.DiscreteBudgetvalueCurve.IidSampling · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:178
def FullRecord

A four-variable potential-outcome law with its derived observed outcome.

Definition (Lean source)
d :
ℕ
FullRecord d :
Type
CausalSmith.Stat.DiscreteBudgetvalueCurve.FullRecord · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:182
def Consistency

For d, Q, the consistency definition specifies the stated object.

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.DiscreteBudgetvalueCurve.Consistency · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:190
def poPairAtom

Joint atom mass for the two potential outcomes, after marginalizing observed Y.

Definition (Lean source)
d :
ℕ
Q :
j :
Fin d
y0 y1 :
poPairAtom Q j y0 y1 :
ℝ
∑ a : Bool, ∑ y : Bool, fullMass Q (j, a, y, y0, y1)
CausalSmith.Stat.DiscreteBudgetvalueCurve.poPairAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:195
def poTreatmentAtom

Treatment atom mass within a covariate cell.

Definition (Lean source)
d :
ℕ
Q :
j :
Fin d
a :
poTreatmentAtom Q j a :
ℝ
∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, fullMass Q (j, a, y, y0, y1)
CausalSmith.Stat.DiscreteBudgetvalueCurve.poTreatmentAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:200
def poJointAtom

Joint treatment and potential-outcome atom.

Definition (Lean source)
d :
ℕ
Q :
j :
Fin d
a y0 y1 :
poJointAtom Q j a y0 y1 :
ℝ
∑ y : Bool, fullMass Q (j, a, y, y0, y1)
CausalSmith.Stat.DiscreteBudgetvalueCurve.poJointAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:205
def ConditionalExchangeability

For d, Q, the conditional exchangeability definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
j a y0 y1 :
ConditionalExchangeability Q :
Prop
poJointAtom Q j a y0 y1 * poCellMass Q j = poTreatmentAtom Q j a * poPairAtom Q j y0 y1
CausalSmith.Stat.DiscreteBudgetvalueCurve.ConditionalExchangeability · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:211

For d, epsilon, P, the overlap definition specifies the stated object.

Definition (Lean source)
d :
ℕ
epsilon :
ℝ
P :
j :
0 < cellMass P j
Overlap epsilon P :
Prop
clause 1
epsilon ≤ propensity P j
clause 2
propensity P j ≤ 1 - epsilon
CausalSmith.Stat.DiscreteBudgetvalueCurve.Overlap · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:219
structure CausalModelClass

The causal model class structure records the data and laws for epsilon, d, Q.

Definition (Lean source)
epsilon :
ℝ
d :
ℕ
Q :
alphabet :
2 ≤ d
overlapParameter :
epsilon ∈ Ioo (0 : ℝ) (1 / 2)
consistency :
Consistency Q

@realizes \epsilon(model overlap parameter in (0,1/2))

exchangeability :
overlap :
CausalSmith.Stat.DiscreteBudgetvalueCurve.CausalModelClass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:226

Cell effect, totalized to zero on null cells.

Definition (Lean source)
d :
ℕ
Q :
j :
Fin d
effect Q j :
ℝ
CausalSmith.Stat.DiscreteBudgetvalueCurve.effect · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:236

Cell potential-outcome regression.

Definition (Lean source)
d :
ℕ
Q :
a :
Fin 2
j :
Fin d
potentialMean Q a j :
ℝ
CausalSmith.Stat.DiscreteBudgetvalueCurve.potentialMean · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:241
def budgetPolicyClass

For d, Q, b, the budget policy class definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
b :
Icc (0 : ℝ) 1
budgetPolicyClass Q b :
Set (Fin d → ℝ)
{pi | (∀ j, pi j ∈ Icc (0 : ℝ) 1) ∧ ∑ j, poCellMass Q j * pi j ≤ b.1}
CausalSmith.Stat.DiscreteBudgetvalueCurve.budgetPolicyClass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:247

Value of the never-treat policy.

Definition (Lean source)
d :
ℕ
Q :
controlValue Q :
ℝ
∑ j, poCellMass Q j * poRegression Q 0 j
CausalSmith.Stat.DiscreteBudgetvalueCurve.controlValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:254
def budgetValue

For d, Q, b, the budget value definition specifies the stated object.

Definition (Lean source)
d :
ℕ
Q :
b :
ℝ
budgetValue Q b :
ℝ
if hb : b ∈ Icc (0 : ℝ) 1 then controlValue Q
+ sSup ((fun pi : Fin d → ℝ => ∑ j, poCellMass Q j * pi j * effect Q j) '' budgetPolicyClass Q ⟨b, hb⟩) else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.budgetValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:260
theorem poRegression_unit_interval_budget

The po regression unit interval budget result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
a :
Fin 2
j :
Fin d
poRegression Q a j ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma poRegression_unit_interval_budget {d : ℕ} (Q : PotentialLaw d) (a : Fin 2) (j : Fin d) : poRegression Q a j ∈ Icc (0 : ℝ) 1 := by have hmass : 0 ≤ poCellMass Q j := by unfold poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass exact Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => ENNReal.toReal_nonneg let num : ℝ := ∑ arm : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (if (if a = 0 then y0 else y1) then 1 else 0 : ℝ) * CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass Q (j, arm, y, y0, y1) have hnum_nonneg : 0 ≤ num := by dsimp [num] apply Finset.sum_nonneg intro arm _ apply Finset.sum_nonneg intro y _ apply Finset.sum_nonneg intro y0 _ apply Finset.sum_nonneg intro y1 _ exact mul_nonneg (by split_ifs <;> norm_num) ENNReal.toReal_nonneg have hnum_le : num ≤ poCellMass Q j := by dsimp [num, poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass] apply Finset.sum_le_sum intro arm _ apply Finset.sum_le_sum intro y _ apply Finset.sum_le_sum intro y0 _ apply Finset.sum_le_sum intro y1 _ split_ifs <;> simp [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass, ENNReal.toReal_nonneg] change 0 ≤ num / poCellMass Q j ∧ num / poCellMass Q j ≤ 1 constructor · exact div_nonneg hnum_nonneg hmass · by_cases hp : poCellMass Q j = 0 · simp [hp] at hnum_nonneg hnum_le ⊢ · exact (div_le_iff₀ (lt_of_le_of_ne hmass (Ne.symm hp))).2 (by simpa using hnum_le)
CausalSmith.Stat.DiscreteBudgetvalueCurve.poRegression_unit_interval_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:269
theorem poCellMass_sum_one_budget

The po cell mass sum one budget result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
∑ j : Fin d, poCellMass Q j = 1
Proof (Lean source)
lemma poCellMass_sum_one_budget {d : ℕ} (Q : PotentialLaw d) : ∑ j : Fin d, poCellMass Q j = 1 := by calc _ = ∑ z : FullObs d, (Q.pmf z).toReal := by simp [poCellMass, PotentialLaw.pmf, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum Q.pmf (fun _ : FullObs d => (1 : ℝ))).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.poCellMass_sum_one_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:310
theorem budgetValue_unit_interval

The budget value unit interval result. Under the hb premise, It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
b :
ℝ
hb :
b ∈ Icc (0 : ℝ) 1
budgetValue Q b ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma budgetValue_unit_interval {d : ℕ} (Q : PotentialLaw d) (b : ℝ) (hb : b ∈ Icc (0 : ℝ) 1) : budgetValue Q b ∈ Icc (0 : ℝ) 1 := by let gain (pi : Fin d → ℝ) := ∑ j, poCellMass Q j * pi j * effect Q j have hmass (j : Fin d) : 0 ≤ poCellMass Q j := by unfold poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass exact Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => ENNReal.toReal_nonneg have hvalue (pi : Fin d → ℝ) (hpi : pi ∈ budgetPolicyClass Q ⟨b, hb⟩) : 0 ≤ controlValue Q + gain pi ∧ controlValue Q + gain pi ≤ 1 := by have heq : controlValue Q + gain pi = ∑ j, poCellMass Q j * ((1 - pi j) * poRegression Q 0 j + pi j * poRegression Q 1 j) := by simp only [controlValue, gain, effect, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j _ ring rw [heq] constructor · apply Finset.sum_nonneg intro j _ have h0 := poRegression_unit_interval_budget Q 0 j have h1 := poRegression_unit_interval_budget Q 1 j exact mul_nonneg (hmass j) (add_nonneg (mul_nonneg (by linarith [(hpi.1 j).2]) h0.1) (mul_nonneg (hpi.1 j).1 h1.1)) · calc _ ≤ ∑ j : Fin d, poCellMass Q j := by apply Finset.sum_le_sum intro j _ have h0 := poRegression_unit_interval_budget Q 0 j have h1 := poRegression_unit_interval_budget Q 1 j have hj : (1 - pi j) * poRegression Q 0 j + pi j * poRegression Q 1 j ≤ 1 := by calc _ ≤ (1 - pi j) * 1 + pi j * 1 := by exact add_le_add (mul_le_mul_of_nonneg_left h0.2 (by linarith [(hpi.1 j).2])) (mul_le_mul_of_nonneg_left h1.2 (hpi.1 j).1) _ = 1 := by ring exact mul_le_of_le_one_right (hmass j) hj _ = 1 := poCellMass_sum_one_budget Q let pi0 : Fin d → ℝ := fun _ => 0 have hpi0 : pi0 ∈ budgetPolicyClass Q ⟨b, hb⟩ := by constructor · intro j norm_num [pi0] · simp [pi0, hb.1] have hsup : 0 ≤ sSup (gain '' budgetPolicyClass Q ⟨b, hb⟩) + controlValue Q ∧ sSup (gain '' budgetPolicyClass Q ⟨b, hb⟩) + controlValue Q ≤ 1 := by have hne : (gain '' budgetPolicyClass Q ⟨b, hb⟩).Nonempty := ⟨gain pi0, pi0, hpi0, rfl⟩ have hbd : BddAbove (gain '' budgetPolicyClass Q ⟨b, hb⟩) := by refine ⟨1 - controlValue Q, ?_⟩ rintro _ ⟨pi, hpi, rfl⟩ linarith [(hvalue pi hpi).2] constructor · have h := le_csSup hbd (Set.mem_image_of_mem gain hpi0) have h0 := (hvalue pi0 hpi0).1 linarith · have h := csSup_le hne (show ∀ x ∈ gain '' budgetPolicyClass Q ⟨b, hb⟩, x ≤ 1 - controlValue Q by rintro x ⟨pi, hpi, rfl⟩ linarith [(hvalue pi hpi).2]) linarith simpa [budgetValue, hb, gain, add_comm] using hsup
CausalSmith.Stat.DiscreteBudgetvalueCurve.budgetValue_unit_interval · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:323
theorem budgetValue_order_lipschitz

The budget value order lipschitz result. Under the horder premise, It proves the stated conclusion. The argument assumes the two ordered-budget premises.

Formal statement
d :
ℕ
Q :
b₁ b₂ :
ℝ
hb₁ :
b₁ ∈ Icc (0 : ℝ) 1
hb₂ :
b₂ ∈ Icc (0 : ℝ) 1
horder :
b₁ ≤ b₂
conclusion 1
0 ≤ budgetValue Q b₂ - budgetValue Q b₁
conclusion 2
budgetValue Q b₂ - budgetValue Q b₁ ≤ b₂ - b₁
Proof (Lean source)
lemma budgetValue_order_lipschitz {d : ℕ} (Q : PotentialLaw d) {b₁ b₂ : ℝ} (hb₁ : b₁ ∈ Icc (0 : ℝ) 1) (hb₂ : b₂ ∈ Icc (0 : ℝ) 1) (horder : b₁ ≤ b₂) : 0 ≤ budgetValue Q b₂ - budgetValue Q b₁ ∧ budgetValue Q b₂ - budgetValue Q b₁ ≤ b₂ - b₁ := by let p : Fin d → ℝ := poCellMass Q let tau : Fin d → ℝ := effect Q let gain (pi : Fin d → ℝ) := ∑ j, p j * pi j * tau j let cost (pi : Fin d → ℝ) := ∑ j, p j * pi j let feasible (b : ℝ) := {pi : Fin d → ℝ | (∀ j, pi j ∈ Icc (0 : ℝ) 1) ∧ cost pi ≤ b} have hp (j : Fin d) : 0 ≤ p j := by dsimp [p, poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass] exact Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => ENNReal.toReal_nonneg have ht (j : Fin d) : tau j ≤ 1 := by have h0 := (poRegression_unit_interval_budget Q 0 j).1 have h1 := (poRegression_unit_interval_budget Q 1 j).2 dsimp [tau, effect] linarith have hzero (b : ℝ) (hb : 0 ≤ b) : (fun _ : Fin d => (0 : ℝ)) ∈ feasible b := by constructor · intro j; norm_num · simp [cost, hb] have hne (b : ℝ) (hb : 0 ≤ b) : (gain '' feasible b).Nonempty := ⟨gain (fun _ => 0), _, hzero b hb, rfl⟩ have hcost_nonneg (pi : Fin d → ℝ) (hpi : ∀ j, pi j ∈ Icc (0 : ℝ) 1) : 0 ≤ cost pi := by dsimp [cost] exact Finset.sum_nonneg (fun j _ => mul_nonneg (hp j) (hpi j).1) have hgain_le_cost (pi : Fin d → ℝ) (hpi : ∀ j, pi j ∈ Icc (0 : ℝ) 1) : gain pi ≤ cost pi := by dsimp [gain, cost] apply Finset.sum_le_sum intro j _ have h := mul_nonneg (hp j) (hpi j).1 nlinarith [mul_le_mul_of_nonneg_left (ht j) h] have hbd (b : ℝ) : BddAbove (gain '' feasible b) := by refine ⟨b, ?_⟩ rintro x ⟨pi, hpi, rfl⟩ exact (hgain_le_cost pi hpi.1).trans hpi.2 have hmono : sSup (gain '' feasible b₁) ≤ sSup (gain '' feasible b₂) := by apply csSup_le (hne b₁ hb₁.1) rintro x ⟨pi, hpi, rfl⟩ apply le_csSup (hbd b₂) exact ⟨pi, ⟨hpi.1, hpi.2.trans horder⟩, rfl⟩ have hupper : sSup (gain '' feasible b₂) ≤ sSup (gain '' feasible b₁) + (b₂ - b₁) := by apply csSup_le (hne b₂ hb₂.1) rintro x ⟨pi, hpi, rfl⟩ by_cases hz : b₂ = 0 · have hb₁z : b₁ = 0 := by linarith [hb₁.1] subst b₁ subst b₂ simpa using le_csSup (hbd 0) (show gain pi ∈ gain '' feasible 0 from ⟨pi, hpi, rfl⟩) · have hb₂pos : 0 < b₂ := lt_of_le_of_ne hb₂.1 (Ne.symm hz) let t : ℝ := b₁ / b₂ have ht0 : 0 ≤ t := div_nonneg hb₁.1 hb₂.1 have ht1 : t ≤ 1 := (div_le_one hb₂pos).2 horder let pi' : Fin d → ℝ := fun j => t * pi j have hpi' : pi' ∈ feasible b₁ := by constructor · intro j dsimp [pi'] constructor · exact mul_nonneg ht0 (hpi.1 j).1 · exact (mul_le_mul_of_nonneg_left (hpi.1 j).2 ht0).trans (by simpa using ht1) · have hcost : cost pi' = t * cost pi := by dsimp [cost, pi'] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ ring rw [hcost] calc _ ≤ t * b₂ := mul_le_mul_of_nonneg_left hpi.2 ht0 _ = b₁ := by dsimp [t]; field_simp have hgain : gain pi' = t * gain pi := by dsimp [gain, pi'] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ ring have hgain_bound : gain pi ≤ cost pi := hgain_le_cost pi hpi.1 have hgap : gain pi - gain pi' ≤ b₂ - b₁ := by rw [hgain] have hfac : 0 ≤ 1 - t := by linarith have hmul := mul_le_mul_of_nonneg_left hgain_bound hfac have hmul2 := mul_le_mul_of_nonneg_left hpi.2 hfac have hid : (1 - t) * b₂ = b₂ - b₁ := by dsimp [t]; field_simp nlinarith have hsup := le_csSup (hbd b₁) (show gain pi' ∈ gain '' feasible b₁ from ⟨pi', hpi', rfl⟩) linarith have hv (b : ℝ) (hb : b ∈ Icc (0 : ℝ) 1) : budgetValue Q b = controlValue Q + sSup (gain '' feasible b) := by simp only [budgetValue, dif_pos hb] rfl rw [hv b₂ hb₂, hv b₁ hb₁] constructor <;> linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.budgetValue_order_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:393
def armMassFn

The mass of treatment arm a in a generic four-vector.

Definition (Lean source)
a :
Fin 2
u :
Cell → ℝ
armMassFn a u :
ℝ
u (a, 0) + u (a, 1)
CausalSmith.Stat.DiscreteBudgetvalueCurve.armMassFn · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:496
def totalMass

Total mass of a generic four-vector.

Definition (Lean source)
u :
Cell → ℝ
totalMass u :
ℝ
CausalSmith.Stat.DiscreteBudgetvalueCurve.totalMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:500
def armValue

Globally extended arm value.

Definition (Lean source)
epsilon :
ℝ
a :
Fin 2
u :
Cell → ℝ
armValue epsilon a u :
ℝ
totalMass u * u (a, 1) / max (armMassFn a u) (epsilon * totalMass u)
CausalSmith.Stat.DiscreteBudgetvalueCurve.armValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:504
def thresholdFun

Cellwise threshold functional.

Definition (Lean source)
epsilon :
ℝ
lambda :
Icc (0 : ℝ) 1
u :
Cell → ℝ
thresholdFun epsilon lambda u :
ℝ
armValue epsilon 0 u
+ max 0 (armValue epsilon 1 u - armValue epsilon 0 u - lambda.1 * totalMass u)
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFun · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:509
def thresholdFunReal

Zero extension used by intermediate polynomial calculations at real arguments.

Definition (Lean source)
epsilon lambda :
ℝ
u :
Cell → ℝ
thresholdFunReal epsilon lambda u :
ℝ
if h : lambda ∈ Icc (0 : ℝ) 1 then thresholdFun epsilon ⟨lambda, h⟩ u else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFunReal · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:516
def dualProcess

For d, epsilon, P, lambda, the dual process definition specifies the stated object.

Definition (Lean source)
d :
ℕ
epsilon :
ℝ
P :
lambda :
Icc (0 : ℝ) 1
dualProcess epsilon P lambda :
ℝ
∑ j, thresholdFun epsilon lambda (cellVector P j)
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:521
def dualProcessReal

Zero extension of the dual process for real-indexed auxiliary processes.

Definition (Lean source)
d :
ℕ
epsilon :
ℝ
P :
lambda :
ℝ
dualProcessReal epsilon P lambda :
ℝ
if h : lambda ∈ Icc (0 : ℝ) 1 then dualProcess epsilon P ⟨lambda, h⟩ else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualProcessReal · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:527

Bounded measurable curve estimators on the stated interval.

Definition (Lean source)
n d :
ℕ
b0 :
ℝ
CurveEstimator n d b0 :
Type
{f : (Fin n → Obs d) → (Icc b0 (1 - b0) → ℝ) // b0 ∈ Icc (0 : ℝ) (1 / 2) ∧ Measurable f ∧ ∃ B : ℝ, ∀ z b, |f z b| ≤ B}
CausalSmith.Stat.DiscreteBudgetvalueCurve.CurveEstimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:532

Causal laws in the stated model class.

Definition (Lean source)
d :
ℕ
epsilon :
ℝ
ModelLaw d epsilon :
Type
{Q : PotentialLaw d // CausalModelClass epsilon Q}
CausalSmith.Stat.DiscreteBudgetvalueCurve.ModelLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:539
def curveRisk

Squared supremum curve risk at a single causal law.

Definition (Lean source)
n :
ℕ
d :
ℕ
epsilon :
ℝ
b0 :
ℝ
est :
Q :
ModelLaw d epsilon
curveRisk n b0 est Q :
ℝ
∫ z, (⨆ b : Icc b0 (1 - b0), (est.1 z b - budgetValue Q.1 b.1) ^ 2) ∂productLaw (observedMarginal Q.1) n
CausalSmith.Stat.DiscreteBudgetvalueCurve.curveRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:543
def curveMinimaxRisk

For n, epsilon, the curve minimax risk definition specifies the stated object.

Definition (Lean source)
n d :
ℕ
epsilon b0 :
ℝ
curveMinimaxRisk n d epsilon b0 :
ℝ
minimaxValueReal (curveRisk n (d := d) (epsilon := epsilon) b0)
CausalSmith.Stat.DiscreteBudgetvalueCurve.curveMinimaxRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:550

The logarithmic alphabet scale log(e d).

Definition (Lean source)
d :
ℕ
logAlphabet d :
ℝ
log (exp 1 * d)
CausalSmith.Stat.DiscreteBudgetvalueCurve.logAlphabet · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:555
def ProbabilitySimplex

A probability simplex represented by real coordinates.

Definition (Lean source)
k :
ℕ
shared
ProbabilitySimplex k :
Type
CausalSmith.Stat.DiscreteBudgetvalueCurve.ProbabilitySimplex · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:562
def PairedContrasts

Contrasts on the stated cube.

Definition (Lean source)
k :
ℕ
PairedContrasts k :
Type
{theta : Fin k → ℝ // ∀ i, theta i ∈ Icc (-1 / 8) (1 / 8)}
CausalSmith.Stat.DiscreteBudgetvalueCurve.PairedContrasts · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:567
def bernoulliMass

Bernoulli atom mass.

Definition (Lean source)
p :
ℝ
y :
bernoulliMass p y :
ℝ
if y then p else 1 - p
CausalSmith.Stat.DiscreteBudgetvalueCurve.bernoulliMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:572
def pairedFullMass

Full-data atom mass in the paired construction.

Definition (Lean source)
k :
ℕ
r :
ProbabilitySimplex k
theta :
z :
FullObs (2 * k)
pairedFullMass r theta z :
ℝ
pair :
(finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1
mu0 :
1 / 4 (: ℝ)
mu1 :
1 / 2 + (if pair.1 = 0 then 1 else -1) * theta.1 pair.2 (: ℝ)
if z.2.2.1
= (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) then r.1 pair.2 / 4 * bernoulliMass mu0 z.2.2.2.1 * bernoulliMass mu1 z.2.2.2.2 else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedFullMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:575

The finite masses sum to one. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
∑ z : FullObs (2 * k), ofReal (pairedFullMass r theta z) = 1
Proof (Lean source)
-- @node: pairedFullMass_sum lemma pairedFullMass_sum {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) : ∑ z : FullObs (2 * k), ofReal (pairedFullMass r theta z) = 1 := by classical have hcell (j : Fin (2 * k)) : (∑ a : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pairedFullMass r theta (j, a, y, y0, y1)) = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 := by simp [pairedFullMass, bernoulliMass] ring have hm (z : FullObs (2 * k)) : 0 ≤ pairedFullMass r theta z := by let i := ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).2 have ht := theta.2 i have hr := r.2.1 i simp only [Set.mem_Icc] at ht have hmu : 0 ≤ (1 / 2 : ℝ) + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).1 = 0 then 1 else -1) * theta.1 i ∧ (1 / 2 : ℝ) + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).1 = 0 then 1 else -1) * theta.1 i ≤ 1 := by split_ifs <;> constructor <;> nlinarith [ht.1, ht.2] have h0 : 0 ≤ bernoulliMass (1 / 4) z.2.2.2.1 := by cases z.2.2.2.1 <;> norm_num [bernoulliMass] have h1 : 0 ≤ bernoulliMass ((1 / 2 : ℝ) + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).1 = 0 then 1 else -1) * theta.1 i) z.2.2.2.2 := by cases z.2.2.2.2 <;> simp only [bernoulliMass, Bool.false_eq_true, ↓reduceIte] <;> linarith [hmu.1, hmu.2] by_cases hy : z.2.2.1 = (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) · simpa [pairedFullMass, hy, i] using (mul_nonneg (mul_nonneg (div_nonneg hr (by norm_num)) h0) h1) · simp [pairedFullMass, hy] rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => hm z)] have hsum : (∑ z : FullObs (2 * k), pairedFullMass r theta z) = 1 := by simp only [Fintype.sum_prod_type, hcell] rw [← Equiv.sum_comp (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k))] simp [Fintype.sum_prod_type, ← Finset.sum_div, r.2.2] rw [hsum] norm_num
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedFullMass_sum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:585
def pairedLaw

For k, r, theta, the paired law definition specifies the stated object.

Definition (Lean source)
k :
ℕ
r :
ProbabilitySimplex k
theta :
pairedLaw r theta :
PotentialLaw (2 * k)
Q :
⟨PMF.ofFintype (fun z => ofReal (pairedFullMass r theta z)) (pairedFullMass_sum r theta)⟩ (: CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw (2 * k))
have hcons : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency Q := by intro z hz simp [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass, pairedFullMass, hz, Q] let hcanonical := canonicalObservedOutcome_of_consistency Q hcons ⟨Classical.choose hcanonical, Q, Classical.choose_spec hcanonical, hcons⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:629
def PairedCompletion

A completion may couple the two potential outcomes arbitrarily, but their joint law is independent of treatment conditional on the covariate cell.

Definition (Lean source)
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
PairedCompletion Q r theta :
Prop
clause 1
Consistency Q
clause 3
j :
Fin (2 * k)
pair :
(finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j
poCellMass Q j = r.1 pair.2 / 2
poCellMass Q j * poRegression Q 0 j = poCellMass Q j * (1 / 4 : ℝ)
= poCellMass Q j * (1 / 2 + (if pair.1 = 0 then 1 else -1) * theta.1 pair.2)
CausalSmith.Stat.DiscreteBudgetvalueCurve.PairedCompletion · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:643
def pairedFamily

All admissible causal completions of the paired cell marginals.

Definition (Lean source)
k :
ℕ
pairedFamily k :
Set (PotentialLaw (2 * k))
{Q | ∃ r : ProbabilitySimplex k, ∃ theta : PairedContrasts k, PairedCompletion Q r theta}
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedFamily · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Basic.lean:656
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.BVLipschitz 21 declarations Bounded-variation Lipschitz estimate for the threshold process.

Bounded-variation Lipschitz estimate for the threshold process.

def bvNorm

Total-variation norm on the unit shadow-price interval.

Definition (Lean source)
h :
ℝ → ℝ
bvNorm h :
ℝ
|h 0| + (eVariationOn h (Icc 0 1)).toReal
theorem budget_armValue_eq_predecessor Lemma budget_armValue_eq_predecessor in the paper ↗

The arm value agrees on nonnegative cells with the predecessor's totalized extension. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
a :
Fin 2
u :
Cell → ℝ
armValue epsilon a u = DiscreteOptimalValueMinimaxMatched.armCellValue epsilon a u
Proof (Lean source)
-- @node: budget_armValue_eq_predecessor lemma budget_armValue_eq_predecessor (epsilon : ℝ) (a : Fin 2) (u : Cell → ℝ) : armValue epsilon a u = DiscreteOptimalValueMinimaxMatched.armCellValue epsilon a u := by have hm : DiscreteOptimalValueMinimaxMatched.vectorMass u = totalMass u := rfl have ha : DiscreteOptimalValueMinimaxMatched.vectorArmMass u a = armMassFn a u := rfl rw [DiscreteOptimalValueMinimaxMatched.armCellValue, hm, ha] by_cases h : totalMass u = 0 · simp [armValue, h] · simp [armValue, h]
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_armValue_eq_predecessor · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:18
theorem budget_armValue_lipschitz Lemma budget_armValue_lipschitz in the paper ↗

Each arm value is Lipschitz in the four masses on the nonnegative cone. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
u v :
Cell → ℝ
hu :
∀ z, 0 ≤ u z
hv :
∀ z, 0 ≤ v z
a :
Fin 2
|armValue epsilon a u - armValue epsilon a v| ≤ (1 + epsilon⁻¹) * ∑ z, |u z - v z|
Proof (Lean source)
-- @node: budget_armValue_lipschitz lemma budget_armValue_lipschitz {epsilon : ℝ} (he : 0 < epsilon) (u v : Cell → ℝ) (hu : ∀ z, 0 ≤ u z) (hv : ∀ z, 0 ≤ v z) (a : Fin 2) : |armValue epsilon a u - armValue epsilon a v| ≤ (1 + epsilon⁻¹) * ∑ z, |u z - v z| := by rw [budget_armValue_eq_predecessor, budget_armValue_eq_predecessor] simpa [DiscreteOptimalValueMinimaxMatched.l1CellDistance] using DiscreteOptimalValueMinimaxMatched.armCellValue_lipschitz he u v hu hv a
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_armValue_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:31
theorem budget_totalMass_lipschitz Lemma budget_totalMass_lipschitz in the paper ↗

The total mass changes by at most the coordinatewise L1 distance. With the specified inputs and conditions, the stated relationship holds.

Formal statement
u v :
Cell → ℝ
|totalMass u - totalMass v| ≤ ∑ z, |u z - v z|
Proof (Lean source)
-- @node: budget_totalMass_lipschitz lemma budget_totalMass_lipschitz (u v : Cell → ℝ) : |totalMass u - totalMass v| ≤ ∑ z, |u z - v z| := by have h := Finset.abs_sum_le_sum_abs (s := univ) (f := fun z : Cell => u z - v z) have hsum : (∑ z : Cell, (u z - v z)) = totalMass u - totalMass v := by simp [totalMass, armMassFn, Fintype.sum_prod_type, Fin.sum_univ_two] rw [← hsum] exact h
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_totalMass_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:42
theorem budget_hinge_pointwise_lipschitz Lemma budget_hinge_pointwise_lipschitz in the paper ↗

Perturbing both arm values and the total mass perturbs a threshold hinge. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a b c d s t lambda :
ℝ
|(a + max 0 (b - a - lambda * s)) - (c + max 0 (d - c - lambda * t))|
≤ 2 * |a - c| + |b - d| + |lambda| * |s - t|
Proof (Lean source)
-- @node: budget_hinge_pointwise_lipschitz lemma budget_hinge_pointwise_lipschitz (a b c d s t lambda : ℝ) : |(a + max 0 (b - a - lambda * s)) - (c + max 0 (d - c - lambda * t))| ≤ 2 * |a - c| + |b - d| + |lambda| * |s - t| := by have hmax := abs_max_sub_max_le_abs (b - a - lambda * s) (d - c - lambda * t) 0 have hinner : |(b - a - lambda * s) - (d - c - lambda * t)| ≤ |b - d| + |a - c| + |lambda| * |s - t| := by have heq : (b - a - lambda * s) - (d - c - lambda * t) = (b - d) - (a - c) - lambda * (s - t) := by ring rw [heq] calc |(b - d) - (a - c) - lambda * (s - t)| ≤ |(b - d) - (a - c)| + |lambda * (s - t)| := by simpa only [sub_eq_add_neg, abs_neg] using (abs_add_le ((b - d) - (a - c)) (-(lambda * (s - t)))) _ ≤ |b - d| + |a - c| + |lambda| * |s - t| := by rw [abs_mul] have h : |(b - d) - (a - c)| ≤ |b - d| + |a - c| := by simpa only [sub_eq_add_neg, abs_neg] using (abs_add_le (b - d) (-(a - c))) linarith have houter : |(a + max 0 (b - a - lambda * s)) - (c + max 0 (d - c - lambda * t))| ≤ |a - c| + |max 0 (b - a - lambda * s) - max 0 (d - c - lambda * t)| := by have heq : (a + max 0 (b - a - lambda * s)) - (c + max 0 (d - c - lambda * t)) = (a - c) + (max 0 (b - a - lambda * s) - max 0 (d - c - lambda * t)) := by ring rw [heq] exact abs_add_le _ _ have hmax' : |max 0 (b - a - lambda * s) - max 0 (d - c - lambda * t)| ≤ |(b - a - lambda * s) - (d - c - lambda * t)| := by simpa only [max_comm 0 (b - a - lambda * s), max_comm 0 (d - c - lambda * t)] using hmax linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_hinge_pointwise_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:53
theorem budget_thresholdFunReal_pointwise_lipschitz Lemma budget_thresholdFunReal_pointwise_lipschitz in the paper ↗

At each shadow price, the threshold process inherits a cellwise L1 bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
u v :
Cell → ℝ
hu :
∀ z, 0 ≤ u z
hv :
∀ z, 0 ≤ v z
|thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v|
≤ (3 * (1 + epsilon⁻¹) + 1) * ∑ z, |u z - v z|
Proof (Lean source)
-- @node: budget_thresholdFunReal_pointwise_lipschitz lemma budget_thresholdFunReal_pointwise_lipschitz {epsilon : ℝ} (he : 0 < epsilon) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) (u v : Cell → ℝ) (hu : ∀ z, 0 ≤ u z) (hv : ∀ z, 0 ≤ v z) : |thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v| ≤ (3 * (1 + epsilon⁻¹) + 1) * ∑ z, |u z - v z| := by let D := ∑ z, |u z - v z| let L := 1 + epsilon⁻¹ have h0 := budget_armValue_lipschitz he u v hu hv 0 have h1 := budget_armValue_lipschitz he u v hu hv 1 have hs := budget_totalMass_lipschitz u v have hD : 0 ≤ D := Finset.sum_nonneg (fun z _ => abs_nonneg _) have hlam : |lambda| ≤ 1 := by rw [abs_of_nonneg hlambda.1]; exact hlambda.2 have hmass : |lambda| * |totalMass u - totalMass v| ≤ D := by calc |lambda| * |totalMass u - totalMass v| ≤ 1 * |totalMass u - totalMass v| := by exact mul_le_mul_of_nonneg_right hlam (abs_nonneg _) _ ≤ D := by simpa only [one_mul, D] using hs have hhinge := budget_hinge_pointwise_lipschitz (armValue epsilon 0 u) (armValue epsilon 1 u) (armValue epsilon 0 v) (armValue epsilon 1 v) (totalMass u) (totalMass v) lambda simp only [thresholdFunReal, dif_pos hlambda, thresholdFun] at ⊢ dsimp [D, L] at * nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_thresholdFunReal_pointwise_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:95
theorem budget_positiveGain_bounds Lemma budget_positiveGain_bounds in the paper ↗

The hinge height is a nonnegative fraction of the cell mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
u :
Cell → ℝ
hu :
∀ z, 0 ≤ u z
conclusion 1
0 ≤ max 0 (armValue epsilon 1 u - armValue epsilon 0 u)
conclusion 2
max 0 (armValue epsilon 1 u - armValue epsilon 0 u) ≤ totalMass u
Proof (Lean source)
-- @node: budget_positiveGain_bounds lemma budget_positiveGain_bounds {epsilon : ℝ} (he : 0 < epsilon) (u : Cell → ℝ) (hu : ∀ z, 0 ≤ u z) : 0 ≤ max 0 (armValue epsilon 1 u - armValue epsilon 0 u) ∧ max 0 (armValue epsilon 1 u - armValue epsilon 0 u) ≤ totalMass u := by have h0 := DiscreteOptimalValueMinimaxMatched.armCellValue_bounds he u hu 0 have h1 := DiscreteOptimalValueMinimaxMatched.armCellValue_bounds he u hu 1 rw [← budget_armValue_eq_predecessor] at h0 rw [← budget_armValue_eq_predecessor] at h1 change 0 ≤ armValue epsilon 0 u ∧ armValue epsilon 0 u ≤ totalMass u at h0 change 0 ≤ armValue epsilon 1 u ∧ armValue epsilon 1 u ≤ totalMass u at h1 change 0 ≤ max 0 (armValue epsilon 1 u - armValue epsilon 0 u) ∧ max 0 (armValue epsilon 1 u - armValue epsilon 0 u) ≤ totalMass u constructor · exact le_max_left _ _ · exact max_le (le_trans h1.1 h1.2) (by linarith)
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_positiveGain_bounds · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:123
theorem budget_positiveGain_lipschitz Lemma budget_positiveGain_lipschitz in the paper ↗

The positive treatment gain inherits the two arm-value perturbation bounds. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
u v :
Cell → ℝ
hu :
∀ z, 0 ≤ u z
hv :
∀ z, 0 ≤ v z
|max 0 (armValue epsilon 1 u - armValue epsilon 0 u)
- max 0 (armValue epsilon 1 v - armValue epsilon 0 v)|
≤ 2 * (1 + epsilon⁻¹) * ∑ z, |u z - v z|
Proof (Lean source)
-- @node: budget_positiveGain_lipschitz lemma budget_positiveGain_lipschitz {epsilon : ℝ} (he : 0 < epsilon) (u v : Cell → ℝ) (hu : ∀ z, 0 ≤ u z) (hv : ∀ z, 0 ≤ v z) : |max 0 (armValue epsilon 1 u - armValue epsilon 0 u) - max 0 (armValue epsilon 1 v - armValue epsilon 0 v)| ≤ 2 * (1 + epsilon⁻¹) * ∑ z, |u z - v z| := by have h0 := budget_armValue_lipschitz he u v hu hv 0 have h1 := budget_armValue_lipschitz he u v hu hv 1 have hmax := abs_max_sub_max_le_abs (armValue epsilon 1 u - armValue epsilon 0 u) (armValue epsilon 1 v - armValue epsilon 0 v) 0 have htriangle : |(armValue epsilon 1 u - armValue epsilon 0 u) - (armValue epsilon 1 v - armValue epsilon 0 v)| ≤ |armValue epsilon 1 u - armValue epsilon 1 v| + |armValue epsilon 0 u - armValue epsilon 0 v| := by have heq : (armValue epsilon 1 u - armValue epsilon 0 u) - (armValue epsilon 1 v - armValue epsilon 0 v) = (armValue epsilon 1 u - armValue epsilon 1 v) - (armValue epsilon 0 u - armValue epsilon 0 v) := by ring rw [heq] simpa only [sub_eq_add_neg, abs_neg] using (abs_add_le (armValue epsilon 1 u - armValue epsilon 1 v) (-(armValue epsilon 0 u - armValue epsilon 0 v))) have hmax' : |max 0 (armValue epsilon 1 u - armValue epsilon 0 u) - max 0 (armValue epsilon 1 v - armValue epsilon 0 v)| ≤ |(armValue epsilon 1 u - armValue epsilon 0 u) - (armValue epsilon 1 v - armValue epsilon 0 v)| := by simpa only [max_comm 0 (armValue epsilon 1 u - armValue epsilon 0 u), max_comm 0 (armValue epsilon 1 v - armValue epsilon 0 v)] using hmax linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_positiveGain_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:141
theorem budget_positiveGain_threshold_rewrite Lemma budget_positiveGain_threshold_rewrite in the paper ↗

Subtracting a nonnegative threshold commutes with taking positive gain. With the specified inputs and conditions, the stated relationship holds.

Formal statement
gain threshold :
ℝ
hthreshold :
0 ≤ threshold
max 0 (gain - threshold) = max 0 (max 0 gain - threshold)
Proof (Lean source)
-- @node: budget_positiveGain_threshold_rewrite lemma budget_positiveGain_threshold_rewrite (gain threshold : ℝ) (hthreshold : 0 ≤ threshold) : max 0 (gain - threshold) = max 0 (max 0 gain - threshold) := by rcases le_total gain 0 with hgain | hgain · rw [max_eq_left hgain] have h : gain - threshold ≤ 0 := by linarith have h' : 0 - threshold ≤ 0 := by linarith rw [max_eq_left h, max_eq_left h'] · rw [max_eq_right hgain]
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_positiveGain_threshold_rewrite · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:176
theorem budget_thresholdFunReal_hinge_decomposition Lemma budget_thresholdFunReal_hinge_decomposition in the paper ↗

On the unit interval the threshold cell functional is a constant plus a hinge. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
u :
Cell → ℝ
hu :
∀ z, 0 ≤ u z
thresholdFunReal epsilon lambda u
= armValue epsilon 0 u
+ max 0 (max 0 (armValue epsilon 1 u - armValue epsilon 0 u) - lambda * totalMass u)
Proof (Lean source)
-- @node: budget_thresholdFunReal_hinge_decomposition lemma budget_thresholdFunReal_hinge_decomposition {epsilon : ℝ} (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) (u : Cell → ℝ) (hu : ∀ z, 0 ≤ u z) : thresholdFunReal epsilon lambda u = armValue epsilon 0 u + max 0 (max 0 (armValue epsilon 1 u - armValue epsilon 0 u) - lambda * totalMass u) := by have hs : 0 ≤ totalMass u := by simp only [totalMass, armMassFn] nlinarith [hu (0, 0), hu (0, 1), hu (1, 0), hu (1, 1)] have ht : 0 ≤ lambda * totalMass u := mul_nonneg hlambda.1 hs simp only [thresholdFunReal, dif_pos hlambda, thresholdFun] rw [budget_positiveGain_threshold_rewrite _ _ ht]
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_thresholdFunReal_hinge_decomposition · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:188

The positive hinge changes formula at its mass-normalized cutoff. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a s lambda :
ℝ
ha :
0 ≤ a
hs :
0 ≤ s
has :
a ≤ s
max 0 (a - lambda * s)
= if lambda ≤ (if s = 0 then 0 else a / s) then a - lambda * s else 0
Proof (Lean source)
-- @node: budget_hinge_cutoff lemma budget_hinge_cutoff (a s lambda : ℝ) (ha : 0 ≤ a) (hs : 0 ≤ s) (has : a ≤ s) : max 0 (a - lambda * s) = if lambda ≤ (if s = 0 then 0 else a / s) then a - lambda * s else 0 := by by_cases hzero : s = 0 · have ha0 : a = 0 := le_antisymm (hzero ▸ has) ha simp [hzero, ha0] · have hspos : 0 < s := lt_of_le_of_ne hs (Ne.symm hzero) have hiff : lambda ≤ a / s ↔ lambda * s ≤ a := by rw [le_div_iff₀ hspos] simp only [hzero, ↓reduceIte] split_ifs with h · exact max_eq_right (by linarith [(hiff.mp h)] ) · exact max_eq_left (by have := (hiff.not.mp h); linarith)
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_hinge_cutoff · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:204
theorem budget_affine_variation_eq Lemma budget_affine_variation_eq in the paper ↗

An affine path has variation equal to its endpoint displacement. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f :
ℝ → ℝ
c m l u :
ℝ
hlu :
l ≤ u
heq :
EqOn f (fun x => c + m * x) (Icc l u)
eVariationOn f (Icc l u) = ofReal |f u - f l|
Proof (Lean source)
-- @node: budget_affine_variation_eq lemma budget_affine_variation_eq (f : ℝ → ℝ) (c m l u : ℝ) (hlu : l ≤ u) (heq : EqOn f (fun x => c + m * x) (Icc l u)) : eVariationOn f (Icc l u) = ofReal |f u - f l| := by have hvar : eVariationOn f (Icc l u) = eVariationOn (fun x => c + m * x) (Icc l u) := eVariationOn.eq_of_eqOn heq rw [hvar] have hm : 0 ≤ m ∨ m ≤ 0 := le_total 0 m rcases hm with hm | hm · have hmono : MonotoneOn (fun x : ℝ => c + m * x) (Icc l u) := by intro x hx y hy hxy dsimp nlinarith [mul_nonneg hm (sub_nonneg.mpr hxy)] have h := hmono.eVariationOn_eq (Set.left_mem_Icc.mpr hlu) (Set.right_mem_Icc.mpr hlu) simp only [Set.inter_eq_self_of_subset_left (Set.Subset.refl _)] at h rw [h] congr 1 rw [heq (Set.right_mem_Icc.mpr hlu), heq (Set.left_mem_Icc.mpr hlu)] have hle := hmono (Set.left_mem_Icc.mpr hlu) (Set.right_mem_Icc.mpr hlu) hlu rw [abs_of_nonneg (sub_nonneg.mpr hle)] · have hanti : AntitoneOn (fun x : ℝ => c + m * x) (Icc l u) := by intro x hx y hy hxy dsimp nlinarith [mul_nonpos_of_nonpos_of_nonneg hm (sub_nonneg.mpr hxy)] have hanti' : eVariationOn (fun x : ℝ => c + m * x) (Icc l u) = ofReal ((c + m*l) - (c + m*u)) := by have hmono : MonotoneOn (fun x : ℝ => -(c + m*x)) (Icc l u) := by intro x hx y hy hxy exact neg_le_neg (hanti hx hy hxy) have h := hmono.eVariationOn_eq (Set.left_mem_Icc.mpr hlu) (Set.right_mem_Icc.mpr hlu) simp only [Set.inter_eq_self_of_subset_left (Set.Subset.refl _)] at h have hneg : eVariationOn (fun x : ℝ => -(c + m*x)) (Icc l u) = eVariationOn (fun x : ℝ => c + m*x) (Icc l u) := by unfold eVariationOn congr 1 with p congr 1 with i simp [edist_dist, Real.dist_eq] rw [hneg] at h convert h using 1 congr 1 ring rw [hanti'] congr 1 rw [heq (Set.right_mem_Icc.mpr hlu), heq (Set.left_mem_Icc.mpr hlu)] have hle := hanti (Set.left_mem_Icc.mpr hlu) (Set.right_mem_Icc.mpr hlu) hlu rw [abs_of_nonpos (sub_nonpos.mpr hle)] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_affine_variation_eq · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:220
theorem budget_three_piece_variation_le Lemma budget_three_piece_variation_le in the paper ↗

A three-piece affine path has variation bounded by six times its sup norm. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f :
ℝ → ℝ
r t M :
ℝ
h0r :
0 ≤ r
hrt :
r ≤ t
ht1 :
t ≤ 1
hbound :
∀ x ∈ Icc (0 : ℝ) 1, |f x| ≤ M
h₁ :
∃ c m, EqOn f (fun x => c + m * x) (Icc 0 r)
h₂ :
∃ c m, EqOn f (fun x => c + m * x) (Icc r t)
h₃ :
∃ c m, EqOn f (fun x => c + m * x) (Icc t 1)
(eVariationOn f (Icc 0 1)).toReal ≤ 6*M
Proof (Lean source)
-- @node: budget_three_piece_variation_le lemma budget_three_piece_variation_le (f : ℝ → ℝ) (r t M : ℝ) (h0r : 0 ≤ r) (hrt : r ≤ t) (ht1 : t ≤ 1) (hbound : ∀ x ∈ Icc (0 : ℝ) 1, |f x| ≤ M) (h₁ : ∃ c m, EqOn f (fun x => c + m * x) (Icc 0 r)) (h₂ : ∃ c m, EqOn f (fun x => c + m * x) (Icc r t)) (h₃ : ∃ c m, EqOn f (fun x => c + m * x) (Icc t 1)) : (eVariationOn f (Icc 0 1)).toReal ≤ 6*M := by rcases h₁ with ⟨c₁, m₁, h₁⟩ rcases h₂ with ⟨c₂, m₂, h₂⟩ rcases h₃ with ⟨c₃, m₃, h₃⟩ have hv₁ := budget_affine_variation_eq f c₁ m₁ 0 r h0r h₁ have hv₂ := budget_affine_variation_eq f c₂ m₂ r t hrt h₂ have hv₃ := budget_affine_variation_eq f c₃ m₃ t 1 ht1 h₃ have hs₁ : eVariationOn f (Icc 0 r) + eVariationOn f (Icc r 1) = eVariationOn f (Icc 0 1) := by simpa using eVariationOn.Icc_add_Icc f (s := univ) h0r (hrt.trans ht1) (Set.mem_univ r) have hs₂ : eVariationOn f (Icc r t) + eVariationOn f (Icc t 1) = eVariationOn f (Icc r 1) := by simpa using eVariationOn.Icc_add_Icc f (s := univ) hrt ht1 (Set.mem_univ t) rw [← hs₁, ← hs₂, hv₁, hv₂, hv₃] rw [ENNReal.toReal_add (by simp) (by simp), ENNReal.toReal_add (by simp) (by simp)] simp only [ENNReal.toReal_ofReal (abs_nonneg _)] have h0 := hbound 0 ⟨le_refl _, by norm_num⟩ have hr := hbound r ⟨h0r, hrt.trans ht1⟩ have ht := hbound t ⟨h0r.trans hrt, ht1⟩ have h1 := hbound 1 ⟨by norm_num, le_refl _⟩ have h01 := abs_sub_le (f r) 0 (f 0) have h12 := abs_sub_le (f t) 0 (f r) have h23 := abs_sub_le (f 1) 0 (f t) simp only [sub_zero, zero_sub, abs_neg] at h01 h12 h23 linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_three_piece_variation_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:272

The normalized breakpoint of a nonnegative hinge.

Definition (Lean source)
a s :
ℝ
budget_hinge_breakpoint a s :
ℝ
if s = 0 then 0 else a / s
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_hinge_breakpoint · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:307
theorem budget_hinge_breakpoint_bounds

The hinge breakpoint lies in the unit interval. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a s :
ℝ
ha :
0 ≤ a
hs :
0 ≤ s
has :
a ≤ s
conclusion 1
conclusion 2
Proof (Lean source)
-- @node: budget_hinge_breakpoint_bounds lemma budget_hinge_breakpoint_bounds (a s : ℝ) (ha : 0 ≤ a) (hs : 0 ≤ s) (has : a ≤ s) : 0 ≤ budget_hinge_breakpoint a s ∧ budget_hinge_breakpoint a s ≤ 1 := by by_cases hzero : s = 0 · simp [budget_hinge_breakpoint, hzero] · have hspos : 0 < s := lt_of_le_of_ne hs (Ne.symm hzero) simp only [budget_hinge_breakpoint, hzero, ↓reduceIte] constructor · exact div_nonneg ha hs · exact (div_le_iff₀ hspos).mpr (by simpa using has)
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_hinge_breakpoint_bounds · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:311
theorem hinge_active

A hinge agrees with its affine branch before the breakpoint. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a s lambda :
ℝ
ha :
0 ≤ a
hs :
0 ≤ s
has :
a ≤ s
hl :
max 0 (a - lambda * s) = a - lambda * s
Proof (Lean source)
-- @node: hinge_active lemma hinge_active (a s lambda : ℝ) (ha : 0 ≤ a) (hs : 0 ≤ s) (has : a ≤ s) (hl : lambda ≤ budget_hinge_breakpoint a s) : max 0 (a - lambda * s) = a - lambda * s := by rw [budget_hinge_cutoff a s lambda ha hs has] change (if lambda ≤ budget_hinge_breakpoint a s then a - lambda * s else 0) = _ rw [if_pos hl]
CausalSmith.Stat.DiscreteBudgetvalueCurve.hinge_active · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:323
theorem hinge_inactive

A hinge vanishes after the breakpoint. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a s lambda :
ℝ
ha :
0 ≤ a
hs :
0 ≤ s
has :
a ≤ s
hl :
max 0 (a - lambda * s) = 0
Proof (Lean source)
-- @node: hinge_inactive lemma hinge_inactive (a s lambda : ℝ) (ha : 0 ≤ a) (hs : 0 ≤ s) (has : a ≤ s) (hl : budget_hinge_breakpoint a s ≤ lambda) : max 0 (a - lambda * s) = 0 := by by_cases hzero : s = 0 · have ha0 : a = 0 := le_antisymm (hzero ▸ has) ha simp [ha0, hzero] · have hspos : 0 < s := lt_of_le_of_ne hs (Ne.symm hzero) have hle : a ≤ lambda * s := by have hdiv : a / s ≤ lambda := by simpa [budget_hinge_breakpoint, hzero] using hl exact (div_le_iff₀ hspos).mp hdiv exact max_eq_left (by linarith)
CausalSmith.Stat.DiscreteBudgetvalueCurve.hinge_inactive · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:332
theorem hinge_difference_pointwise Lemma hinge_difference_pointwise in the paper ↗

Two hinges are uniformly close under parameter perturbations. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a b s t lambda :
ℝ
hl :
lambda ∈ Icc (0 : ℝ) 1
|max 0 (a - lambda * s) - max 0 (b - lambda * t)| ≤ |a - b| + |s - t|
Proof (Lean source)
-- @node: hinge_difference_pointwise lemma hinge_difference_pointwise (a b s t lambda : ℝ) (hl : lambda ∈ Icc (0 : ℝ) 1) : |max 0 (a - lambda * s) - max 0 (b - lambda * t)| ≤ |a - b| + |s - t| := by have h := budget_hinge_pointwise_lipschitz 0 a 0 b s t lambda have hlam : |lambda| ≤ 1 := by rw [abs_of_nonneg hl.1]; exact hl.2 have hst : 0 ≤ |s - t| := abs_nonneg _ simp only [zero_add, sub_zero, abs_zero] at h nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.hinge_difference_pointwise · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:346
theorem hinge_difference_variation_le Lemma hinge_difference_variation_le in the paper ↗

The difference of two hinges has controlled total variation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a b s t :
ℝ
ha :
0 ≤ a
hs :
0 ≤ s
has :
a ≤ s
hb :
0 ≤ b
ht :
0 ≤ t
hbt :
b ≤ t
(eVariationOn (fun lambda : ℝ => max 0 (a - lambda * s) - max 0 (b - lambda * t)) (Icc 0 1)).toReal
≤ 6 * (|a - b| + |s - t|)
Proof (Lean source)
-- @node: hinge_difference_variation_le lemma hinge_difference_variation_le (a b s t : ℝ) (ha : 0 ≤ a) (hs : 0 ≤ s) (has : a ≤ s) (hb : 0 ≤ b) (ht : 0 ≤ t) (hbt : b ≤ t) : (eVariationOn (fun lambda : ℝ => max 0 (a - lambda * s) - max 0 (b - lambda * t)) (Icc 0 1)).toReal ≤ 6 * (|a - b| + |s - t|) := by let r := budget_hinge_breakpoint a s let q := budget_hinge_breakpoint b t obtain ⟨hr0, hr1⟩ := budget_hinge_breakpoint_bounds a s ha hs has obtain ⟨hq0, hq1⟩ := budget_hinge_breakpoint_bounds b t hb ht hbt have hbound : ∀ x ∈ Icc (0 : ℝ) 1, |max 0 (a - x * s) - max 0 (b - x * t)| ≤ |a-b| + |s-t| := by intro x hx exact hinge_difference_pointwise a b s t x hx by_cases hrq : r ≤ q · apply budget_three_piece_variation_le (fun lambda : ℝ => max 0 (a - lambda*s) - max 0 (b - lambda*t)) r q (|a-b| + |s-t|) hr0 hrq hq1 hbound · refine ⟨a-b, t-s, ?_⟩ intro x hx dsimp only rw [hinge_active a s x ha hs has hx.2, hinge_active b t x hb ht hbt (hx.2.trans hrq)] ring · refine ⟨-b, t, ?_⟩ intro x hx dsimp only rw [hinge_inactive a s x ha hs has hx.1, hinge_active b t x hb ht hbt hx.2] ring · refine ⟨0, 0, ?_⟩ intro x hx dsimp only rw [hinge_inactive a s x ha hs has (hrq.trans hx.1), hinge_inactive b t x hb ht hbt hx.1] ring · have hqr : q ≤ r := le_of_not_ge hrq apply budget_three_piece_variation_le (fun lambda : ℝ => max 0 (a - lambda*s) - max 0 (b - lambda*t)) q r (|a-b| + |s-t|) hq0 hqr hr1 hbound · refine ⟨a-b, t-s, ?_⟩ intro x hx dsimp only rw [hinge_active a s x ha hs has (hx.2.trans hqr), hinge_active b t x hb ht hbt hx.2] ring · refine ⟨a, -s, ?_⟩ intro x hx dsimp only rw [hinge_active a s x ha hs has hx.2, hinge_inactive b t x hb ht hbt hx.1] ring · refine ⟨0, 0, ?_⟩ intro x hx dsimp only rw [hinge_inactive a s x ha hs has hx.1, hinge_inactive b t x hb ht hbt (hqr.trans hx.1)] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.hinge_difference_variation_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:358
theorem budget_variation_add_const Lemma budget_variation_add_const in the paper ↗

Adding a constant does not change the variation of a real path. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f :
ℝ → ℝ
c :
ℝ
s :
Set ℝ
eVariationOn (fun x => c + f x) s = eVariationOn f s
Proof (Lean source)
-- @node: budget_variation_add_const lemma budget_variation_add_const (f : ℝ → ℝ) (c : ℝ) (s : Set ℝ) : eVariationOn (fun x => c + f x) s = eVariationOn f s := by unfold eVariationOn congr 1 with p congr 1 with i simp [edist_dist, Real.dist_eq]
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_variation_add_const · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:419
theorem thresholdFun_bv_lipschitz Lemma 1 in the paper ↗

The threshold fun bv lipschitz result. Under the he premise, the he' premise, It proves the stated conclusion.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 ≤ C
conclusion 1
u v :
Cell → ℝ
(∀ z, 0 ≤ u z)
(∀ z, 0 ≤ v z)
bvNorm (fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v)
≤ C * ∑ z, |u z - v z|
Proof (Lean source)
lemma thresholdFun_bv_lipschitz (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 ≤ C ∧ ∀ u v : Cell → ℝ, (∀ z, 0 ≤ u z) → (∀ z, 0 ≤ v z) → bvNorm (fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v) ≤ C * ∑ z, |u z - v z| := by let L : ℝ := 1 + epsilon⁻¹ refine ⟨15 * L + 7, by dsimp [L]; positivity, ?_⟩ intro u v hu hv let D : ℝ := ∑ z, |u z - v z| let a : ℝ := max 0 (armValue epsilon 1 u - armValue epsilon 0 u) let b : ℝ := max 0 (armValue epsilon 1 v - armValue epsilon 0 v) let s : ℝ := totalMass u let t : ℝ := totalMass v obtain ⟨ha, has⟩ := budget_positiveGain_bounds he u hu obtain ⟨hb, hbt⟩ := budget_positiveGain_bounds he v hv have hs : 0 ≤ s := ha.trans has have ht : 0 ≤ t := hb.trans hbt have hvar := hinge_difference_variation_le a b s t ha hs has hb ht hbt have hvarEq : eVariationOn (fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v) (Icc 0 1) = eVariationOn (fun lambda => max 0 (a - lambda * s) - max 0 (b - lambda * t)) (Icc 0 1) := by let f : ℝ → ℝ := fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v let g : ℝ → ℝ := fun lambda => max 0 (a - lambda * s) - max 0 (b - lambda * t) have heq : EqOn f (fun lambda => (armValue epsilon 0 u - armValue epsilon 0 v) + g lambda) (Icc 0 1) := by intro lambda hlambda dsimp [f, g] rw [budget_thresholdFunReal_hinge_decomposition lambda hlambda u hu, budget_thresholdFunReal_hinge_decomposition lambda hlambda v hv] ring exact (eVariationOn.eq_of_eqOn heq).trans (budget_variation_add_const g (armValue epsilon 0 u - armValue epsilon 0 v) (Icc 0 1)) have hzero := budget_thresholdFunReal_pointwise_lipschitz he 0 ⟨le_refl _, by norm_num⟩ u v hu hv have haLip := budget_positiveGain_lipschitz he u v hu hv have hsLip := budget_totalMass_lipschitz u v have hD : 0 ≤ D := Finset.sum_nonneg (fun z _ => abs_nonneg _) have hL : 0 ≤ L := by dsimp [L]; positivity unfold bvNorm rw [hvarEq] dsimp [a, b, s, t, D, L] at * nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFun_bv_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVLipschitz.lean:429
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.BVMaximal 29 declarations Good-pilot and bad-pilot centered continuum processes.

Good-pilot and bad-pilot centered continuum processes.

def pilotPartCell

Cell statistic restricted to good or bad pilot draws.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
j :
Fin d
good :
pilotPartCell epsilon lambda P sample perm M marks j good :
ℝ
by classical let stat := jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (fun zeta => markedCellCount sample perm M marks false j zeta) (fun zeta => markedCellCount sample perm M marks true j zeta) exact if good then (if pilotGood P sample perm M marks j then stat else 0) else (if pilotGood P sample perm M marks j then 0 else stat)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotPartCell · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:19
def pilotPartProcess

Sum of the good-pilot or bad-pilot cell statistics.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
good :
pilotPartProcess epsilon lambda P sample perm M marks good :
ℝ
∑ j, pilotPartCell epsilon lambda P sample perm M marks j good
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotPartProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:31
def pilotPartMean

Joint data/auxiliary mean of one pilot part.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
good :
pilotPartMean epsilon lambda P good :
ℝ
∫ sample : Fin n → Obs d, auxiliaryAverage n (fun M perm marks => pilotPartProcess epsilon lambda P sample perm M marks good) ∂productLaw P n
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotPartMean · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:38

Expected squared supremum of the centered good or bad pilot contribution.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
good :
centeredPilotPartRisk epsilon P good :
ℝ
∫ sample : Fin n → Obs d, auxiliaryAverage n (fun M perm marks => (sSup ((fun lambda : ℝ => |pilotPartProcess epsilon lambda P sample perm M marks good - pilotPartMean (n := n) epsilon lambda P good|) '' Icc 0 1)) ^ 2) ∂productLaw P n
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredPilotPartRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:46

Good pilot event in the ideal, uncapped count experiment.

Definition (Lean source)
n d :
ℕ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
zeta :
Cell
idealPilotGood P counts j :
Prop
|pilotCenter ((n : ℝ) / 8) (counts.1 j) zeta - cellVector P j zeta|
≤ pilotHalfWidth ((n : ℝ) / 8) d (counts.1 j) zeta / 4
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:56
theorem idealPilotGood_center_mem_radius

On a good pilot draw, the true cell mass lies in the truncated pilot rectangle, equivalently within one pilot radius of its midpoint. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
hn :
1 ≤ n
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
zeta :
Cell
|cellVector P j zeta - pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) zeta|
≤ pilotRadius ((n : ℝ) / 8) d (counts.1 j) zeta
Proof (Lean source)
-- @node: idealPilotGood_center_mem_radius lemma idealPilotGood_center_mem_radius {n d : ℕ} (hn : 1 ≤ n) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) (zeta : Cell) : |cellVector P j zeta - pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) zeta| ≤ pilotRadius ((n : ℝ) / 8) d (counts.1 j) zeta := by let m : ℝ := (n : ℝ) / 8 let x := pilotCenter m (counts.1 j) zeta let q := cellVector P j zeta let h := pilotHalfWidth m d (counts.1 j) zeta have hm : 0 < m := by dsimp [m]; positivity have hq : 0 ≤ q := ENNReal.toReal_nonneg have hg := hgood zeta change |x - q| ≤ h / 4 at hg have hh : 0 ≤ h := by linarith [abs_nonneg (x - q)] have hg' := (abs_le.mp hg) have hlo : max 0 (x - h) ≤ q := by apply max_le hq linarith have hup : q ≤ x + h := by linarith change |q - ((max 0 (x - h) + (x + h)) / 2)| ≤ ((x + h) - max 0 (x - h)) / 2 rw [abs_le] constructor <;> linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood_center_mem_radius · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:64
theorem idealPilotGood_flatRate_center_mem_radius

Flattened-rate form of good-pilot rectangle containment, matching the hcenter premise of localJacksonFourPoissonFactorialPath_sq_bound. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
hn :
1 ≤ n
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
i :
Fin 4
|(idealFlatRate (n := n) P j i : ℝ) / ((n : ℝ) / 8)
- pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)|
≤ pilotRadius ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)
Proof (Lean source)
-- @node: idealPilotGood_flatRate_center_mem_radius lemma idealPilotGood_flatRate_center_mem_radius {n d : ℕ} (hn : 1 ≤ n) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) (i : Fin 4) : |(idealFlatRate (n := n) P j i : ℝ) / ((n : ℝ) / 8) - pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)| ≤ pilotRadius ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i) := by have hm : 0 < (n : ℝ) / 8 := by positivity have hq : 0 ≤ cellVector P j (CellFourEquiv.symm i) := ENNReal.toReal_nonneg have hrate : (idealFlatRate (n := n) P j i : ℝ) = ((n : ℝ) / 8) * cellVector P j (CellFourEquiv.symm i) := by dsimp [idealFlatRate] exact max_eq_left (mul_nonneg hm.le hq) rw [hrate, mul_div_cancel_left₀ _ hm.ne'] exact idealPilotGood_center_mem_radius hn P counts j hgood (CellFourEquiv.symm i)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood_flatRate_center_mem_radius · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:94
theorem idealPilotGood_rate_div_radius_sq

On a good pilot draw, every evaluation Poisson coordinate satisfies the normalized variance-to-radius condition used by the factorial-path bound. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
i :
Fin 4
((idealFlatRate (n := n) P j i : ℝ) / ((((n : ℝ) / 8) ^ 2) * pilotRadius ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i) ^ 2))
≤ 1 / logAlphabet d
Proof (Lean source)
-- @node: idealPilotGood_rate_div_radius_sq lemma idealPilotGood_rate_div_radius_sq {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) (i : Fin 4) : ((idealFlatRate (n := n) P j i : ℝ) / ((((n : ℝ) / 8) ^ 2) * pilotRadius ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i) ^ 2)) ≤ 1 / logAlphabet d := by let m : ℝ := (n : ℝ) / 8 let L : ℝ := logAlphabet d let zeta := CellFourEquiv.symm i let x := pilotCenter m (counts.1 j) zeta let q := cellVector P j zeta let h := pilotHalfWidth m d (counts.1 j) zeta let R := pilotRadius m d (counts.1 j) zeta have hm : 0 < m := by dsimp [m]; positivity have hL : 0 < L := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg hdreal] have hx : 0 ≤ x := by dsimp [x]; unfold pilotCenter; positivity have hq : 0 ≤ q := ENNReal.toReal_nonneg have hg := hgood zeta change |x - q| ≤ h / 4 at hg have hh : 0 ≤ h := by linarith [abs_nonneg (x - q)] have hq_up : q ≤ x + h / 4 := by have := (abs_le.mp hg).1 linarith let s := sqrt (x * L / m) let delta := L / m have hdelta : 0 < delta := div_pos hL hm have hs : 0 ≤ s := Real.sqrt_nonneg _ have hs_sq : s ^ 2 = x * delta := by dsimp [s, delta] rw [Real.sq_sqrt (div_nonneg (mul_nonneg hx hL.le) hm.le)] ring have hh_formula : h = 4096 * (s + delta) := by dsimp [h, s, delta, x, L] unfold pilotHalfWidth pilotRadiusConstant rfl have hs_le : 4 * s ≤ h := by rw [hh_formula]; nlinarith have hd_le : 4 * delta ≤ h := by rw [hh_formula]; nlinarith have hR : h / 2 ≤ R := by dsimp [R] unfold pilotRadius pilotUpper pilotLower have hlo : max 0 (x - h) ≤ x := max_le hx (by linarith) change h / 2 ≤ (x + h - max 0 (x - h)) / 2 linarith have hmain : q * delta ≤ R ^ 2 := by have hxdelta : x * delta = s ^ 2 := hs_sq.symm have hR0 : 0 ≤ R := le_trans (div_nonneg hh (by norm_num)) hR have hR_sq : (h / 2) ^ 2 ≤ R ^ 2 := by nlinarith have hs_bound : s ^ 2 ≤ h ^ 2 / 16 := by nlinarith have hd_bound : h * delta / 4 ≤ h ^ 2 / 16 := by nlinarith calc q * delta ≤ (x + h / 4) * delta := mul_le_mul_of_nonneg_right hq_up hdelta.le _ = x * delta + h * delta / 4 := by ring _ ≤ h ^ 2 / 8 := by rw [hxdelta]; linarith _ ≤ R ^ 2 := by nlinarith have hrate : (idealFlatRate (n := n) P j i : ℝ) = m * q := by dsimp [idealFlatRate, m, q, zeta] exact max_eq_left (mul_nonneg hm.le hq) rw [hrate] change m * q / (m ^ 2 * R ^ 2) ≤ 1 / L have hRpos : 0 < R := by have hhpos : 0 < h := by rw [hh_formula]; positivity linarith apply (div_le_div_iff₀ (mul_pos (sq_pos_of_pos hm) (sq_pos_of_pos hRpos)) hL).2 field_simp have hscaled := mul_le_mul_of_nonneg_left hmain hm.le have hrewrite : m * (q * delta) = q * L := by dsimp [delta] field_simp rw [hrewrite] at hscaled nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood_rate_div_radius_sq · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:116
def idealPilotErrorPart

The paper's good or bad summand includes the cellwise target subtraction.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
good :
idealPilotErrorPart epsilon lambda P counts good :
ℝ
by classical exact ∑ j : Fin d, if (if good then idealPilotGood (n := n) P counts j else ¬ idealPilotGood (n := n) P counts j) then jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j)
- thresholdFunReal epsilon lambda (cellVector P j) else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorPart · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:200

The contribution of one cell to the good or bad ideal pilot error process.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
good :
idealPilotErrorCell epsilon lambda P counts j good :
ℝ
by classical exact if (if good then idealPilotGood (n := n) P counts j else ¬ idealPilotGood (n := n) P counts j) then jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j)
- thresholdFunReal epsilon lambda (cellVector P j) else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCell · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:214
theorem thresholdFunReal_continuousOn_nonnegative Lemma thresholdFunReal_continuousOn_nonnegative in the paper ↗

On the nonnegative cone, a fixed-threshold cell functional is continuous. This is the local regularity needed on every pilot rectangle. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon lambda :
ℝ
he :
0 < epsilon
hlambda :
lambda ∈ Icc (0 : ℝ) 1
ContinuousOn (thresholdFunReal epsilon lambda) {u : Cell → ℝ | ∀ z, 0 ≤ u z}
Proof (Lean source)
-- @node: thresholdFunReal_continuousOn_nonnegative lemma thresholdFunReal_continuousOn_nonnegative {epsilon lambda : ℝ} (he : 0 < epsilon) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : ContinuousOn (thresholdFunReal epsilon lambda) {u : Cell → ℝ | ∀ z, 0 ≤ u z} := by let A : ℝ := 3 * (1 + epsilon⁻¹) + 1 have hA : 0 ≤ A := by dsimp [A]; positivity let K : NNReal := ⟨4 * A, mul_nonneg (by norm_num) hA⟩ apply (LipschitzOnWith.of_dist_le_mul (K := K) ?_).continuousOn intro u hu v hv rw [Real.dist_eq] have hbase := budget_thresholdFunReal_pointwise_lipschitz he lambda hlambda u v hu hv have hsum : (∑ z : Cell, |u z - v z|) ≤ 4 * dist u v := by calc (∑ z : Cell, |u z - v z|) ≤ ∑ _z : Cell, dist u v := by apply Finset.sum_le_sum intro z _ rw [← Real.dist_eq] exact (dist_pi_le_iff (dist_nonneg : 0 ≤ dist u v)).mp le_rfl z _ = 4 * dist u v := by norm_num [Fintype.card_congr finProdFinEquiv] calc |thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v| ≤ A * ∑ z, |u z - v z| := hbase _ ≤ A * (4 * dist u v) := mul_le_mul_of_nonneg_left hsum hA _ = (K : ℝ) * dist u v := by change A * (4 * dist u v) = (4 * A) * dist u v ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFunReal_continuousOn_nonnegative · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:228
theorem pilotRectangle_affinePoint_nonnegative Lemma pilotRectangle_affinePoint_nonnegative in the paper ↗

Every point in the affine image of a pilot rectangle has nonnegative coordinates when the Poisson scale and alphabet are positive. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
z :
Fin 4 → ℝ
hz :
i :
Fin 4
0
≤ affinePoint (fun k => pilotMidpoint m d pilot (CellFourEquiv.symm k)) (fun k => pilotRadius m d pilot (CellFourEquiv.symm k)) z i
Proof (Lean source)
-- @node: pilotRectangle_affinePoint_nonnegative lemma pilotRectangle_affinePoint_nonnegative {m : ℝ} (hm : 0 < m) {d : ℕ} (hd : 1 ≤ d) (pilot : Cell → ℕ) (z : Fin 4 → ℝ) (hz : z ∈ normalizedCube 4) (i : Fin 4) : 0 ≤ affinePoint (fun k => pilotMidpoint m d pilot (CellFourEquiv.symm k)) (fun k => pilotRadius m d pilot (CellFourEquiv.symm k)) z i := by have hlo : 0 ≤ pilotLower m d pilot (CellFourEquiv.symm i) := le_max_left _ _ have hc : 0 ≤ pilotCenter m pilot (CellFourEquiv.symm i) := by unfold pilotCenter positivity have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast hd have := Real.log_nonneg hdreal linarith have hhalf : 0 ≤ pilotHalfWidth m d pilot (CellFourEquiv.symm i) := by unfold pilotHalfWidth pilotRadiusConstant positivity have hup : 0 ≤ pilotUpper m d pilot (CellFourEquiv.symm i) := by unfold pilotUpper positivity have hzlo := (hz i).1 have hzup := (hz i).2 simp only [affinePoint, pilotMidpoint, pilotRadius] nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRectangle_affinePoint_nonnegative · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:260

Every coordinate of a positive-scale pilot rectangle has strictly positive radius. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
zeta :
Cell
0 < pilotRadius m d pilot zeta
Proof (Lean source)
-- @node: pilotRadius_pos_of_pos lemma pilotRadius_pos_of_pos {m : ℝ} (hm : 0 < m) {d : ℕ} (hd : 1 ≤ d) (pilot : Cell → ℕ) (zeta : Cell) : 0 < pilotRadius m d pilot zeta := by have hc : 0 ≤ pilotCenter m pilot zeta := by unfold pilotCenter positivity have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast hd have := Real.log_nonneg hdreal linarith have hhalf : 0 < pilotHalfWidth m d pilot zeta := by unfold pilotHalfWidth pilotRadiusConstant positivity unfold pilotRadius pilotUpper pilotLower by_cases h : 0 ≤ pilotCenter m pilot zeta - pilotHalfWidth m d pilot zeta · rw [max_eq_right h] linarith · rw [max_eq_left (le_of_not_ge h)] linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadius_pos_of_pos · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:295
theorem pilotRectangle_threshold_pullback_continuousOn Lemma pilotRectangle_threshold_pullback_continuousOn in the paper ↗

The threshold pullback to every positive-scale pilot rectangle is continuous, discharging the regularity premise of the Jackson construction. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon m :
ℝ
he :
0 < epsilon
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
lambda :
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda.1 (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
Proof (Lean source)
-- @node: pilotRectangle_threshold_pullback_continuousOn lemma pilotRectangle_threshold_pullback_continuousOn {epsilon m : ℝ} (he : 0 < epsilon) (hm : 0 < m) {d : ℕ} (hd : 1 ≤ d) (pilot : Cell → ℕ) (lambda : Time) : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda.1 (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4) := by let A : (Fin 4 → ℝ) → (Cell → ℝ) := fun z c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c) have hA : Continuous A := by apply continuous_pi intro c exact continuous_const.add (continuous_const.mul (continuous_apply _)) apply (thresholdFunReal_continuousOn_nonnegative he lambda.2).comp hA.continuousOn intro z hz c exact pilotRectangle_affinePoint_nonnegative hm hd pilot z hz (CellFourEquiv c)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRectangle_threshold_pullback_continuousOn · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:320
theorem jacksonCoefficientBV_pilot_le Lemma jacksonCoefficientBV_pilot_le in the paper ↗

One positive constant depending only on the overlap level bounds every pilot-local Jackson coefficient BV envelope by the paper's radius sum and exp (12 K) factor. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
m :
ℝ
0 < m
d :
ℕ
1 ≤ d
pilot :
Cell → ℕ
jacksonCoefficientBV epsilon m d pilot
≤ C * (∑ zeta : Cell, pilotRadius m d pilot zeta) * exp (12 * jacksonDegree d)
Proof (Lean source)
-- @node: jacksonCoefficientBV_pilot_le lemma jacksonCoefficientBV_pilot_le (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ (m : ℝ), 0 < m → ∀ (d : ℕ), 1 ≤ d → ∀ pilot : Cell → ℕ, jacksonCoefficientBV epsilon m d pilot ≤ C * (∑ zeta : Cell, pilotRadius m d pilot zeta) * exp (12 * jacksonDegree d) := by obtain ⟨C₀, hC₀, hthreshold⟩ := thresholdFun_bv_lipschitz epsilon he he' refine ⟨2 * C₀ + 1, by linarith, ?_⟩ intro m hm d hd pilot let S := ∑ zeta : Cell, pilotRadius m d pilot zeta have hR (zeta : Cell) : 0 ≤ pilotRadius m d pilot zeta := (pilotRadius_pos_of_pos hm hd pilot zeta).le have hS : 0 ≤ S := Finset.sum_nonneg fun z _ => hR z have hcenter (zeta : Cell) : 0 ≤ pilotMidpoint m d pilot zeta := by let z : Fin 4 → ℝ := fun _ => 0 have hz : z ∈ normalizedCube 4 := by intro i constructor <;> norm_num have h := pilotRectangle_affinePoint_nonnegative hm hd pilot z hz (CellFourEquiv zeta) simpa [z, affinePoint] using h let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he hm hd pilot lambda have hcube (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : pathSize (⟨fun lambda : Time => eval x (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot)), localJacksonPolynomial_eval_continuous_time epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold jacksonDegree; omega) hpull x hx⟩ : Path) ≤ 2 * C₀ * S := by exact localJacksonPolynomial_cube_pathSize_le epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold jacksonDegree; omega) hpull hcenter hR (fun x hx zeta => pilotRectangle_affinePoint_nonnegative hm hd pilot x hx (CellFourEquiv zeta)) C₀ hC₀ hthreshold x hx have hcoeff := jacksonCoefficientBV_le_of_cube_pathSize epsilon m d pilot (by unfold jacksonDegree; omega) hpull (2 * C₀ * S) (mul_nonneg (mul_nonneg (by norm_num) hC₀) hS) hcube calc jacksonCoefficientBV epsilon m d pilot ≤ exp (12 * jacksonDegree d) * (2 * C₀ * S) := hcoeff _ ≤ (2 * C₀ + 1) * S * exp (12 * jacksonDegree d) := by have hexp := Real.exp_pos (12 * jacksonDegree d) nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficientBV_pilot_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:347
theorem goodPilot_localJacksonFourPoissonFactorialPath_sq_bound

Conditional on a fixed good flattened pilot table, the promoted four-Poisson factorial-path theorem gives the complete measurable BV and square-path-size package for one evaluation cell. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → ℕ
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
m :
(n : ℝ) / 8 (: ℝ)
L :
logAlphabet d (: ℝ)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ)
μ :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
Measurable (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta))
e :
eVariationOn (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e) univ < ⊤
Integrable (fun e => (pathSize (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e)) ^ 2) μ
Proof (Lean source)
-- @node: goodPilot_localJacksonFourPoissonFactorialPath_sq_bound lemma goodPilot_localJacksonFourPoissonFactorialPath_sq_bound {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → ℕ) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) : let m : ℝ := (n : ℝ) / 8 let L : ℝ := logAlphabet d let K := jacksonDegree d let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i e => poissonTableCell j e i let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) Measurable (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta)) ∧ (∀ e, eVariationOn (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e) univ < ⊤) ∧ Integrable (fun e => (pathSize (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e)) ^ 2) μ := by dsimp only let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw] infer_instance let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i e => poissonTableCell j e i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate j i)) μ := by simpa [W, μ, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, i) have hWindep : iIndepFun W μ := by rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] calc Measure.map (fun e i => W i e) μ = poissonTableLaw (rate j) := by simpa [W, μ] using (poissonTable_eval_cell_law rate j).map_eq _ = Measure.infinitePi (fun i => poissonMeasure (rate j i)) := rfl _ = Measure.infinitePi (fun i => Measure.map (W i) μ) := by congr 1 funext i exact (hWlaw i).map_eq.symm have h := localJacksonFourPoissonFactorialPath_sq_bound μ epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W (rate j) (by intro i; fun_prop) hWlaw hWindep ((n : ℝ) / 8) (logAlphabet d) (by positivity) (by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg this]) (fun i => pilotRadius_pos_of_pos (by positivity) (show 1 ≤ d by omega) pilot _) (fun i => idealPilotGood_flatRate_center_mem_radius hn P (curryCountTable p, fun _ _ => 0) j hgood i) (fun i => idealPilotGood_rate_div_radius_sq hn hd P (curryCountTable p, fun _ _ => 0) j hgood i) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) (mul_nonneg (Real.rpow_nonneg (by positivity) _) (Finset.sum_nonneg (fun z _ => (pilotRadius_pos_of_pos (by positivity) (show 1 ≤ d by omega) pilot z).le))) simpa [rate, μ, pilot, W, hpull] using (show _ ∧ _ ∧ _ from ⟨h.1, h.2.1, h.2.2.2.1⟩)
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_localJacksonFourPoissonFactorialPath_sq_bound · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:399
theorem goodPilot_localJacksonFourPoissonFactorialPath_sq_integral_le

Equation (21), conditionally on a fixed good pilot table: the evaluation factorial path has squared path-size bounded by the pilot radius sum squared, the structural d^(1/16) loss, and a coefficient-envelope constant. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise, the positive envelope constant, and the coefficient envelope.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → ℕ
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
C :
ℝ
hC :
0 ≤ C
hcoeff :
jacksonCoefficientBV epsilon ((n : ℝ) / 8) d (curryCountTable p j)
≤ C * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)
m :
(n : ℝ) / 8 (: ℝ)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ)
μ :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
(∫ e, pathSize (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e) ^ 2 ∂μ)
≤ 4 * C ^ 2 * exp 123 * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2
Proof (Lean source)
-- @node: goodPilot_localJacksonFourPoissonFactorialPath_sq_integral_le lemma goodPilot_localJacksonFourPoissonFactorialPath_sq_integral_le {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → ℕ) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) (C : ℝ) (hC : 0 ≤ C) (hcoeff : jacksonCoefficientBV epsilon ((n : ℝ) / 8) d (curryCountTable p j) ≤ C * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)) : let m : ℝ := (n : ℝ) / 8 let K := jacksonDegree d let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i e => poissonTableCell j e i let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) (∫ e, pathSize (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e) ^ 2 ∂μ) ≤ 4 * C ^ 2 * exp 123 * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2 := by dsimp only let m : ℝ := (n : ℝ) / 8 let K := jacksonDegree d let L := logAlphabet d let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw] infer_instance let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i e => poissonTableCell j e i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by dsimp [m]; positivity) (show 1 ≤ d by omega) pilot lambda have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate j i)) μ := by simpa [W, μ, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, i) have hWindep : iIndepFun W μ := by rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] calc Measure.map (fun e i => W i e) μ = poissonTableLaw (rate j) := by simpa [W, μ] using (poissonTable_eval_cell_law rate j).map_eq _ = Measure.infinitePi (fun i => poissonMeasure (rate j i)) := rfl _ = Measure.infinitePi (fun i => Measure.map (W i) μ) := by congr 1 funext i exact (hWlaw i).map_eq.symm have hL : 0 < L := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg this] have hraw := localJacksonFourPoissonFactorialPath_sq_integral_le_coefficientBV μ epsilon m d pilot (by unfold jacksonDegree; omega) hpull W (rate j) (by intro i; fun_prop) hWlaw hWindep L (by dsimp [m]; positivity) hL (fun i => pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) pilot _) (fun i => idealPilotGood_flatRate_center_mem_radius hn P (curryCountTable p, fun _ _ => 0) j hgood i) (fun i => idealPilotGood_rate_div_radius_sq hn hd P (curryCountTable p, fun _ _ => 0) j hgood i) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) (mul_nonneg (Real.rpow_nonneg (by positivity) _) (Finset.sum_nonneg (fun z _ => (pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) pilot z).le))) let S := ∑ zeta : Cell, pilotRadius m d pilot zeta have hS : 0 ≤ S := Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) pilot z).le have hcoeff' : jacksonCoefficientBV epsilon m d pilot ^ 2 ≤ C ^ 2 * S ^ 2 * exp (24 * K) := by have hcoeff0 : 0 ≤ jacksonCoefficientBV epsilon m d pilot := by unfold jacksonCoefficientBV exact Finset.sum_nonneg fun a _ => add_nonneg (abs_nonneg _) ENNReal.toReal_nonneg have hrhs0 : 0 ≤ C * S * exp (12 * K) := by positivity have hsquare := (sq_le_sq₀ hcoeff0 hrhs0).mpr (by simpa [m, K, pilot, S] using hcoeff) calc _ ≤ (C * S * exp (12 * K)) ^ 2 := hsquare _ = C ^ 2 * S ^ 2 * exp (24 * K) := by rw [mul_pow, mul_pow, ← Real.exp_nat_mul] congr 2 ring have hsum : (∑ _a : Fin 4 → Fin (2 * (K - 1) + 1), exp (4 * ((2 * (K - 1) : ℕ) : ℝ) ^ 2 / L)) ≤ (↑(2 * (K - 1) + 1) : ℝ) ^ 4 * exp (16 * (K : ℝ) ^ 2 / L) := by rw [Finset.sum_const, nsmul_eq_mul] have hcard : ((card (Fin 4 → Fin (2 * (K - 1) + 1)) : ℕ) : ℝ) = (↑(2 * (K - 1) + 1) : ℝ) ^ 4 := by rw [Fintype.card_fun] simp rw [Finset.card_univ, hcard] apply mul_le_mul_of_nonneg_left _ (by positivity) apply Real.exp_le_exp.mpr have hsub : ((K - 1 : ℕ) : ℝ) ≤ K := by exact_mod_cast sub_le K 1 have hsq : ((2 * (K - 1) : ℕ) : ℝ) ^ 2 ≤ 4 * (K : ℝ) ^ 2 := by push_cast nlinarith [sq_nonneg ((K - 1 : ℕ) : ℝ), sq_nonneg (K : ℝ)] apply (div_le_div_iff_of_pos_right hL).2 nlinarith have habsorb := jacksonDegree_factorial_index_exponential_budget d hd calc _ ≤ (4 * jacksonCoefficientBV epsilon m d pilot ^ 2) * ∑ _a : Fin 4 → Fin (2 * (K - 1) + 1), exp (4 * ((2 * (K - 1) : ℕ) : ℝ) ^ 2 / L) := by simpa [m, K, L, rate, μ, pilot, W, hpull] using hraw _ ≤ (4 * (C ^ 2 * S ^ 2 * exp (24 * K))) * ((↑(2 * (K - 1) + 1) : ℝ) ^ 4 * exp (16 * (K : ℝ) ^ 2 / L)) := by gcongr _ ≤ 4 * C ^ 2 * S ^ 2 * (exp 123 * (d : ℝ) ^ (1 / 16 : ℝ)) := by calc _ = 4 * C ^ 2 * S ^ 2 * ((↑(2 * (K - 1) + 1) : ℝ) ^ 4 * exp (24 * K + 16 * (K : ℝ) ^ 2 / L)) := by rw [Real.exp_add] ring _ ≤ _ := mul_le_mul_of_nonneg_left (by simpa [K, L] using habsorb) (mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg C)) (sq_nonneg S)) _ = _ := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_localJacksonFourPoissonFactorialPath_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:492
theorem goodPilot_factorialPath_equation21

The epsilon-dependent coefficient estimate instantiates the conditional equation (21) bound for every good pilot table. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → ℕ
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
∃ C : ℝ,
0 < C
conclusion 1
m :
(n : ℝ) / 8 (: ℝ)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ)
μ :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
(∫ e, pathSize (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e) ^ 2 ∂μ)
≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2
Proof (Lean source)
-- @node: goodPilot_factorialPath_equation21 lemma goodPilot_factorialPath_equation21 {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → ℕ) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) : ∃ C : ℝ, 0 < C ∧ let m : ℝ := (n : ℝ) / 8 let K := jacksonDegree d let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i e => poissonTableCell j e i let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) (∫ e, pathSize (localJacksonFourPoissonFactorialPath epsilon K (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold K jacksonDegree; omega) (fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda) (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius m d pilot zeta) e) ^ 2 ∂μ) ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2 := by obtain ⟨C₀, hC₀, hcoeff⟩ := jacksonCoefficientBV_pilot_le epsilon he he' refine ⟨4 * C₀ ^ 2 * exp 123, by positivity, ?_⟩ exact goodPilot_localJacksonFourPoissonFactorialPath_sq_integral_le epsilon he hn hd P p j hgood C₀ hC₀.le (hcoeff ((n : ℝ) / 8) (by positivity) d (by omega) (curryCountTable p j))
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_factorialPath_equation21 · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:634
theorem idealPilotErrorCell_continuous_time

The ideal cell-error summand is continuous in the threshold whenever its pilot-local threshold pullbacks satisfy the Jackson construction regularity. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
good :
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)) (fun i => pilotRadius ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)
Proof (Lean source)
-- @node: idealPilotErrorCell_continuous_time lemma idealPilotErrorCell_continuous_time {n d : ℕ} (epsilon : ℝ) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (good : Bool) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)) (fun i => pilotRadius ((n : ℝ) / 8) d (counts.1 j) (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) : Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good) := by classical by_cases hcond : (if good then idealPilotGood (n := n) P counts j else ¬ idealPilotGood (n := n) P counts j) · exact (jacksonCellStatistic_continuous_time epsilon ((n : ℝ) / 8) d (counts.1 j) (counts.2 j) hpull).sub (thresholdFunReal_continuous_time epsilon (cellVector P j)) |>.congr (fun lambda => by simp [idealPilotErrorCell, hcond]) · have hz : Continuous (fun _ : Time => (0 : ℝ)) := continuous_const exact hz.congr (fun lambda => by simp [idealPilotErrorCell, hcond])
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCell_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:667
theorem idealPilotErrorCell_continuous_time_of_pos

Positive sample size and nonempty alphabet automatically supply the pilot rectangle pullback regularity for an ideal cell-error path. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
good :
Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)
Proof (Lean source)
-- @node: idealPilotErrorCell_continuous_time_of_pos lemma idealPilotErrorCell_continuous_time_of_pos {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (good : Bool) : Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good) := by apply idealPilotErrorCell_continuous_time epsilon P counts j good intro lambda apply pilotRectangle_threshold_pullback_continuousOn he · positivity · exact hd
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCell_continuous_time_of_pos · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:694
theorem idealPilotErrorPart_eq_sum_cells

The ideal good or bad error process is the sum of its cell contributions. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon lambda :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
good :
idealPilotErrorPart (n := n) epsilon lambda P counts good
= ∑ j, idealPilotErrorCell (n := n) epsilon lambda P counts j good
Proof (Lean source)
-- @node: idealPilotErrorPart_eq_sum_cells lemma idealPilotErrorPart_eq_sum_cells {n d : ℕ} (epsilon lambda : ℝ) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (good : Bool) : idealPilotErrorPart (n := n) epsilon lambda P counts good = ∑ j, idealPilotErrorCell (n := n) epsilon lambda P counts j good := by classical simp only [idealPilotErrorPart, idealPilotErrorCell]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorPart_eq_sum_cells · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:710
def idealPilotErrorCellPath

A continuous cell contribution, restricted to the threshold interval, as a bounded-variation maximal-inequality path.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
good :
hcont :
Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)
idealPilotErrorCellPath epsilon P counts j good hcont :
⟨fun lambda => idealPilotErrorCell (n := n) epsilon lambda P counts j good, hcont⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCellPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:721
theorem path_norm_eq_sSup_abs_restrict Lemma path_norm_eq_sSup_abs_restrict in the paper ↗

The uniform norm of a continuous real path restricted to [0,1] is the real supremum of its absolute values in the paper's sSup notation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
g :
ℝ → ℝ
hg :
Continuous (fun t : Time => g t.1)
‖(⟨fun t : Time => g t.1, hg⟩ : Path)‖
= sSup ((fun lambda : ℝ => |g lambda|) '' Icc 0 1)
Proof (Lean source)
-- @node: path_norm_eq_sSup_abs_restrict lemma path_norm_eq_sSup_abs_restrict (g : ℝ → ℝ) (hg : Continuous (fun t : Time => g t.1)) : ‖(⟨fun t : Time => g t.1, hg⟩ : Path)‖ = sSup ((fun lambda : ℝ => |g lambda|) '' Icc 0 1) := by let f : Path := ⟨fun t : Time => g t.1, hg⟩ let S : Set ℝ := (fun lambda : ℝ => |g lambda|) '' Icc 0 1 have hSne : S.Nonempty := ⟨|g 0|, ⟨0, by constructor <;> norm_num, rfl⟩⟩ have hSbdd : BddAbove S := by refine ⟨‖f‖, ?_⟩ rintro y ⟨lambda, hlambda, rfl⟩ simpa [f, Real.norm_eq_abs] using ContinuousMap.norm_coe_le_norm f (⟨lambda, hlambda⟩ : Time) have hs0 : 0 ≤ sSup S := (abs_nonneg (g 0)).trans (le_csSup hSbdd ⟨0, by constructor <;> norm_num, rfl⟩) apply le_antisymm · apply (ContinuousMap.norm_le f hs0).2 intro t rw [Real.norm_eq_abs] exact le_csSup hSbdd ⟨t.1, t.2, rfl⟩ · apply csSup_le hSne rintro y ⟨lambda, hlambda, rfl⟩ simpa [f, Real.norm_eq_abs] using ContinuousMap.norm_coe_le_norm f (⟨lambda, hlambda⟩ : Time)
CausalSmith.Stat.DiscreteBudgetvalueCurve.path_norm_eq_sSup_abs_restrict · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:732
theorem idealPilotErrorCellPath_norm_eq_sSup

Norm identification for the paper's ideal good or bad cell-error path. With the specified inputs and conditions, the stated relationship holds. The argument assumes path continuity.

Formal statement
n d :
ℕ
epsilon :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
good :
hcont :
Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)
‖idealPilotErrorCellPath epsilon P counts j good hcont‖
= sSup ((fun lambda : ℝ => |idealPilotErrorCell (n := n) epsilon lambda P counts j good|) '' Icc 0 1)
Proof (Lean source)
-- @node: idealPilotErrorCellPath_norm_eq_sSup lemma idealPilotErrorCellPath_norm_eq_sSup {n d : ℕ} (epsilon : ℝ) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (good : Bool) (hcont : Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)) : ‖idealPilotErrorCellPath epsilon P counts j good hcont‖ = sSup ((fun lambda : ℝ => |idealPilotErrorCell (n := n) epsilon lambda P counts j good|) '' Icc 0 1) := by exact path_norm_eq_sSup_abs_restrict (fun lambda => idealPilotErrorCell (n := n) epsilon lambda P counts j good) hcont
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCellPath_norm_eq_sSup · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:760
theorem idealPilotErrorCellPath_centered_maximal

The abstract bounded-variation maximal theorem specialized to the ideal Poisson cell-error paths. Its hypotheses isolate the remaining paper-specific work: continuity in the threshold, measurability and integrability in the counts, the cellwise path-size moment, and independence across cells. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise, path continuity, measurability, Bochner integrability, the bounded-variation control, the path moment bound, and cross-cell independence.

Formal statement
n d :
ℕ
epsilon :
ℝ
P :
good :
hprob :
hcont :
∀ j counts,
Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)
hmeas :
∀ j,
Measurable (fun counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts))
hint :
∀ j,
Integrable (fun counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) (idealCountLaw (n := n) P)
hBV :
∀ j,
∀ᵐ counts ∂idealCountLaw (n := n) P, eVariationOn (idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) univ < ⊤
hmom :
∀ j,
Integrable (fun counts => (pathSize (idealPilotErrorCellPath epsilon P counts j good (hcont j counts))) ^ 2) (idealCountLaw (n := n) P)
hind :
iIndepFun (fun j counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) (idealCountLaw (n := n) P)
(∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j good (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j good (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P)
≤ 16384 * ∑ j, (∫ counts, (pathSize (idealPilotErrorCellPath epsilon P counts j good (hcont j counts))) ^ 2 ∂idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealPilotErrorCellPath_centered_maximal lemma idealPilotErrorCellPath_centered_maximal {n d : ℕ} (epsilon : ℝ) (P : DiscreteLaw d) (good : Bool) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) (hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j good)) (hmeas : ∀ j, Measurable (fun counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts))) (hint : ∀ j, Integrable (fun counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) (idealCountLaw (n := n) P)) (hBV : ∀ j, ∀ᵐ counts ∂idealCountLaw (n := n) P, eVariationOn (idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) univ < ⊤) (hmom : ∀ j, Integrable (fun counts => (pathSize (idealPilotErrorCellPath epsilon P counts j good (hcont j counts))) ^ 2) (idealCountLaw (n := n) P)) (hind : iIndepFun (fun j counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) (idealCountLaw (n := n) P)) : (∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j good (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j good (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P) ≤ 16384 * ∑ j, (∫ counts, (pathSize (idealPilotErrorCellPath epsilon P counts j good (hcont j counts))) ^ 2 ∂idealCountLaw (n := n) P) := by letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := hprob exact centered_path_sum_maximal (idealCountLaw (n := n) P) (fun j counts => idealPilotErrorCellPath epsilon P counts j good (hcont j counts)) hmeas hint hBV hmom hind
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCellPath_centered_maximal · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:776
def idealPilotErrorMean

Mean of the uncapped good or bad error part.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
good :
idealPilotErrorMean epsilon lambda P good :
ℝ
∫ counts, idealPilotErrorPart (n := n) epsilon lambda P counts good ∂idealCountLaw (n := n) P
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorMean · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:817

Centered risk of the paper's good or bad cellwise error sum.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
good :
centeredIdealPilotErrorRisk epsilon P good :
ℝ
∫ counts, (sSup ((fun lambda : ℝ => |idealPilotErrorPart (n := n) epsilon lambda P counts good - idealPilotErrorMean (n := n) epsilon lambda P good|) '' Icc 0 1)) ^ 2 ∂idealCountLaw (n := n) P
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealPilotErrorRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:823
def idealClippedCellPath

The clipped cell path from the common Jackson polynomial.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
idealClippedCellPath epsilon lambda counts j :
ℝ
jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealClippedCellPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:833

The uncentered bad-pilot cell envelope in proof (28).

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
j :
Fin d
badPilotCellEnvelope epsilon P j :
ℝ
by classical exact sqrt (∫ counts, (if idealPilotGood (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1)) ^ 2 ∂idealCountLaw (n := n) P)
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilotCellEnvelope · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BVMaximal.lean:840
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.BadPilotAggregate 7 declarations Aggregate centered risk of the bad-pilot cell paths.

Aggregate centered risk of the bad-pilot cell paths.

theorem idealBadPilotCellPath_integrable

A bad-pilot cell path is Bochner integrable once its squared norm is integrable. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
hprob :
j :
Fin d
Integrable (fun counts => idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false)) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealBadPilotCellPath_integrable lemma idealBadPilotCellPath_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) (j : Fin d) : Integrable (fun counts => idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false)) (idealCountLaw (n := n) P) := by let : BorelSpace Path := ⟨rfl⟩ letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := hprob let X := fun counts => idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false) have hX2 : Integrable (fun counts => ‖X counts‖ ^ 2) (idealCountLaw (n := n) P) := by simpa [X] using idealBadPilotCellPath_norm_sq_integrable epsilon he hn hd P j have hmem : MemLp X 2 (idealCountLaw (n := n) P) := (memLp_two_iff_integrable_sq_norm (measurable_of_countable X).aestronglyMeasurable).2 hX2 exact hmem.integrable (by norm_num)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealBadPilotCellPath_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:15
theorem centeredIdealBadPilotErrorRisk_eq_path_integral

The scalar centered bad-pilot risk is the squared norm risk of the centered sum of continuous bad-pilot cell paths. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
hprob :
hcont :
n) epsilon lambda P counts j false) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false (: ∀ j counts, Continuous (fun lambda : Time
= ∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j false (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j false (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P
Proof (Lean source)
-- @node: centeredIdealBadPilotErrorRisk_eq_path_integral lemma centeredIdealBadPilotErrorRisk_eq_path_integral {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) : let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j false) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false centeredIdealPilotErrorRisk (n := n) epsilon P false = ∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j false (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j false (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P := by classical dsimp only let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j false) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false let X : Fin d → ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun j counts => idealPilotErrorCellPath epsilon P counts j false (hcont j counts) have hXint (j : Fin d) : Integrable (X j) (idealCountLaw (n := n) P) := by simpa [X, hcont] using idealBadPilotCellPath_integrable epsilon he hn hd P hprob j have hmean (lambda : Time) : idealPilotErrorMean (n := n) epsilon lambda P false = ∑ j : Fin d, ∫ x, X j x lambda ∂idealCountLaw (n := n) P := by unfold idealPilotErrorMean simp_rw [idealPilotErrorPart_eq_sum_cells] rw [integral_finsetSum] · simp [X, idealPilotErrorCellPath] · intro j _ simpa [X, idealPilotErrorCellPath] using (ContinuousMap.evalCLM ℝ lambda).integrable_comp (hXint j) have heval (j : Fin d) (lambda : Time) : (∫ x, X j x ∂idealCountLaw (n := n) P) lambda = ∫ x, X j x lambda ∂idealCountLaw (n := n) P := by simpa using ((ContinuousMap.evalCLM ℝ lambda).integral_comp_comm (hXint j)).symm apply integral_congr_ae exact Filter.Eventually.of_forall fun counts => by let Z : Path := ∑ j, (X j counts - ∫ x, X j x ∂idealCountLaw (n := n) P) have hpoint (lambda : Time) : Z lambda = idealPilotErrorPart (n := n) epsilon lambda P counts false - idealPilotErrorMean (n := n) epsilon lambda P false := by dsimp [Z] simp_rw [ContinuousMap.sum_apply, ContinuousMap.sub_apply, heval] rw [idealPilotErrorPart_eq_sum_cells, hmean, Finset.sum_sub_distrib] simp only [X, idealPilotErrorCellPath] congr 1 have hg : Continuous (fun lambda : Time => idealPilotErrorPart (n := n) epsilon lambda P counts false - idealPilotErrorMean (n := n) epsilon lambda P false) := by convert Z.continuous using 1 funext lambda exact (hpoint lambda).symm change (sSup ((fun lambda : ℝ => |idealPilotErrorPart (n := n) epsilon lambda P counts false - idealPilotErrorMean (n := n) epsilon lambda P false|) '' Icc 0 1)) ^ 2 = ‖Z‖ ^ 2 rw [← path_norm_eq_sSup_abs_restrict (fun lambda => idealPilotErrorPart (n := n) epsilon lambda P counts false - idealPilotErrorMean (n := n) epsilon lambda P false) hg] congr 2 apply ContinuousMap.ext intro lambda exact (hpoint lambda).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealBadPilotErrorRisk_eq_path_integral · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:40
theorem centeredIdealBadPilotError_continuous

The centered aggregate bad-pilot error is continuous in the shadow price. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
hprob :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
Continuous (fun lambda : Time => idealPilotErrorPart (n := n) epsilon lambda P counts false - idealPilotErrorMean (n := n) epsilon lambda P false)
Proof (Lean source)
lemma centeredIdealBadPilotError_continuous {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) : Continuous (fun lambda : Time => idealPilotErrorPart (n := n) epsilon lambda P counts false - idealPilotErrorMean (n := n) epsilon lambda P false) := by classical let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j false) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false let X : Fin d → ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun j x => idealPilotErrorCellPath epsilon P x j false (hcont j x) have hXint (j : Fin d) : Integrable (X j) (idealCountLaw (n := n) P) := by simpa [X, hcont] using idealBadPilotCellPath_integrable epsilon he hn hd P hprob j let Y : Path := ∑ j, X j counts let M : Path := ∑ j, ∫ x, X j x ∂idealCountLaw (n := n) P apply (Y - M).continuous.congr intro lambda have heval (j : Fin d) : (∫ x, X j x ∂idealCountLaw (n := n) P) lambda = ∫ x, X j x lambda ∂idealCountLaw (n := n) P := by simpa using ((ContinuousMap.evalCLM ℝ lambda).integral_comp_comm (hXint j)).symm simp only [Y, M, ContinuousMap.sub_apply, ContinuousMap.sum_apply] simp_rw [heval] rw [idealPilotErrorPart_eq_sum_cells] unfold idealPilotErrorMean simp_rw [idealPilotErrorPart_eq_sum_cells] rw [integral_finsetSum] · simp [X, idealPilotErrorCellPath] · intro j _ simpa [X, idealPilotErrorCellPath] using (ContinuousMap.evalCLM ℝ lambda).integrable_comp (hXint j)
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealBadPilotError_continuous · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:113
theorem centeredIdealBadPilotErrorRisk_le_cell_norms

Centering and summing finitely many bad-pilot paths costs at most four times the alphabet size times the sum of their uncentered squared norms. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
hprob :
≤ 4 * d * ∑ j : Fin d, badPilotCellEnvelope (n := n) epsilon P j ^ 2
Proof (Lean source)
-- @node: centeredIdealBadPilotErrorRisk_le_cell_norms lemma centeredIdealBadPilotErrorRisk_le_cell_norms {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) : centeredIdealPilotErrorRisk (n := n) epsilon P false ≤ 4 * d * ∑ j : Fin d, badPilotCellEnvelope (n := n) epsilon P j ^ 2 := by classical let μ := idealCountLaw (n := n) P letI : IsProbabilityMeasure μ := by simpa [μ] using hprob let : BorelSpace Path := ⟨rfl⟩ let X : Fin d → ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun j counts => idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false) have hX2 (j : Fin d) : Integrable (fun counts => ‖X j counts‖ ^ 2) μ := by simpa [X, μ] using idealBadPilotCellPath_norm_sq_integrable epsilon he hn hd P j have hX (j : Fin d) : Integrable (X j) μ := by simpa [X, μ] using idealBadPilotCellPath_integrable epsilon he hn hd P hprob j have hab (a b : ℝ) : (a + b) ^ 2 ≤ 2 * a ^ 2 + 2 * b ^ 2 := by nlinarith [sq_nonneg (a - b)] have hmean2 (j : Fin d) : ‖∫ counts, X j counts ∂μ‖ ^ 2 ≤ ∫ counts, ‖X j counts‖ ^ 2 ∂μ := by let q : Path → ℝ := fun z => ‖z‖ ^ 2 have hconv : ConvexOn ℝ univ q := (convexOn_univ_norm : ConvexOn ℝ univ (norm : Path → ℝ)).pow (fun z _ => norm_nonneg z) 2 have hq : Integrable (q ∘ X j) μ := by change Integrable (fun counts => ‖X j counts‖ ^ 2) μ exact hX2 j simpa only [q, Function.comp_apply] using hconv.map_integral_le (by fun_prop) isClosed_univ (Filter.Eventually.of_forall fun _ => Set.mem_univ _) (hX j) hq have hcenter2 (j : Fin d) : Integrable (fun counts => ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2) μ := by have hdom : Integrable (fun counts => 2 * ‖X j counts‖ ^ 2 + 2 * ‖∫ x, X j x ∂μ‖ ^ 2) μ := ((hX2 j).const_mul 2).add (integrable_const _) apply hdom.mono' (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with counts rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] calc ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2 ≤ (‖X j counts‖ + ‖∫ x, X j x ∂μ‖) ^ 2 := by gcongr exact norm_sub_le _ _ _ ≤ _ := hab _ _ have hcenterInt (j : Fin d) : (∫ counts, ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2 ∂μ) ≤ 4 * ∫ counts, ‖X j counts‖ ^ 2 ∂μ := by calc _ ≤ ∫ counts, (2 * ‖X j counts‖ ^ 2 + 2 * ‖∫ x, X j x ∂μ‖ ^ 2) ∂μ := by apply integral_mono (hcenter2 j) (((hX2 j).const_mul 2).add (integrable_const _)) intro counts calc ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2 ≤ (‖X j counts‖ + ‖∫ x, X j x ∂μ‖) ^ 2 := by gcongr exact norm_sub_le _ _ _ ≤ _ := hab _ _ _ = 2 * (∫ counts, ‖X j counts‖ ^ 2 ∂μ) + 2 * ‖∫ x, X j x ∂μ‖ ^ 2 := by rw [integral_add, integral_const_mul, integral_const] · simp · exact (hX2 j).const_mul 2 · exact integrable_const _ _ ≤ _ := by nlinarith [hmean2 j] rw [centeredIdealBadPilotErrorRisk_eq_path_integral epsilon he hn hd P hprob] let Z : ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun counts => ∑ j : Fin d, (X j counts - ∫ x, X j x ∂μ) have hdom : Integrable (fun counts => (d : ℝ) * ∑ j : Fin d, ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2) μ := by apply Integrable.const_mul exact integrable_finsetSum Finset.univ (fun j _ => hcenter2 j) have hZ2 : Integrable (fun counts => ‖Z counts‖ ^ 2) μ := by apply hdom.mono' (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with counts rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] calc ‖Z counts‖ ^ 2 ≤ (∑ j : Fin d, ‖X j counts - ∫ x, X j x ∂μ‖) ^ 2 := by gcongr exact norm_sum_le _ _ _ ≤ _ := by simpa using pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset (Fin d))) (f := fun j => ‖X j counts - ∫ x, X j x ∂μ‖) (fun _ _ => norm_nonneg _) 1 calc _ = ∫ counts, ‖Z counts‖ ^ 2 ∂μ := by rfl _ ≤ ∫ counts, (d : ℝ) * ∑ j : Fin d, ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2 ∂μ := by apply integral_mono hZ2 hdom intro counts dsimp calc ‖Z counts‖ ^ 2 ≤ (∑ j : Fin d, ‖X j counts - ∫ x, X j x ∂μ‖) ^ 2 := by gcongr exact norm_sum_le _ _ _ ≤ _ := by simpa using pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset (Fin d))) (f := fun j => ‖X j counts - ∫ x, X j x ∂μ‖) (fun _ _ => norm_nonneg _) 1 _ = (d : ℝ) * ∑ j : Fin d, ∫ counts, ‖X j counts - ∫ x, X j x ∂μ‖ ^ 2 ∂μ := by rw [integral_const_mul, integral_finsetSum] intro j _ exact hcenter2 j _ ≤ (d : ℝ) * ∑ j : Fin d, (4 * ∫ counts, ‖X j counts‖ ^ 2 ∂μ) := by gcongr with j exact hcenterInt j _ = 4 * ((d : ℝ) * ∑ j : Fin d, ∫ counts, ‖X j counts‖ ^ 2 ∂μ) := by rw [← Finset.mul_sum] ring _ = 4 * d * ∑ j : Fin d, badPilotCellEnvelope (n := n) epsilon P j ^ 2 := by have hcell (j : Fin d) : (∫ counts, ‖X j counts‖ ^ 2 ∂μ) = badPilotCellEnvelope (n := n) epsilon P j ^ 2 := by unfold badPilotCellEnvelope rw [Real.sq_sqrt] · apply integral_congr_ae filter_upwards [] with counts rw [idealPilotErrorCellPath_norm_eq_sSup epsilon P counts j false] by_cases hg : idealPilotGood (n := n) P counts j <;> simp [X, μ, idealPilotErrorCell, idealClippedCellPath, hg] · exact integral_nonneg fun _ => sq_nonneg _ rw [Finset.sum_congr rfl (fun j _ => hcell j)] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealBadPilotErrorRisk_le_cell_norms · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:151
theorem centeredIdealBadPilotErrorRisk_le_raw

Equations (28) and (32) give the centered bad-pilot aggregate bound before the final elementary exponential absorption. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
1 ≤ d
P :
≤ C * d * (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)
Proof (Lean source)
-- @node: centeredIdealBadPilotErrorRisk_le_raw lemma centeredIdealBadPilotErrorRisk_le_raw (epsilon : ℝ) (he : 0 < epsilon) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d), IsProbabilityMeasure (idealCountLaw (n := n) P) → centeredIdealPilotErrorRisk (n := n) epsilon P false ≤ C * d * (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) := by obtain ⟨C₀, hC₀, henv⟩ := badPilotCellEnvelope_le epsilon he refine ⟨4 * C₀ ^ 2, by positivity, ?_⟩ intro n d hn hd P hprob have hcell (j : Fin d) : badPilotCellEnvelope (n := n) epsilon P j ^ 2 ≤ C₀ ^ 2 * (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2 := by have h := pow_le_pow_left₀ (Real.sqrt_nonneg _) (henv hn hd P j) 2 have hd0 : (0 : ℝ) ≤ d := by positivity have hr : ((d : ℝ) ^ (1 / 4 : ℝ)) ^ 2 = (d : ℝ) ^ (1 / 2 : ℝ) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hd0] norm_num have he2 : (exp (-10 * logAlphabet d)) ^ 2 = exp (-20 * logAlphabet d) := by rw [pow_two, ← Real.exp_add] congr 1 ring simpa only [badPilotCellEnvelope, mul_pow, hr, he2] using h calc centeredIdealPilotErrorRisk (n := n) epsilon P false ≤ 4 * d * ∑ j : Fin d, badPilotCellEnvelope (n := n) epsilon P j ^ 2 := centeredIdealBadPilotErrorRisk_le_cell_norms epsilon he hn hd P hprob _ ≤ 4 * d * ∑ j : Fin d, (C₀ ^ 2 * (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2) := by gcongr with j exact hcell j _ = (4 * C₀ ^ 2) * d * (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * ∑ j : Fin d, badPilotCellScale (n := n) P j ^ 2 := by simp_rw [← Finset.mul_sum] ring _ ≤ (4 * C₀ ^ 2) * d * (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) := by gcongr exact sum_badPilotCellScale_sq_le hn hd P
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealBadPilotErrorRisk_le_raw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:288
theorem badPilot_raw_scale_le_rate

The exponential bad-event factor absorbs the residual alphabet and logarithmic powers on the large-alphabet branch. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
hbranch :
(d : ℝ) / logAlphabet d ≤ n
(d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)
≤ 18 / (((n : ℝ) / 8) * logAlphabet d)
Proof (Lean source)
-- @node: badPilot_raw_scale_le_rate lemma badPilot_raw_scale_le_rate {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (hbranch : (d : ℝ) / logAlphabet d ≤ n) : (d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) ≤ 18 / (((n : ℝ) / 8) * logAlphabet d) := by let D : ℝ := d let L : ℝ := logAlphabet d let m : ℝ := (n : ℝ) / 8 have hD : 1 ≤ D := by dsimp [D]; exact_mod_cast (show 1 ≤ d by omega) have hDpos : 0 < D := lt_of_lt_of_le zero_lt_one hD have hlog0 : 0 ≤ log D := Real.log_nonneg hD have hL : L = 1 + log D := by dsimp [L, D] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hDpos), Real.log_exp] have hL1 : 1 ≤ L := by rw [hL]; linarith have hLD : L ≤ D := by rw [hL] linarith [Real.log_le_sub_one_of_pos hDpos] have hm : 0 < m := by dsimp [m]; positivity have hbranch' : D / L ≤ 8 * m := by dsimp [D, L, m] at hbranch ⊢ norm_num at hbranch ⊢ linarith have hDLm : D * L / m ≤ 8 * L ^ 2 := by have hLpos : 0 < L := lt_of_lt_of_le zero_lt_one hL1 apply (div_le_iff₀ hm).2 have h := (div_le_iff₀ hLpos).1 hbranch' nlinarith have hexp : exp (-20 * L) ≤ D ^ (-(9 / 2 : ℝ)) := by rw [Real.rpow_def_of_pos hDpos] apply Real.exp_le_exp.mpr rw [hL] nlinarith have hpow : D ^ (1 / 2 : ℝ) * D ^ (-(9 / 2 : ℝ)) = D⁻¹ ^ 4 := by rw [← Real.rpow_add hDpos] norm_num have hcoef : D ^ (1 / 2 : ℝ) * exp (-20 * L) ≤ D⁻¹ ^ 4 := by rw [← hpow] exact mul_le_mul_of_nonneg_left hexp (Real.rpow_nonneg hDpos.le _) have hpoly : 2 * L ^ 2 + 16 * L ^ 4 ≤ 18 * D ^ 4 := by have hL0 : 0 ≤ L := hL1.trans' zero_le_one have h2 : L ^ 2 ≤ D ^ 2 := pow_le_pow_left₀ hL0 hLD 2 have h4 : L ^ 4 ≤ D ^ 4 := pow_le_pow_left₀ hL0 hLD 4 have hDsq : 1 ≤ D ^ 2 := by nlinarith [sq_nonneg (D - 1)] have hD2 : D ^ 2 ≤ D ^ 4 := by nlinarith [mul_nonneg (sq_nonneg D) (sub_nonneg.mpr hDsq)] nlinarith have hcore : D ^ (1 / 2 : ℝ) * exp (-20 * L) * (2 * L ^ 2 + 16 * L ^ 4) ≤ 18 := by calc _ ≤ D⁻¹ ^ 4 * (2 * L ^ 2 + 16 * L ^ 4) := by gcongr _ ≤ D⁻¹ ^ 4 * (18 * D ^ 4) := by gcongr _ = 18 := by field_simp have hrewrite : (2 * L / m + 2 * D * (L / m) ^ 2) * (m * L) = 2 * L ^ 2 + 2 * (D * L / m) * L ^ 2 := by field_simp have hscaled : D ^ (1 / 2 : ℝ) * exp (-20 * L) * (2 * L / m + 2 * D * (L / m) ^ 2) * (m * L) ≤ 18 := by rw [mul_assoc, hrewrite] calc D ^ (1 / 2 : ℝ) * exp (-20 * L) * (2 * L ^ 2 + 2 * (D * L / m) * L ^ 2) ≤ D ^ (1 / 2 : ℝ) * exp (-20 * L) * (2 * L ^ 2 + 16 * L ^ 4) := by have hh := mul_le_mul_of_nonneg_right hDLm (sq_nonneg L) have hin : 2 * L ^ 2 + 2 * (D * L / m) * L ^ 2 ≤ 2 * L ^ 2 + 16 * L ^ 4 := by nlinarith [sq_nonneg (L ^ 2)] exact mul_le_mul_of_nonneg_left hin (mul_nonneg (Real.rpow_nonneg hDpos.le _) (Real.exp_nonneg _)) _ ≤ 18 := hcore have hmL : 0 < m * L := mul_pos hm (lt_of_lt_of_le zero_lt_one hL1) apply (le_div_iff₀ hmL).2 simpa [D, L, m, mul_assoc] using hscaled
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilot_raw_scale_le_rate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:344
theorem centeredIdealBadPilotErrorRisk_le_rate

Equation (34): the centered bad-pilot aggregate has the advertised rate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
hbranch :
(d : ℝ) / logAlphabet d ≤ n
P :
≤ C * d / (((n : ℝ) / 8) * logAlphabet d)
Proof (Lean source)
-- @node: centeredIdealBadPilotErrorRisk_le_rate lemma centeredIdealBadPilotErrorRisk_le_rate (epsilon : ℝ) (he : 0 < epsilon) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (hbranch : (d : ℝ) / logAlphabet d ≤ n) (P : DiscreteLaw d), IsProbabilityMeasure (idealCountLaw (n := n) P) → centeredIdealPilotErrorRisk (n := n) epsilon P false ≤ C * d / (((n : ℝ) / 8) * logAlphabet d) := by obtain ⟨C₀, hC₀, hraw⟩ := centeredIdealBadPilotErrorRisk_le_raw epsilon he refine ⟨18 * C₀, by positivity, ?_⟩ intro n d hn hd hbranch P hprob calc _ ≤ C₀ * d * ((d : ℝ) ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)) := by simpa [mul_assoc] using hraw hn (show 1 ≤ d by omega) P hprob _ ≤ C₀ * d * (18 / (((n : ℝ) / 8) * logAlphabet d)) := by gcongr exact badPilot_raw_scale_le_rate hn hd hbranch _ = (18 * C₀) * d / (((n : ℝ) / 8) * logAlphabet d) := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealBadPilotErrorRisk_le_rate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotAggregate.lean:424
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.BadPilotEnvelope 9 declarations Deterministic clipping bounds for bad pilot cells.

Deterministic clipping bounds for bad pilot cells.

theorem pilotMidpoint_sub_center_abs_le_halfWidth Lemma pilotMidpoint_sub_center_abs_le_halfWidth in the paper ↗

Truncating the pilot interval at zero moves its midpoint from the empirical center by at most the original half-width. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
z :
Cell
|pilotMidpoint m d pilot z - pilotCenter m pilot z| ≤ pilotHalfWidth m d pilot z
Proof (Lean source)
-- @node: pilotMidpoint_sub_center_abs_le_halfWidth lemma pilotMidpoint_sub_center_abs_le_halfWidth {m : ℝ} (hm : 0 < m) {d : ℕ} (hd : 1 ≤ d) (pilot : Cell → ℕ) (z : Cell) : |pilotMidpoint m d pilot z - pilotCenter m pilot z| ≤ pilotHalfWidth m d pilot z := by have hc : 0 ≤ pilotCenter m pilot z := by unfold pilotCenter; positivity have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR] have hh : 0 ≤ pilotHalfWidth m d pilot z := by unfold pilotHalfWidth pilotRadiusConstant positivity unfold pilotMidpoint pilotLower pilotUpper by_cases h : 0 ≤ pilotCenter m pilot z - pilotHalfWidth m d pilot z · rw [max_eq_right h] simpa using hh · rw [max_eq_left (le_of_not_ge h)] rw [abs_le] constructor <;> linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotMidpoint_sub_center_abs_le_halfWidth · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:16
theorem idealClippedCell_error_le_badScore Lemma idealClippedCell_error_le_badScore in the paper ↗

At every shadow price, clipping bounds a cell error by the empirical center score and the clipping scale. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
|idealClippedCellPath (n := n) epsilon lambda counts j
- thresholdFunReal epsilon lambda (cellVector P j)|
≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) * ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (counts.1 j) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (counts.1 j) z)
Proof (Lean source)
-- @node: idealClippedCell_error_le_badScore lemma idealClippedCell_error_le_badScore {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)| ≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) * ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (counts.1 j) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (counts.1 j) z) := by let m : ℝ := (n : ℝ) / 8 let pilot := counts.1 j let center := pilotMidpoint m d pilot let scale := (d : ℝ) ^ (1 / 4 : ℝ) * ∑ z : Cell, pilotRadius m d pilot z let A : ℝ := 3 * (1 + epsilon⁻¹) + 1 let S : ℝ := ∑ z : Cell, (|pilotCenter m pilot z - cellVector P j z| + pilotHalfWidth m d pilot z) have hm : 0 < m := by dsimp [m]; positivity have hA : 0 ≤ A := by dsimp [A]; positivity have hdR : 0 ≤ (d : ℝ) ^ (1 / 4 : ℝ) := by positivity have hq (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hcenter (z : Cell) : 0 ≤ center z := by have hc : 0 ≤ pilotCenter m pilot z := by unfold pilotCenter; positivity have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR' : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR'] have hh : 0 ≤ pilotHalfWidth m d pilot z := by unfold pilotHalfWidth pilotRadiusConstant positivity dsimp [center] unfold pilotMidpoint pilotLower pilotUpper have hlo : 0 ≤ max 0 (pilotCenter m pilot z - pilotHalfWidth m d pilot z) := le_max_left _ _ linarith have hmid (z : Cell) : |center z - cellVector P j z| ≤ |pilotCenter m pilot z - cellVector P j z| + pilotHalfWidth m d pilot z := by calc _ ≤ |center z - pilotCenter m pilot z| + |pilotCenter m pilot z - cellVector P j z| := by simpa [sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using abs_add_le (center z - pilotCenter m pilot z) (pilotCenter m pilot z - cellVector P j z) _ ≤ _ := by have h := pilotMidpoint_sub_center_abs_le_halfWidth hm hd pilot z linarith have hthreshold : |thresholdFunReal epsilon lambda center - thresholdFunReal epsilon lambda (cellVector P j)| ≤ A * S := by calc _ ≤ A * ∑ z, |center z - cellVector P j z| := budget_thresholdFunReal_pointwise_lipschitz he lambda hlambda center (cellVector P j) hcenter hq _ ≤ A * S := by apply mul_le_mul_of_nonneg_left _ hA exact Finset.sum_le_sum fun z _ => hmid z have hradius (z : Cell) : pilotRadius m d pilot z ≤ pilotHalfWidth m d pilot z := pilotRadius_le_pilotHalfWidth hm hd pilot z have hscale : scale ≤ (d : ℝ) ^ (1 / 4 : ℝ) * S := by dsimp [scale, S] apply mul_le_mul_of_nonneg_left _ hdR calc (∑ z, pilotRadius m d pilot z) ≤ ∑ z, pilotHalfWidth m d pilot z := Finset.sum_le_sum fun z _ => hradius z _ ≤ ∑ z, (|pilotCenter m pilot z - cellVector P j z| + pilotHalfWidth m d pilot z) := by apply Finset.sum_le_sum intro z _ linarith [abs_nonneg (pilotCenter m pilot z - cellVector P j z)] have hscale0 : 0 ≤ scale := by dsimp [scale] exact mul_nonneg hdR (Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos hm hd pilot z).le) let delta := jacksonCellRaw epsilon lambda m d pilot (counts.2 j) - thresholdFunReal epsilon lambda center have hclip : |min scale (max (-scale) delta)| ≤ scale := by rw [abs_le] constructor · exact le_min (by linarith) (le_max_left _ _) · exact min_le_left _ _ unfold idealClippedCellPath jacksonCellStatistic change |thresholdFunReal epsilon lambda center + min scale (max (-scale) delta) - thresholdFunReal epsilon lambda (cellVector P j)| ≤ _ calc _ ≤ |thresholdFunReal epsilon lambda center - thresholdFunReal epsilon lambda (cellVector P j)| + |min scale (max (-scale) delta)| := by calc _ = |(thresholdFunReal epsilon lambda center - thresholdFunReal epsilon lambda (cellVector P j)) + min scale (max (-scale) delta)| := by congr 1 <;> ring _ ≤ _ := abs_add_le _ _ _ ≤ A * S + scale := add_le_add hthreshold hclip _ ≤ A * S + (d : ℝ) ^ (1 / 4 : ℝ) * S := by linarith _ = (A + (d : ℝ) ^ (1 / 4 : ℝ)) * S := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealClippedCell_error_le_badScore · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:40
theorem idealClippedCell_sSup_le_badScore Lemma idealClippedCell_sSup_le_badScore in the paper ↗

The continuum supremum of one clipped-cell error is bounded by the same four-coordinate empirical score as every pointwise error. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1)
≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) * ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (counts.1 j) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (counts.1 j) z)
Proof (Lean source)
-- @node: idealClippedCell_sSup_le_badScore lemma idealClippedCell_sSup_le_badScore {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) : sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) * ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (counts.1 j) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (counts.1 j) z) := by apply csSup_le · exact ⟨|idealClippedCellPath (n := n) epsilon 0 counts j - thresholdFunReal epsilon 0 (cellVector P j)|, ⟨0, by simp, rfl⟩⟩ · rintro y ⟨lambda, hlambda, rfl⟩ exact idealClippedCell_error_le_badScore he hn hd P counts j lambda hlambda
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealClippedCell_sSup_le_badScore · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:149
theorem localBadPilotCellEnvelope_sq_integral_le

In the one-cell pilot/evaluation experiment, the squared bad-pilot continuum envelope is controlled by the promoted four-coordinate moment. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
m :
(n : ℝ) / 8 (: ℝ)
mNN :
toNNReal m (: ℝ≥0)
q :
fun i => toNNReal (cellVector P j (CellFourEquiv.symm i)) (: Fin 4 → ℝ≥0)
μ :
poissonTableLaw (fun i => mNN * q i)
f :
fun pe
=> let counts := (curryCountTable (singleCellCountTable j pe.1), curryCountTable (singleCellCountTable j pe.2)) if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2 (: ((Fin 4 → ℕ) × (Fin 4 → ℕ)) → ℝ)
Integrable f (μ.prod μ)
(∫ pe, f pe ∂μ.prod μ)
≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) ^ 2 * ((pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2)
Proof (Lean source)
-- @node: localBadPilotCellEnvelope_sq_integral_le lemma localBadPilotCellEnvelope_sq_integral_le {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) : let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) let f : ((Fin 4 → ℕ) × (Fin 4 → ℕ)) → ℝ := fun pe => let counts := (curryCountTable (singleCellCountTable j pe.1), curryCountTable (singleCellCountTable j pe.2)) if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2 Integrable f (μ.prod μ) ∧ (∫ pe, f pe ∂μ.prod μ) ≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) ^ 2 * ((pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2) := by classical dsimp only let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw]; infer_instance let B : ℝ := (3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ) let scoreSq : (Fin 4 → ℕ) → ℝ := fun p => if (∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) then 0 else (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2 have hscoreInt : Integrable scoreSq μ := by simpa [scoreSq, μ, q, m, mNN] using pilotCell_badScore_sq_integrable P j hn hd have hdomInt : Integrable (fun pe : (Fin 4 → ℕ) × (Fin 4 → ℕ) => B ^ 2 * scoreSq pe.1) (μ.prod μ) := by have hp : Integrable (fun pe : (Fin 4 → ℕ) × (Fin 4 → ℕ) => scoreSq pe.1) (μ.prod μ) := by change Integrable (scoreSq ∘ fst) (μ.prod μ) exact ((measurePreserving_fst (μ := μ) (ν := μ)).integrable_comp (measurable_of_countable scoreSq).aestronglyMeasurable).2 hscoreInt exact hp.const_mul _ have hpoint (pe : (Fin 4 → ℕ) × (Fin 4 → ℕ)) : (let counts := (curryCountTable (singleCellCountTable j pe.1), curryCountTable (singleCellCountTable j pe.2)) if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) ≤ B ^ 2 * scoreSq pe.1 := by dsimp only let counts := (curryCountTable (singleCellCountTable j pe.1), curryCountTable (singleCellCountTable j pe.2)) have hcell : counts.1 j = fun z => pe.1 (CellFourEquiv z) := by funext z simp [counts, curryCountTable, singleCellCountTable] have hgood : idealPilotGood (n := n) P counts j ↔ ∀ z : Cell, |pilotCenter m (fun z => pe.1 (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => pe.1 (CellFourEquiv z)) z / 4 := by unfold idealPilotGood simpa [m, hcell] by_cases hg : idealPilotGood (n := n) P counts j · have hgb : idealPilotGoodBool (n := n) P counts j = true := (idealPilotGoodBool_eq_true P counts j).2 hg rw [hgb, if_pos rfl] have hs : scoreSq pe.1 = 0 := by dsimp [scoreSq] rw [if_pos (hgood.mp hg)] rw [hs] positivity · have hgb : idealPilotGoodBool (n := n) P counts j = false := by apply Bool.eq_false_of_not_eq_true exact fun hb => hg ((idealPilotGoodBool_eq_true P counts j).1 hb) rw [hgb, if_neg (by decide)] have hs : scoreSq pe.1 = (∑ z : Cell, (|pilotCenter m (fun z => pe.1 (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => pe.1 (CellFourEquiv z)) z)) ^ 2 := by dsimp [scoreSq] rw [if_neg (fun h => hg (hgood.mpr h))] rw [hs] have hsup := idealClippedCell_sSup_le_badScore he hn hd P counts j have hpilot : curryCountTable (singleCellCountTable j pe.1) j = fun z => pe.1 (CellFourEquiv z) := by funext z simp [curryCountTable, singleCellCountTable] rw [hcell] at hsup have hB0 : 0 ≤ B := by dsimp [B]; positivity have hS0 : 0 ≤ ∑ z : Cell, (|pilotCenter m (fun z => pe.1 (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => pe.1 (CellFourEquiv z)) z) := by apply Finset.sum_nonneg intro z _ have hm : 0 < m := by dsimp [m]; positivity have hh : 0 ≤ pilotHalfWidth m d (fun z => pe.1 (CellFourEquiv z)) z := le_trans (pilotRadius_pos_of_pos hm hd _ z).le (pilotRadius_le_pilotHalfWidth hm hd _ z) positivity let Sset := (fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1 have hSbdd : BddAbove Sset := by refine ⟨B * ∑ z : Cell, (|pilotCenter m (fun z => pe.1 (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => pe.1 (CellFourEquiv z)) z), ?_⟩ rintro y ⟨lambda, hlambda, rfl⟩ have h := idealClippedCell_error_le_badScore he hn hd P counts j lambda hlambda rw [hcell] at h simpa [B, m, counts] using h have hzeroMem : |idealClippedCellPath (n := n) epsilon 0 counts j - thresholdFunReal epsilon 0 (cellVector P j)| ∈ Sset := ⟨0, by simp, rfl⟩ have hsup0 : 0 ≤ sSup Sset := le_trans (abs_nonneg _) (le_csSup hSbdd hzeroMem) have hsquared := (sq_le_sq₀ hsup0 (mul_nonneg hB0 hS0)).2 (by simpa [Sset, counts, B, m] using hsup) simpa [Sset, counts, mul_pow] using hsquared have hfInt : Integrable (fun pe : (Fin 4 → ℕ) × (Fin 4 → ℕ) => let counts := (curryCountTable (singleCellCountTable j pe.1), curryCountTable (singleCellCountTable j pe.2)) if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) (μ.prod μ) := by apply hdomInt.mono' (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with pe rw [Real.norm_eq_abs, abs_of_nonneg] · exact hpoint pe · dsimp only split_ifs <;> positivity refine ⟨hfInt, ?_⟩ calc _ ≤ ∫ pe, B ^ 2 * scoreSq pe.1 ∂μ.prod μ := integral_mono_of_nonneg (Filter.Eventually.of_forall fun pe => by dsimp only split_ifs <;> positivity) hdomInt (Filter.Eventually.of_forall hpoint) _ = B ^ 2 * ∫ p, scoreSq p ∂μ := by rw [integral_const_mul, integral_fun_fst] simp _ ≤ B ^ 2 * ((pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2) := by apply mul_le_mul_of_nonneg_left _ (sq_nonneg B) simpa [scoreSq, μ, q, m, mNN] using pilotCell_badScore_sq_integral_le P j hn hd
CausalSmith.Stat.DiscreteBudgetvalueCurve.localBadPilotCellEnvelope_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:171
theorem idealBadPilotCellEnvelope_sq_integral_le

The local bad-pilot envelope estimate transports to the paper's full curried ideal count experiment. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
conclusion 1
Integrable (fun counts => if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) (idealCountLaw (n := n) P)
conclusion 2
(∫ counts, (if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) ∂idealCountLaw (n := n) P)
≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) ^ 2 * ((pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2)
Proof (Lean source)
-- @node: idealBadPilotCellEnvelope_sq_integral_le lemma idealBadPilotCellEnvelope_sq_integral_le {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) : Integrable (fun counts => if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) (idealCountLaw (n := n) P) ∧ (∫ counts, (if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) ∂idealCountLaw (n := n) P) ≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) ^ 2 * ((pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2) := by classical let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let μcell := poissonTableLaw (rate j) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw]; infer_instance let F : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) → (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ) := fun pe => (curryCountTable pe.1, curryCountTable pe.2) let block : ((Fin d × Fin 4) → ℕ) → (Fin 4 → ℕ) := poissonTableCell j let g : ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → ℝ := fun counts => if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2 let ell : ((Fin 4 → ℕ) × (Fin 4 → ℕ)) → ℝ := fun pe => let counts := (curryCountTable (singleCellCountTable j pe.1), curryCountTable (singleCellCountTable j pe.2)) if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2 have hrate (i : Fin 4) : rate j i = toNNReal ((n : ℝ) / 8) * toNNReal (cellVector P j (CellFourEquiv.symm i)) := by apply NNReal.eq have hq : 0 ≤ cellVector P j (CellFourEquiv.symm i) := by change 0 ≤ (P.pmf (j, finTwoEquiv (CellFourEquiv.symm i).1, finTwoEquiv (CellFourEquiv.symm i).2)).toReal positivity simp [rate, idealFlatRate, Real.coe_toNNReal, hq, show 0 ≤ (n : ℝ) / 8 by positivity] exact mul_nonneg (by positivity) hq have hlocalPkg : Integrable ell (μcell.prod μcell) ∧ (∫ pe, ell pe ∂μcell.prod μcell) ≤ ((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) ^ 2 * ((pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2) := by have hrates : rate j = fun i => toNNReal ((n : ℝ) / 8) * toNNReal (cellVector P j (CellFourEquiv.symm i)) := funext hrate rw [show μcell = poissonTableLaw (fun i => toNNReal ((n : ℝ) / 8) * toNNReal (cellVector P j (CellFourEquiv.symm i))) by simp [μcell, hrates]] simpa [ell] using localBadPilotCellEnvelope_sq_integral_le he hn hd P j have hlocal := hlocalPkg.2 have hblockMeas : Measurable block := by dsimp [block, poissonTableCell] fun_prop have hblockMap : Measure.map block μ = μcell := by simpa [block, μ, μcell] using (poissonTable_eval_cell_law rate j).map_eq have hpairMap : Measure.map (map block block) (μ.prod μ) = μcell.prod μcell := by rw [← Measure.map_prod_map μ μ hblockMeas hblockMeas, hblockMap] have hidentify (pe : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ))) : g (F pe) = ell (block pe.1, block pe.2) := by let fullCounts := (curryCountTable pe.1, curryCountTable pe.2) let cellCounts := (curryCountTable (singleCellCountTable j (block pe.1)), curryCountTable (singleCellCountTable j (block pe.2))) have hp : curryCountTable pe.1 j = curryCountTable (singleCellCountTable j (block pe.1)) j := by apply curryCountTable_eq_at_of_poissonTableCell_eq simp [block] have heval : curryCountTable pe.2 j = curryCountTable (singleCellCountTable j (block pe.2)) j := by apply curryCountTable_eq_at_of_poissonTableCell_eq simp [block] have hgood : idealPilotGoodBool (n := n) P fullCounts j = idealPilotGoodBool (n := n) P cellCounts j := by unfold idealPilotGoodBool congr 1 apply propext unfold idealPilotGood rw [show fullCounts.1 j = cellCounts.1 j by exact hp] have hpath (lambda : ℝ) : idealClippedCellPath (n := n) epsilon lambda fullCounts j = idealClippedCellPath (n := n) epsilon lambda cellCounts j := by unfold idealClippedCellPath rw [show fullCounts.1 j = cellCounts.1 j by exact hp, show fullCounts.2 j = cellCounts.2 j by exact heval] change (if idealPilotGoodBool (n := n) P fullCounts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda fullCounts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) = (if idealPilotGoodBool (n := n) P cellCounts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda cellCounts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) rw [hgood] simp_rw [hpath] have hF : Measurable F := by fun_prop have hg : Measurable g := measurable_of_countable _ have hell : Measurable ell := measurable_of_countable _ have hmap : Measure.map F (μ.prod μ) = idealCountLaw (n := n) P := by simpa [F, μ, rate] using map_flatIdealCountLaw (n := n) P have hellMap : Integrable ell (Measure.map (map block block) (μ.prod μ)) := by rw [hpairMap] exact hlocalPkg.1 have hflatEll : Integrable (ell ∘ map block block) (μ.prod μ) := hellMap.comp_aemeasurable (by fun_prop) have hflatG : Integrable (g ∘ F) (μ.prod μ) := by apply hflatEll.congr exact Filter.Eventually.of_forall fun pe => (hidentify pe).symm have hgMap : Integrable g (Measure.map F (μ.prod μ)) := (integrable_map_measure hg.aestronglyMeasurable hF.aemeasurable).2 hflatG have hgIdeal : Integrable g (idealCountLaw (n := n) P) := by rw [← hmap] exact hgMap refine ⟨hgIdeal, ?_⟩ calc _ = ∫ pe, g (F pe) ∂μ.prod μ := by rw [← hmap, integral_map hF.aemeasurable hg.aestronglyMeasurable] _ = ∫ pe, ell (map block block pe) ∂μ.prod μ := by apply integral_congr_ae exact Filter.Eventually.of_forall hidentify _ = ∫ pe, ell pe ∂μcell.prod μcell := by rw [← hpairMap, integral_map (by fun_prop) hell.aestronglyMeasurable] _ ≤ _ := hlocal
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealBadPilotCellEnvelope_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:336
theorem badPilotCellEnvelope_le

Equation (28): one epsilon-dependent constant controls every bad-pilot cell envelope in the full ideal count experiment. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
1 ≤ n
1 ≤ d
P :
j :
Fin d
badPilotCellEnvelope (n := n) epsilon P j
≤ C * (d : ℝ) ^ (1 / 4 : ℝ) * exp (-10 * logAlphabet d) * badPilotCellScale (n := n) P j
Proof (Lean source)
-- @node: badPilotCellEnvelope_le lemma badPilotCellEnvelope_le (epsilon : ℝ) (he : 0 < epsilon) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ}, 1 ≤ n → 1 ≤ d → ∀ (P : DiscreteLaw d) (j : Fin d), badPilotCellEnvelope (n := n) epsilon P j ≤ C * (d : ℝ) ^ (1 / 4 : ℝ) * exp (-10 * logAlphabet d) * badPilotCellScale (n := n) P j := by classical let A : ℝ := 3 * (1 + epsilon⁻¹) + 1 let K : ℝ := (pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 let C : ℝ := (A + 1) * Real.sqrt K have hA : 0 < A := by dsimp [A]; positivity have hK : 0 < K := by dsimp [K] have hpilot : 0 < pilotRadiusConstant := by unfold pilotRadiusConstant norm_num exact mul_pos (sq_pos_of_pos (div_pos hpilot universalH_pos)) (productMomentConstant_pos 4 2) have hC : 0 < C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro n d hn hd P j let r : ℝ := (d : ℝ) ^ (1 / 4 : ℝ) let E : ℝ := exp (-10 * logAlphabet d) let S : ℝ := badPilotCellScale (n := n) P j let I : ℝ := ∫ counts, (if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) ∂idealCountLaw (n := n) P have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have hr : 1 ≤ r := by dsimp [r] exact Real.one_le_rpow hdR (by norm_num) have hB : A + r ≤ (A + 1) * r := by nlinarith [mul_nonneg hA.le (sub_nonneg.mpr hr)] have hB0 : 0 ≤ A + r := by positivity have hcoef : (A + r) ^ 2 ≤ (A + 1) ^ 2 * r ^ 2 := by have := pow_le_pow_left₀ hB0 hB 2 nlinarith have hS : 0 ≤ S := by dsimp [S, badPilotCellScale] have hm : 0 < (n : ℝ) / 8 := by positivity have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] linarith [Real.log_nonneg hdR] positivity have hI : I ≤ (A + r) ^ 2 * (K * exp (-20 * logAlphabet d) * S ^ 2) := by dsimp [I, A, r, K, S] simpa [mul_assoc] using (idealBadPilotCellEnvelope_sq_integral_le he hn hd P j).2 have htail0 : 0 ≤ K * exp (-20 * logAlphabet d) * S ^ 2 := by positivity have hI' : I ≤ (A + 1) ^ 2 * r ^ 2 * (K * exp (-20 * logAlphabet d) * S ^ 2) := le_trans hI (mul_le_mul_of_nonneg_right hcoef htail0) have hr2 : r ^ 2 = (d : ℝ) ^ (1 / 2 : ℝ) := by dsimp [r] rw [← Real.rpow_natCast] rw [← Real.rpow_mul (by positivity)] congr 1 norm_num have hE2 : E ^ 2 = exp (-20 * logAlphabet d) := by dsimp [E] rw [pow_two, ← Real.exp_add] congr 1 ring have hsqrtK : Real.sqrt K ^ 2 = K := Real.sq_sqrt hK.le have hy : 0 ≤ C * r * E * S := by positivity have hIy : I ≤ (C * r * E * S) ^ 2 := by calc I ≤ (A + 1) ^ 2 * r ^ 2 * (K * exp (-20 * logAlphabet d) * S ^ 2) := hI' _ = (C * r * E * S) ^ 2 := by simp only [mul_pow] rw [show C = (A + 1) * Real.sqrt K by rfl, mul_pow, hsqrtK, hE2] ring have hbool : (∫ counts, ((if idealPilotGood (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1)) ^ 2) ∂idealCountLaw (n := n) P) = I := by dsimp [I] apply integral_congr_ae filter_upwards [] with counts by_cases hg : idealPilotGood (n := n) P counts j · have hb := (idealPilotGoodBool_eq_true P counts j).2 hg simp [hg, hb] · have hb : idealPilotGoodBool (n := n) P counts j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P counts j).1 ht) simp [hg, hb] unfold badPilotCellEnvelope rw [hbool] exact (Real.sqrt_le_left hy).2 hIy
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilotCellEnvelope_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:487
theorem idealBadPilotCellPath_norm_sq_integrable

Equation (28) also supplies the squared-norm integrability of each bad-pilot cell Path required by later Bochner arguments. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
Integrable (fun counts => ‖idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false)‖ ^ 2) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealBadPilotCellPath_norm_sq_integrable lemma idealBadPilotCellPath_norm_sq_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) : Integrable (fun counts => ‖idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false)‖ ^ 2) (idealCountLaw (n := n) P) := by classical let hcont := fun counts => idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false let envelopeSq := fun counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ) => if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2 have henv : Integrable envelopeSq (idealCountLaw (n := n) P) := by simpa [envelopeSq] using (idealBadPilotCellEnvelope_sq_integral_le he hn hd P j).1 apply henv.congr filter_upwards [] with counts rw [idealPilotErrorCellPath_norm_eq_sSup epsilon P counts j false (hcont counts)] by_cases hg : idealPilotGood (n := n) P counts j · have hb := (idealPilotGoodBool_eq_true P counts j).2 hg simp [envelopeSq, hb, idealPilotErrorCell, hg] · have hb : idealPilotGoodBool (n := n) P counts j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P counts j).1 ht) simp [envelopeSq, hb, idealPilotErrorCell, idealClippedCellPath, hg]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealBadPilotCellPath_norm_sq_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:592
theorem idealBadPilotCellPath_norm_sq_sum_integrable

The finite sum of bad-pilot cell squared Path norms is integrable. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
Integrable (fun counts => ∑ j : Fin d, ‖idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false)‖ ^ 2) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealBadPilotCellPath_norm_sq_sum_integrable lemma idealBadPilotCellPath_norm_sq_sum_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) : Integrable (fun counts => ∑ j : Fin d, ‖idealPilotErrorCellPath epsilon P counts j false (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j false)‖ ^ 2) (idealCountLaw (n := n) P) := by apply integrable_finsetSum intro j _ exact idealBadPilotCellPath_norm_sq_integrable epsilon he hn hd P j
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealBadPilotCellPath_norm_sq_sum_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:626
theorem idealClippedCell_error_sSup_sq_integrable Lemma idealClippedCell_error_sSup_sq_integrable in the paper ↗

For an arbitrary discrete law, the unrestricted squared supremum error of one clipped ideal cell is integrable; no overlap estimate is needed. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
Integrable (fun counts => sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealClippedCell_error_sSup_sq_integrable lemma idealClippedCell_error_sSup_sq_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) : Integrable (fun counts => sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2) (idealCountLaw (n := n) P) := by classical let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let μcell := poissonTableLaw (rate j) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw]; infer_instance let F : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) → (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ) := fun pe => (curryCountTable pe.1, curryCountTable pe.2) let block : ((Fin d × Fin 4) → ℕ) → (Fin 4 → ℕ) := poissonTableCell j let scoreSq : (Fin 4 → ℕ) → ℝ := fun p => (∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (fun z => p (CellFourEquiv z)) z)) ^ 2 let g : ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → ℝ := fun counts => sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) ^ 2 have hrate (i : Fin 4) : rate j i = toNNReal ((n : ℝ) / 8) * toNNReal (cellVector P j (CellFourEquiv.symm i)) := by apply NNReal.eq have hq : 0 ≤ cellVector P j (CellFourEquiv.symm i) := by change 0 ≤ (P.pmf (j, finTwoEquiv (CellFourEquiv.symm i).1, finTwoEquiv (CellFourEquiv.symm i).2)).toReal positivity simp [rate, idealFlatRate, hq, show 0 ≤ (n : ℝ) / 8 by positivity] exact mul_nonneg (by positivity) hq have hrates : rate j = fun i => toNNReal ((n : ℝ) / 8) * toNNReal (cellVector P j (CellFourEquiv.symm i)) := funext hrate have hscoreCell : Integrable scoreSq μcell := by rw [show μcell = poissonTableLaw (fun i => toNNReal ((n : ℝ) / 8) * toNNReal (cellVector P j (CellFourEquiv.symm i))) by simp [μcell, hrates]] simpa [scoreSq] using pilotCell_score_sq_integrable P j hn hd have hblockMeas : Measurable block := by dsimp [block, poissonTableCell] fun_prop have hblockMap : Measure.map block μ = μcell := by simpa [block, μ, μcell] using (poissonTable_eval_cell_law rate j).map_eq have hscoreFull : Integrable (scoreSq ∘ block) μ := by have hmapped : Integrable scoreSq (Measure.map block μ) := by rw [hblockMap] exact hscoreCell exact hmapped.comp_aemeasurable hblockMeas.aemeasurable have hscoreProd : Integrable (fun pe : ((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ) => scoreSq (block pe.1)) (μ.prod μ) := by change Integrable ((scoreSq ∘ block) ∘ fst) (μ.prod μ) exact ((measurePreserving_fst (μ := μ) (ν := μ)).integrable_comp (measurable_of_countable (scoreSq ∘ block)).aestronglyMeasurable).2 hscoreFull let B : ℝ := (3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ) have hdomInt : Integrable (fun pe : ((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ) => B ^ 2 * scoreSq (block pe.1)) (μ.prod μ) := hscoreProd.const_mul _ have hpoint (pe : ((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) : g (F pe) ≤ B ^ 2 * scoreSq (block pe.1) := by have hcell : curryCountTable pe.1 j = fun z => block pe.1 (CellFourEquiv z) := by funext z simp [block, curryCountTable, poissonTableCell] have hFcell : (F pe).1 j = fun z => block pe.1 (CellFourEquiv z) := by simpa [F] using hcell have hsup := idealClippedCell_sSup_le_badScore he hn hd P (F pe) j rw [hFcell] at hsup have hB0 : 0 ≤ B := by dsimp [B]; positivity have hS0 : 0 ≤ ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (fun z => block pe.1 (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (fun z => block pe.1 (CellFourEquiv z)) z) := by apply Finset.sum_nonneg intro z _ have hh : 0 ≤ pilotHalfWidth ((n : ℝ) / 8) d (fun z => block pe.1 (CellFourEquiv z)) z := le_trans (pilotRadius_pos_of_pos (by positivity) hd _ z).le (pilotRadius_le_pilotHalfWidth (by positivity) hd _ z) positivity have hsetBdd : BddAbove ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda (F pe) j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) := ⟨B * sqrt (scoreSq (block pe.1)), by rintro y ⟨lambda, hlambda, rfl⟩ have hp := idealClippedCell_error_le_badScore he hn hd P (F pe) j lambda hlambda rw [hFcell] at hp have hsqrt : sqrt (scoreSq (block pe.1)) = ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (fun z => block pe.1 (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (fun z => block pe.1 (CellFourEquiv z)) z) := by dsimp [scoreSq] rw [Real.sqrt_sq_eq_abs, abs_of_nonneg hS0] simpa [B, hsqrt] using hp⟩ have hzeroMem : |idealClippedCellPath (n := n) epsilon 0 (F pe) j - thresholdFunReal epsilon 0 (cellVector P j)| ∈ (fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda (F pe) j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1 := ⟨0, by simp, rfl⟩ have hsup0 : 0 ≤ sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda (F pe) j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) := le_trans (abs_nonneg _) (le_csSup hsetBdd hzeroMem) dsimp [g, scoreSq] have hsquared := (sq_le_sq₀ hsup0 (mul_nonneg hB0 hS0)).2 (by simpa [B] using hsup) simpa [mul_pow] using hsquared have hflat : Integrable (g ∘ F) (μ.prod μ) := by apply hdomInt.mono' (measurable_of_countable _).aestronglyMeasurable exact Filter.Eventually.of_forall fun pe => by rw [Real.norm_eq_abs, abs_of_nonneg] · exact hpoint pe · dsimp [g] positivity have hF : Measurable F := by fun_prop have hg : Measurable g := measurable_of_countable _ have hmap : Measure.map F (μ.prod μ) = idealCountLaw (n := n) P := by simpa [F, μ, rate] using map_flatIdealCountLaw (n := n) P have hmapped : Integrable g (Measure.map F (μ.prod μ)) := (integrable_map_measure hg.aestronglyMeasurable hF.aemeasurable).2 hflat rw [hmap] at hmapped exact hmapped
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealClippedCell_error_sSup_sq_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotEnvelope.lean:639
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.BadPilotMoment 10 declarations Coordinatewise empirical-radius estimates for bad pilot cells.

Coordinatewise empirical-radius estimates for bad pilot cells.

theorem poisson_pilotCoordinateBad_probability

The paper's one-coordinate bad pilot event has the promoted exponential probability bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m q :
ℝ
hm :
0 < m
hq :
0 ≤ q
d :
ℕ
hd :
1 ≤ d
zeta :
Cell
poissonMeasure (toNNReal (m * q)) {w : ℕ | |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4}
≤ ofReal (2 * exp (-40 * logAlphabet d))
Proof (Lean source)
-- @node: poisson_pilotCoordinateBad_probability lemma poisson_pilotCoordinateBad_probability {m q : ℝ} (hm : 0 < m) (hq : 0 ≤ q) {d : ℕ} (hd : 1 ≤ d) (zeta : Cell) : poissonMeasure (Real.toNNReal (m * q)) {w : ℕ | |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4} ≤ ofReal (2 * exp (-40 * logAlphabet d)) := by let mNN : ℝ≥0 := Real.toNNReal m let qNN : ℝ≥0 := Real.toNNReal q have hmNN : 0 < mNN := Real.toNNReal_pos.mpr hm have hL : 1 ≤ logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR] have hrate : mNN * qNN = Real.toNNReal (m * q) := by apply NNReal.eq simp only [NNReal.coe_mul, mNN, qNN] rw [Real.coe_toNNReal m hm.le, Real.coe_toNNReal q hq, Real.coe_toNNReal (m * q) (mul_nonneg hm.le hq)] rw [← hrate] have hevent : {w : ℕ | |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4} = {w : ℕ | normalizedDeviation mNN qNN w > empiricalRadius pilotRadiusConstant mNN (logAlphabet d / (mNN : ℝ)) w / 4} := by ext w simp only [Set.mem_ofPred_eq] rw [pilotHalfWidth_eq_empiricalRadius hm d (fun _ => w) zeta] simp only [pilotCenter, mNN, qNN, Real.coe_toNNReal m hm.le, Real.coe_toNNReal q hq, normalizedDeviation] rw [hevent] exact poisson_empiricalRadius_bad_probability qNN mNN hmNN pilotRadiusConstant (logAlphabet d) (by unfold pilotRadiusConstant universalH; norm_num) hL
CausalSmith.Stat.DiscreteBudgetvalueCurve.poisson_pilotCoordinateBad_probability · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:17
theorem poisson_pilotCoordinateBad_second_moment

On its bad event, the squared paper coordinate score satisfies the promoted empirical-radius moment bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m q :
ℝ
hm :
0 < m
hq :
0 ≤ q
d :
ℕ
hd :
1 ≤ d
zeta :
Cell
(∫ w : ℕ, (if |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4 then (|pilotCenter m (fun _ => w) zeta - q| + pilotHalfWidth m d (fun _ => w) zeta) ^ 2 else 0) ∂poissonMeasure (toNNReal (m * q)))
≤ (pilotRadiusConstant / universalH) ^ 2 * scalarBadMomentConstant 2 * exp (-20 * logAlphabet d) * (sqrt (q * logAlphabet d / m) + logAlphabet d / m) ^ 2
Proof (Lean source)
-- @node: poisson_pilotCoordinateBad_second_moment lemma poisson_pilotCoordinateBad_second_moment {m q : ℝ} (hm : 0 < m) (hq : 0 ≤ q) {d : ℕ} (hd : 1 ≤ d) (zeta : Cell) : (∫ w : ℕ, (if |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4 then (|pilotCenter m (fun _ => w) zeta - q| + pilotHalfWidth m d (fun _ => w) zeta) ^ 2 else 0) ∂poissonMeasure (Real.toNNReal (m * q))) ≤ (pilotRadiusConstant / universalH) ^ 2 * scalarBadMomentConstant 2 * exp (-20 * logAlphabet d) * (sqrt (q * logAlphabet d / m) + logAlphabet d / m) ^ 2 := by let mNN : ℝ≥0 := Real.toNNReal m let qNN : ℝ≥0 := Real.toNNReal q have hmNN : 0 < mNN := Real.toNNReal_pos.mpr hm have hL : 1 ≤ logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR] have hrate : mNN * qNN = Real.toNNReal (m * q) := by apply NNReal.eq simp only [NNReal.coe_mul, mNN, qNN] rw [Real.coe_toNNReal m hm.le, Real.coe_toNNReal q hq, Real.coe_toNNReal (m * q) (mul_nonneg hm.le hq)] rw [← hrate] convert poisson_empiricalRadius_bad_second_moment qNN mNN hmNN pilotRadiusConstant (logAlphabet d) (by unfold pilotRadiusConstant universalH; norm_num) hL using 1 · congr 1 funext w rw [pilotHalfWidth_eq_empiricalRadius hm d (fun _ => w) zeta] simp only [pilotCenter, mNN, qNN, Real.coe_toNNReal m hm.le, Real.coe_toNNReal q hq, normalizedDeviation] rfl · simp only [qNN, mNN, Real.coe_toNNReal q hq, Real.coe_toNNReal m hm.le]
CausalSmith.Stat.DiscreteBudgetvalueCurve.poisson_pilotCoordinateBad_second_moment · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:58
theorem poisson_pilotCoordinateBad_fourth_moment

On its bad event, the fourth power of the paper coordinate score satisfies the promoted empirical-radius moment bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m q :
ℝ
hm :
0 < m
hq :
0 ≤ q
d :
ℕ
hd :
1 ≤ d
zeta :
Cell
(∫ w : ℕ, (if |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4 then (|pilotCenter m (fun _ => w) zeta - q| + pilotHalfWidth m d (fun _ => w) zeta) ^ 4 else 0) ∂poissonMeasure (toNNReal (m * q)))
≤ (pilotRadiusConstant / universalH) ^ 4 * scalarBadMomentConstant 4 * exp (-20 * logAlphabet d) * (sqrt (q * logAlphabet d / m) + logAlphabet d / m) ^ 4
Proof (Lean source)
-- @node: poisson_pilotCoordinateBad_fourth_moment lemma poisson_pilotCoordinateBad_fourth_moment {m q : ℝ} (hm : 0 < m) (hq : 0 ≤ q) {d : ℕ} (hd : 1 ≤ d) (zeta : Cell) : (∫ w : ℕ, (if |pilotCenter m (fun _ => w) zeta - q| > pilotHalfWidth m d (fun _ => w) zeta / 4 then (|pilotCenter m (fun _ => w) zeta - q| + pilotHalfWidth m d (fun _ => w) zeta) ^ 4 else 0) ∂poissonMeasure (Real.toNNReal (m * q))) ≤ (pilotRadiusConstant / universalH) ^ 4 * scalarBadMomentConstant 4 * exp (-20 * logAlphabet d) * (sqrt (q * logAlphabet d / m) + logAlphabet d / m) ^ 4 := by let mNN : ℝ≥0 := Real.toNNReal m let qNN : ℝ≥0 := Real.toNNReal q have hmNN : 0 < mNN := Real.toNNReal_pos.mpr hm have hL : 1 ≤ logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR] have hrate : mNN * qNN = Real.toNNReal (m * q) := by apply NNReal.eq simp only [NNReal.coe_mul, mNN, qNN] rw [Real.coe_toNNReal m hm.le, Real.coe_toNNReal q hq, Real.coe_toNNReal (m * q) (mul_nonneg hm.le hq)] rw [← hrate] convert poisson_empiricalRadius_bad_fourth_moment qNN mNN hmNN pilotRadiusConstant (logAlphabet d) (by unfold pilotRadiusConstant universalH; norm_num) hL using 1 · congr 1 funext w rw [pilotHalfWidth_eq_empiricalRadius hm d (fun _ => w) zeta] simp only [pilotCenter, mNN, qNN, Real.coe_toNNReal m hm.le, Real.coe_toNNReal q hq, normalizedDeviation] rfl · simp only [qNN, mNN, Real.coe_toNNReal q hq, Real.coe_toNNReal m hm.le]
CausalSmith.Stat.DiscreteBudgetvalueCurve.poisson_pilotCoordinateBad_fourth_moment · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:101
theorem pilotCell_universalBadScore_moment Lemma pilotCell_universalBadScore_moment in the paper ↗

The universal four-coordinate bad-score moment specializes to one pilot cell with total intensity m * cellMass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
P :
j :
Fin d
m L :
ℝ
hm :
0 < m
hL :
1 ≤ L
t :
ℕ
ht :
t = 1 ∨ t = 2 ∨ t = 4
rate :
fun i => toNNReal (m * cellVector P j (CellFourEquiv.symm i)) (: Fin 4 → ℝ≥0)
μ :
W :
fun i p => p i (: Fin 4 → (Fin 4 → ℕ) → ℕ)
(∫ p, (badAny W universalH L rate).indicator (fun p => (aggregateScore W universalH L rate p) ^ t) p ∂μ)
≤ productMomentConstant 4 t * exp (-20 * L) * (sqrt (m * cellMass P j * L) + L) ^ t
Proof (Lean source)
-- @node: pilotCell_universalBadScore_moment lemma pilotCell_universalBadScore_moment {d : ℕ} (P : DiscreteLaw d) (j : Fin d) {m L : ℝ} (hm : 0 < m) (hL : 1 ≤ L) {t : ℕ} (ht : t = 1 ∨ t = 2 ∨ t = 4) : let rate : Fin 4 → ℝ≥0 := fun i => toNNReal (m * cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw rate let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i (∫ p, (badAny W universalH L rate).indicator (fun p => (aggregateScore W universalH L rate p) ^ t) p ∂μ) ≤ productMomentConstant 4 t * exp (-20 * L) * (sqrt (m * cellMass P j * L) + L) ^ t := by dsimp only let rate : Fin 4 → ℝ≥0 := fun i => toNNReal (m * cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw rate let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw] infer_instance have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate i)) μ := by simpa [W, μ] using poissonTable_eval_coordinate_law rate i have hWindep : iIndepFun W μ := by simpa [W, μ] using poissonTable_eval_independent rate have hraw := independent_poisson_badAny_moment_four μ W rate (fun _ => measurable_pi_apply _) hWlaw hWindep ht hL have hq (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hrate (i : Fin 4) : (rate i : ℝ) = m * cellVector P j (CellFourEquiv.symm i) := by dsimp [rate] exact max_eq_left (mul_nonneg hm.le (hq _)) have hcellmass : ∑ z : Cell, cellVector P j z = cellMass P j := by rw [Fintype.sum_prod_type] simp_rw [Fin.sum_univ_two] simp [cellMass, cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring have hmass : ∑ i : Fin 4, (rate i : ℝ) = m * cellMass P j := by calc _ = m * ∑ i : Fin 4, cellVector P j (CellFourEquiv.symm i) := by simp_rw [hrate, Finset.mul_sum] _ = m * ∑ z : Cell, cellVector P j z := by rw [Equiv.sum_comp CellFourEquiv.symm] _ = _ := by rw [hcellmass] simpa [μ, W, hmass] using hraw
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotCell_universalBadScore_moment · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:144
theorem pilotCell_empiricalBadScore_moment

The promoted empirical-radius product theorem, specialized to the four pilot counts of one paper cell. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
j :
Fin d
hn :
1 ≤ n
hd :
1 ≤ d
t :
ℕ
ht :
t = 1 ∨ t = 2 ∨ t = 4
m :
(n : ℝ) / 8 (: ℝ)
mNN :
toNNReal m (: ℝ≥0)
q :
fun i => toNNReal (cellVector P j (CellFourEquiv.symm i)) (: Fin 4 → ℝ≥0)
μ :
poissonTableLaw (fun i => mNN * q i)
W :
fun i p => p i (: Fin 4 → (Fin 4 → ℕ) → ℕ)
(∫ p, (empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q).indicator (fun p => (empiricalAggregateScore W pilotRadiusConstant (logAlphabet d) mNN q p) ^ t) p ∂μ)
≤ (pilotRadiusConstant / universalH) ^ t * productMomentConstant 4 t * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ t
Proof (Lean source)
-- @node: pilotCell_empiricalBadScore_moment lemma pilotCell_empiricalBadScore_moment {n d : ℕ} (P : DiscreteLaw d) (j : Fin d) (hn : 1 ≤ n) (hd : 1 ≤ d) {t : ℕ} (ht : t = 1 ∨ t = 2 ∨ t = 4) : let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i (∫ p, (empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q).indicator (fun p => (empiricalAggregateScore W pilotRadiusConstant (logAlphabet d) mNN q p) ^ t) p ∂μ) ≤ (pilotRadiusConstant / universalH) ^ t * productMomentConstant 4 t * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ t := by dsimp only let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i have hm : 0 < m := by dsimp [m]; positivity have hmNN : 0 < mNN := Real.toNNReal_pos.mpr hm letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw] infer_instance have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (mNN * q i)) μ := by simpa [W, μ] using poissonTable_eval_coordinate_law (fun i => mNN * q i) i have hWindep : iIndepFun W μ := by simpa [W, μ] using poissonTable_eval_independent (fun i => mNN * q i) have hL : 1 ≤ logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR] have hprod := independent_poisson_empiricalRadius_badAny_moment_four μ W q mNN hmNN (fun _ => measurable_pi_apply _) hWlaw hWindep ht pilotRadiusConstant (logAlphabet d) (by unfold pilotRadiusConstant universalH; norm_num) hL have hq (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hqcoe (i : Fin 4) : (q i : ℝ) = cellVector P j (CellFourEquiv.symm i) := by dsimp [q] exact max_eq_left (hq _) have hcellmass : ∑ z : Cell, cellVector P j z = cellMass P j := by rw [Fintype.sum_prod_type] simp_rw [Fin.sum_univ_two] simp [cellMass, cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring have hqsum : ∑ i : Fin 4, (q i : ℝ) = cellMass P j := by calc _ = ∑ z : Cell, cellVector P j z := by simp_rw [hqcoe] rw [Equiv.sum_comp CellFourEquiv.symm] _ = _ := hcellmass have hmcoe : (mNN : ℝ) = m := Real.coe_toNNReal m hm.le rw [hqsum, hmcoe] at hprod simpa [μ, W, q, hqsum, badPilotCellScale, m] using hprod
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotCell_empiricalBadScore_moment · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:197
theorem independent_poisson_empiricalBadScore_sq_integrable_four Lemma independent_poisson_empiricalBadScore_sq_integrable_four in the paper ↗

The squared empirical aggregate score restricted to the union of the four bad-radius events is integrable under independent Poisson coordinates. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
W :
Fin 4 → Ω → ℕ
q :
Fin 4 → ℝ≥0
m :
ℝ≥0
hm :
0 < m
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ
H L :
ℝ
hH :
hL :
1 ≤ L
Integrable (fun ω => (empiricalBadAny W H L m q).indicator (fun ω => (empiricalAggregateScore W H L m q ω) ^ 2) ω) μ
Proof (Lean source)
-- @node: independent_poisson_empiricalBadScore_sq_integrable_four lemma independent_poisson_empiricalBadScore_sq_integrable_four {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : Fin 4 → Ω → ℕ) (q : Fin 4 → ℝ≥0) (m : ℝ≥0) (hm : 0 < m) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ) (H L : ℝ) (hH : universalH ≤ H) (hL : 1 ≤ L) : Integrable (fun ω => (empiricalBadAny W H L m q).indicator (fun ω => (empiricalAggregateScore W H L m q ω) ^ 2) ω) μ := by let lambda : Fin 4 → ℝ≥0 := fun i => m * q i let c : ℝ := H / universalH / (m : ℝ) have hmR : 0 < (m : ℝ) := NNReal.coe_pos.mpr hm have hH0 : 0 ≤ H := le_trans universalH_pos.le hH have hc : 0 ≤ c := by dsimp [c] exact div_nonneg (div_nonneg hH0 universalH_pos.le) hmR.le have hscoreInt (i : Fin 4) : Integrable (fun ω => (score universalH L (lambda i) (W i ω)) ^ 2) μ := by have h := integrable_score_pow (lambda i) hL (t := 2) rw [← (hWlaw i).map_eq] at h exact h.comp_aemeasurable (hWlaw i).aemeasurable have hdomInt : Integrable (fun ω => 4 * ∑ i, (score universalH L (lambda i) (W i ω)) ^ 2) μ := (integrable_finsetSum _ fun i _ => hscoreInt i).const_mul 4 have hrawInt : Integrable (fun ω => (badAny W universalH L lambda).indicator (fun ω => (aggregateScore W universalH L lambda ω) ^ 2) ω) μ := by apply Integrable.mono' hdomInt · unfold badAny aggregateScore score deviation radius measurability · filter_upwards [] with ω rw [Real.norm_eq_abs, abs_of_nonneg] · by_cases hb : ω ∈ badAny W universalH L lambda · rw [Set.indicator_of_mem hb] simpa [aggregateScore] using pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset (Fin 4))) (f := fun i => score universalH L (lambda i) (W i ω)) (fun i _ => by unfold score deviation radius exact add_nonneg (abs_nonneg _) (mul_nonneg universalH_pos.le (by positivity))) 1 · simp only [Set.indicator_of_notMem hb, norm_zero, abs_zero] exact mul_nonneg (by norm_num) (Finset.sum_nonneg fun i _ => sq_nonneg _) · by_cases hb : ω ∈ badAny W universalH L lambda · rw [Set.indicator_of_mem hb] positivity · simp [hb] apply Integrable.mono' (hrawInt.const_mul (c ^ 2)) · unfold empiricalBadAny empiricalAggregateScore normalizedDeviation empiricalRadius measurability · filter_upwards [] with ω rw [Real.norm_eq_abs, abs_of_nonneg] · by_cases hb : ω ∈ empiricalBadAny W H L m q · have hrb : ω ∈ badAny W universalH L lambda := empiricalBadAny_subset_raw W q m hm H L hH hL hb rw [Set.indicator_of_mem hb, Set.indicator_of_mem hrb] have hscore := empiricalAggregateScore_le_raw W q m hm H L hH hL ω have hemp0 : 0 ≤ empiricalAggregateScore W H L m q ω := by unfold empiricalAggregateScore apply Finset.sum_nonneg intro i _ have hd : 0 ≤ normalizedDeviation m (q i) (W i ω) := by unfold normalizedDeviation positivity have hr : 0 ≤ empiricalRadius H m (L / (m : ℝ)) (W i ω) := by rw [empiricalRadius_eq_normalizedRadius] unfold normalizedRadius exact mul_nonneg hH0 (add_nonneg (Real.sqrt_nonneg _) (by positivity)) exact add_nonneg hd hr calc (empiricalAggregateScore W H L m q ω) ^ 2 ≤ (c * aggregateScore W universalH L lambda ω) ^ 2 := by apply pow_le_pow_left₀ hemp0 calc _ ≤ (H / universalH) * (aggregateScore W universalH L (fun i => m * q i) ω / (m : ℝ)) := hscore _ = c * aggregateScore W universalH L lambda ω := by dsimp [c, lambda] ring _ = c ^ 2 * aggregateScore W universalH L lambda ω ^ 2 := by ring · rw [Set.indicator_of_notMem hb] by_cases hrb : ω ∈ badAny W universalH L lambda · rw [Set.indicator_of_mem hrb] exact mul_nonneg (sq_nonneg c) (sq_nonneg _) · simp [hrb] · by_cases hb : ω ∈ empiricalBadAny W H L m q · rw [Set.indicator_of_mem hb] positivity · rw [Set.indicator_of_notMem hb]
CausalSmith.Stat.DiscreteBudgetvalueCurve.independent_poisson_empiricalBadScore_sq_integrable_four · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:268
theorem independent_poisson_empiricalAggregateScore_sq_integrable_four Lemma independent_poisson_empiricalAggregateScore_sq_integrable_four in the paper ↗

Without restricting to the bad event, the squared empirical aggregate score is still integrable under four Poisson coordinates. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
W :
Fin 4 → Ω → ℕ
q :
Fin 4 → ℝ≥0
m :
ℝ≥0
hm :
0 < m
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ
H L :
ℝ
hH :
hL :
1 ≤ L
Integrable (fun ω => (empiricalAggregateScore W H L m q ω) ^ 2) μ
Proof (Lean source)
-- @node: independent_poisson_empiricalAggregateScore_sq_integrable_four lemma independent_poisson_empiricalAggregateScore_sq_integrable_four {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : Fin 4 → Ω → ℕ) (q : Fin 4 → ℝ≥0) (m : ℝ≥0) (hm : 0 < m) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (m * q i)) μ) (H L : ℝ) (hH : universalH ≤ H) (hL : 1 ≤ L) : Integrable (fun ω => (empiricalAggregateScore W H L m q ω) ^ 2) μ := by let lambda : Fin 4 → ℝ≥0 := fun i => m * q i let c : ℝ := H / universalH / (m : ℝ) have hmR : 0 < (m : ℝ) := NNReal.coe_pos.mpr hm have hH0 : 0 ≤ H := le_trans universalH_pos.le hH have hscoreInt (i : Fin 4) : Integrable (fun ω => (score universalH L (lambda i) (W i ω)) ^ 2) μ := by have h := integrable_score_pow (lambda i) hL (t := 2) rw [← (hWlaw i).map_eq] at h exact h.comp_aemeasurable (hWlaw i).aemeasurable have hdomInt : Integrable (fun ω => 4 * ∑ i, (score universalH L (lambda i) (W i ω)) ^ 2) μ := (integrable_finsetSum _ fun i _ => hscoreInt i).const_mul 4 have hrawInt : Integrable (fun ω => (aggregateScore W universalH L lambda ω) ^ 2) μ := by apply hdomInt.mono' · unfold aggregateScore score deviation radius measurability · filter_upwards [] with ω rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] simpa [aggregateScore] using pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset (Fin 4))) (f := fun i => score universalH L (lambda i) (W i ω)) (fun i _ => by unfold score deviation radius exact add_nonneg (abs_nonneg _) (mul_nonneg universalH_pos.le (by positivity))) 1 apply (hrawInt.const_mul (c ^ 2)).mono' · unfold empiricalAggregateScore normalizedDeviation empiricalRadius measurability · filter_upwards [] with ω rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hemp0 : 0 ≤ empiricalAggregateScore W H L m q ω := by unfold empiricalAggregateScore apply Finset.sum_nonneg intro i _ have hd : 0 ≤ normalizedDeviation m (q i) (W i ω) := by unfold normalizedDeviation positivity have hr : 0 ≤ empiricalRadius H m (L / (m : ℝ)) (W i ω) := by rw [empiricalRadius_eq_normalizedRadius] unfold normalizedRadius exact mul_nonneg hH0 (add_nonneg (Real.sqrt_nonneg _) (by positivity)) exact add_nonneg hd hr calc (empiricalAggregateScore W H L m q ω) ^ 2 ≤ (c * aggregateScore W universalH L lambda ω) ^ 2 := by apply pow_le_pow_left₀ hemp0 calc _ ≤ (H / universalH) * (aggregateScore W universalH L (fun i => m * q i) ω / (m : ℝ)) := empiricalAggregateScore_le_raw W q m hm H L hH hL ω _ = c * aggregateScore W universalH L lambda ω := by dsimp [c, lambda] ring _ = c ^ 2 * aggregateScore W universalH L lambda ω ^ 2 := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.independent_poisson_empiricalAggregateScore_sq_integrable_four · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:362
theorem pilotCell_badScore_sq_integral_le

The four paper pilot coordinates have an exponentially small squared aggregate score on failure of the good-pilot rectangle. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
j :
Fin d
hn :
1 ≤ n
hd :
1 ≤ d
m :
(n : ℝ) / 8 (: ℝ)
mNN :
toNNReal m (: ℝ≥0)
q :
fun i => toNNReal (cellVector P j (CellFourEquiv.symm i)) (: Fin 4 → ℝ≥0)
μ :
poissonTableLaw (fun i => mNN * q i)
(∫ p : Fin 4 → ℕ, (if (∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) then 0 else (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) ∂μ)
≤ (pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2
Proof (Lean source)
-- @node: pilotCell_badScore_sq_integral_le lemma pilotCell_badScore_sq_integral_le {n d : ℕ} (P : DiscreteLaw d) (j : Fin d) (hn : 1 ≤ n) (hd : 1 ≤ d) : let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) (∫ p : Fin 4 → ℕ, (if (∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) then 0 else (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) ∂μ) ≤ (pilotRadiusConstant / universalH) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * badPilotCellScale (n := n) P j ^ 2 := by classical dsimp only let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i have hm : 0 < m := by dsimp [m]; positivity have hmcoe : (mNN : ℝ) = m := Real.coe_toNNReal m hm.le have hq (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hqcoe (i : Fin 4) : (q i : ℝ) = cellVector P j (CellFourEquiv.symm i) := by dsimp [q] exact max_eq_left (hq _) have hmoment := pilotCell_empiricalBadScore_moment P j hn hd (t := 2) (inr (inl rfl)) have hscore (p : Fin 4 → ℕ) : empiricalAggregateScore W pilotRadiusConstant (logAlphabet d) mNN q p = ∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z) := by unfold empiricalAggregateScore calc _ = ∑ i : Fin 4, (|pilotCenter m (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i) - cellVector P j (CellFourEquiv.symm i)| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)) := by apply Finset.sum_congr rfl intro i _ rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)] simp only [W, normalizedDeviation, hmcoe, hqcoe, mNN, Equiv.apply_symm_apply, pilotCenter] _ = _ := Equiv.sum_comp CellFourEquiv.symm (fun z : Cell => |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z) have hbad (p : Fin 4 → ℕ) : p ∈ empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q ↔ ¬(∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) := by unfold empiricalBadAny constructor · rintro ⟨i, hi⟩ hgood let z := CellFourEquiv.symm i have hz := hgood z rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) z] at hz simp only [W, normalizedDeviation, hmcoe, hqcoe, z, Equiv.apply_symm_apply, pilotCenter] at hi hz linarith · intro hgood push_neg at hgood obtain ⟨z, hz⟩ := hgood refine ⟨CellFourEquiv z, ?_⟩ rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) z] at hz simpa only [W, normalizedDeviation, hmcoe, hqcoe, Equiv.symm_apply_apply, pilotCenter] using hz calc _ = ∫ p, (empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q).indicator (fun p => (empiricalAggregateScore W pilotRadiusConstant (logAlphabet d) mNN q p) ^ 2) p ∂μ := by apply integral_congr_ae exact Filter.Eventually.of_forall fun p => by change (if (∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) then 0 else (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) = _ by_cases hg : ∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4 · have hb : p ∉ empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q := fun hp => (hbad p).1 hp hg rw [if_pos hg, Set.indicator_of_notMem hb] · have hb : p ∈ empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q := (hbad p).2 hg rw [if_neg hg, Set.indicator_of_mem hb, hscore] _ ≤ _ := by simpa [m, mNN, q, μ, W] using hmoment
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotCell_badScore_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:430
theorem pilotCell_badScore_sq_integrable Lemma pilotCell_badScore_sq_integrable in the paper ↗

The paper's squared four-coordinate bad score is integrable under its one-cell product Poisson law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
j :
Fin d
hn :
1 ≤ n
hd :
1 ≤ d
m :
(n : ℝ) / 8 (: ℝ)
mNN :
toNNReal m (: ℝ≥0)
q :
fun i => toNNReal (cellVector P j (CellFourEquiv.symm i)) (: Fin 4 → ℝ≥0)
μ :
poissonTableLaw (fun i => mNN * q i)
Integrable (fun p : Fin 4 → ℕ => if (∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) then 0 else (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) μ
Proof (Lean source)
-- @node: pilotCell_badScore_sq_integrable lemma pilotCell_badScore_sq_integrable {n d : ℕ} (P : DiscreteLaw d) (j : Fin d) (hn : 1 ≤ n) (hd : 1 ≤ d) : let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) Integrable (fun p : Fin 4 → ℕ => if (∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) then 0 else (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) μ := by classical dsimp only let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i have hm : 0 < m := by dsimp [m]; positivity have hmNN : 0 < mNN := Real.toNNReal_pos.mpr hm have hmcoe : (mNN : ℝ) = m := Real.coe_toNNReal m hm.le have hq (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hqcoe (i : Fin 4) : (q i : ℝ) = cellVector P j (CellFourEquiv.symm i) := by dsimp [q] exact max_eq_left (hq _) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw]; infer_instance have hbase := independent_poisson_empiricalBadScore_sq_integrable_four μ W q mNN hmNN (fun _ => measurable_pi_apply _) (fun i => by simpa [W, μ] using poissonTable_eval_coordinate_law (fun i => mNN * q i) i) pilotRadiusConstant (logAlphabet d) (by unfold pilotRadiusConstant universalH; norm_num) (by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR]) apply hbase.congr filter_upwards [] with p have hscore : empiricalAggregateScore W pilotRadiusConstant (logAlphabet d) mNN q p = ∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z) := by unfold empiricalAggregateScore calc _ = ∑ i : Fin 4, (|pilotCenter m (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i) - cellVector P j (CellFourEquiv.symm i)| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)) := by apply Finset.sum_congr rfl intro i _ rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)] simp only [W, normalizedDeviation, hmcoe, hqcoe, mNN, Equiv.apply_symm_apply, pilotCenter] _ = _ := Equiv.sum_comp CellFourEquiv.symm (fun z : Cell => |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z) have hbad : p ∈ empiricalBadAny W pilotRadiusConstant (logAlphabet d) mNN q ↔ ¬(∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4) := by unfold empiricalBadAny constructor · rintro ⟨i, hi⟩ hgood have hz := hgood (CellFourEquiv.symm i) rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)] at hz simp only [W, normalizedDeviation, hmcoe, hqcoe, Equiv.apply_symm_apply, pilotCenter] at hi hz linarith · push Not rintro ⟨z, hz⟩ refine ⟨CellFourEquiv z, ?_⟩ rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) z] at hz simpa only [W, normalizedDeviation, hmcoe, hqcoe, Equiv.symm_apply_apply, pilotCenter] using hz by_cases hg : ∀ z : Cell, |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| ≤ pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z / 4 · rw [if_pos hg, Set.indicator_of_notMem (fun hp => (hbad.mp hp) hg)] · rw [if_neg hg, Set.indicator_of_mem (hbad.mpr hg), hscore]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotCell_badScore_sq_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:539
theorem pilotCell_score_sq_integrable Lemma pilotCell_score_sq_integrable in the paper ↗

The unrestricted squared four-coordinate pilot score has a finite moment under its one-cell product Poisson law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
j :
Fin d
hn :
1 ≤ n
hd :
1 ≤ d
m :
(n : ℝ) / 8 (: ℝ)
mNN :
toNNReal m (: ℝ≥0)
q :
fun i => toNNReal (cellVector P j (CellFourEquiv.symm i)) (: Fin 4 → ℝ≥0)
μ :
poissonTableLaw (fun i => mNN * q i)
Integrable (fun p : Fin 4 → ℕ => (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) μ
Proof (Lean source)
-- @node: pilotCell_score_sq_integrable lemma pilotCell_score_sq_integrable {n d : ℕ} (P : DiscreteLaw d) (j : Fin d) (hn : 1 ≤ n) (hd : 1 ≤ d) : let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) Integrable (fun p : Fin 4 → ℕ => (∑ z : Cell, (|pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)) ^ 2) μ := by classical dsimp only let m : ℝ := (n : ℝ) / 8 let mNN : ℝ≥0 := Real.toNNReal m let q : Fin 4 → ℝ≥0 := fun i => Real.toNNReal (cellVector P j (CellFourEquiv.symm i)) let μ := poissonTableLaw (fun i => mNN * q i) let W : Fin 4 → (Fin 4 → ℕ) → ℕ := fun i p => p i have hm : 0 < m := by dsimp [m]; positivity have hmNN : 0 < mNN := Real.toNNReal_pos.mpr hm have hmcoe : (mNN : ℝ) = m := Real.coe_toNNReal m hm.le have hq (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hqcoe (i : Fin 4) : (q i : ℝ) = cellVector P j (CellFourEquiv.symm i) := by dsimp [q] exact max_eq_left (hq _) letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw]; infer_instance have hbase := independent_poisson_empiricalAggregateScore_sq_integrable_four μ W q mNN hmNN (fun _ => measurable_pi_apply _) (fun i => by simpa [W, μ] using poissonTable_eval_coordinate_law (fun i => mNN * q i) i) pilotRadiusConstant (logAlphabet d) (by unfold pilotRadiusConstant universalH; norm_num) (by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdR]) apply hbase.congr filter_upwards [] with p congr 1 unfold empiricalAggregateScore calc _ = ∑ i : Fin 4, (|pilotCenter m (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i) - cellVector P j (CellFourEquiv.symm i)| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)) := by apply Finset.sum_congr rfl intro i _ rw [pilotHalfWidth_eq_empiricalRadius hm d (fun z => p (CellFourEquiv z)) (CellFourEquiv.symm i)] simp only [W, normalizedDeviation, hmcoe, hqcoe, mNN, Equiv.apply_symm_apply, pilotCenter] _ = _ := Equiv.sum_comp CellFourEquiv.symm (fun z : Cell => |pilotCenter m (fun z => p (CellFourEquiv z)) z - cellVector P j z| + pilotHalfWidth m d (fun z => p (CellFourEquiv z)) z)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotCell_score_sq_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/BadPilotMoment.lean:637
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.CapCoupling 9 declarations Finite auxiliary weights and the capped marked-count coupling interface.

Finite auxiliary weights and the capped marked-count coupling interface.

def FiniteCapAuxState

The finite nonoverflow auxiliary experiment, augmented by one atom for Poisson overflow.

Definition (Lean source)
n :
ℕ
FiniteCapAuxState n :
Type
Option (Fin (n + 1) × Perm (Fin n) × (Fin n → Bool))
CausalSmith.Stat.DiscreteBudgetvalueCurve.FiniteCapAuxState · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:16

Auxiliary weight, with the missing Poisson tail assigned to the overflow atom.

Definition (Lean source)
n :
ℕ
finiteCapAuxWeight n :
clause 1
| none => (poissonMeasure ((n : ℝ≥0) / 4)).real (Ioi n)
clause 2
| some a => auxiliaryWeight n a.1
CausalSmith.Stat.DiscreteBudgetvalueCurve.finiteCapAuxWeight · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:21
theorem finiteCapAuxWeight_nonneg

Every augmented finite auxiliary weight is nonnegative. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n :
ℕ
Proof (Lean source)
-- @node: finiteCapAuxWeight_nonneg lemma finiteCapAuxWeight_nonneg (n : ℕ) (a : FiniteCapAuxState n) : 0 ≤ finiteCapAuxWeight n a := by cases a with | none => exact measureReal_nonneg | some a => unfold finiteCapAuxWeight auxiliaryWeight positivity
CausalSmith.Stat.DiscreteBudgetvalueCurve.finiteCapAuxWeight_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:28
theorem finiteCapAuxWeight_sum

The overflow atom completes the subprobability cap weights to a finite probability vector. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n :
ℕ
Proof (Lean source)
-- @node: finiteCapAuxWeight_sum lemma finiteCapAuxWeight_sum (n : ℕ) : ∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a = 1 := by let μ := poissonMeasure ((n : ℝ≥0) / 4) have hcap : ∑ M ∈ range (n + 1), μ.real {M} = μ.real (Set.Iic n) := by rw [MeasureTheory.sum_measureReal_singleton] congr 1 ext M simp have htail : μ.real (Ioi n) = 1 - μ.real (Set.Iic n) := by have hc : (Set.Iic n : Set ℕ)ᶜ = Ioi n := by ext M; simp rw [← hc, MeasureTheory.measureReal_compl measurableSet_Iic] simp [μ] rw [Fintype.sum_option] simp only [finiteCapAuxWeight] simp_rw [Fintype.sum_prod_type] have hcards : (0 : ℝ) < card (Perm (Fin n)) * card (Fin n → Bool) := by positivity have hfinite : (∑ M : Fin (n + 1), ∑ _perm : Perm (Fin n), ∑ _marks : Fin n → Bool, auxiliaryWeight n M) = ∑ M ∈ range (n + 1), μ.real {M} := by rw [← Fin.sum_univ_eq_sum_range] apply Finset.sum_congr rfl intro M _ simp [auxiliaryWeight, μ, measureReal_def] field_simp rw [hfinite, hcap, htail] have hle : μ.real (Set.Iic n) ≤ 1 := by simpa [μ] using measureReal_le_measureReal_univ (μ := μ) (Set.subset_univ _) linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.finiteCapAuxWeight_sum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:38
def permutedMarkedCountTable

The paired table read from one nonoverflow auxiliary draw.

Definition (Lean source)
n d :
ℕ
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
permutedMarkedCountTable sample perm M marks :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
((fun j zeta => markedCellCount sample perm M marks false j zeta), fun j zeta => markedCellCount sample perm M marks true j zeta)
CausalSmith.Stat.DiscreteBudgetvalueCurve.permutedMarkedCountTable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:73
theorem permutedMarkedCountTable_eq_uncapped_prefix

On the cap event, the paper's permuted marked table is the table component of the established uncapped finite-Poisson prefix construction. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
hM :
M ≤ n
permutedMarkedCountTable sample perm M marks
= (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap (prefixOfLE (fun i => (sample (perm i), marks i)) M hM)).2
Proof (Lean source)
-- @node: permutedMarkedCountTable_eq_uncapped_prefix lemma permutedMarkedCountTable_eq_uncapped_prefix {n d : ℕ} (sample : Fin n → Obs d) (perm : Perm (Fin n)) (M : ℕ) (marks : Fin n → Bool) (hM : M ≤ n) : permutedMarkedCountTable sample perm M marks = (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap (prefixOfLE (fun i => (sample (perm i), marks i)) M hM)).2 := by symm simpa [permutedMarkedCountTable, markedCellCount, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.markedCellCount] using CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap_prefix_table (fun i => sample (perm i)) marks M hM
CausalSmith.Stat.DiscreteBudgetvalueCurve.permutedMarkedCountTable_eq_uncapped_prefix · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:81
theorem uncappedMarkedCountLaw_table_eq_idealCountLaw Lemma uncappedMarkedCountLaw_table_eq_idealCountLaw in the paper ↗

The established uncapped marked finite-Poisson experiment has exactly the ideal paired table law used in this paper. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
Measure.map snd (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw n P)
= idealCountLaw (n := n) P
Proof (Lean source)
-- @node: uncappedMarkedCountLaw_table_eq_idealCountLaw lemma uncappedMarkedCountLaw_table_eq_idealCountLaw {n d : ℕ} (P : DiscreteLaw d) : Measure.map snd (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw n P) = CausalSmith.Stat.DiscreteBudgetvalueCurve.idealCountLaw (n := n) P := by rw [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw_table] unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotEvaluationTableLaw unfold CausalSmith.Stat.DiscreteBudgetvalueCurve.idealCountLaw have hpool : Measure.pi (fun x : Fin d => Measure.pi (fun j : Cell => poissonMeasure (((n : ℝ) / 8 * jointMass P x (finTwoEquiv j.1) (finTwoEquiv j.2)).toNNReal))) = Measure.pi (fun j : Fin d => Measure.pi (fun zeta : Cell => poissonMeasure ⟨max 0 (((n : ℝ) / 8) * cellVector P j zeta), le_max_left 0 _⟩)) := by congr 1 funext j congr 1 funext zeta congr 1 apply NNReal.eq change max (((n : ℝ) / 8) * jointMass P j (finTwoEquiv zeta.1) (finTwoEquiv zeta.2)) 0 = max 0 (((n : ℝ) / 8) * cellVector P j zeta) rw [max_comm] rfl exact congrArg (fun μ => μ.prod μ) hpool
CausalSmith.Stat.DiscreteBudgetvalueCurve.uncappedMarkedCountLaw_table_eq_idealCountLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:97
theorem fairBoolLaw_eq_uncappedFairMarkLaw Lemma fairBoolLaw_eq_uncappedFairMarkLaw in the paper ↗

The paper's fair marking law is the fair Boolean law used by the capped prefix theorem. The stated relationship holds.

Formal statement
= CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedFairMarkLaw
Proof (Lean source)
-- @node: fairBoolLaw_eq_uncappedFairMarkLaw lemma fairBoolLaw_eq_uncappedFairMarkLaw : fairBoolLaw = CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedFairMarkLaw := by apply Measure.ext_of_singleton intro b cases b <;> simp [fairBoolLaw, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedFairMarkLaw, smul_eq_mul]
CausalSmith.Stat.DiscreteBudgetvalueCurve.fairBoolLaw_eq_uncappedFairMarkLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:128
theorem CappedMarkedCountIntegralIdentity

The finite auxiliary mixture in auxiliaryAverage equals the nonoverflow part of the established uncapped marked Poisson experiment. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
g :
((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → ℝ
Integrable g (idealCountLaw (n := n) P)
(∫ sample : Fin n → Obs d, ∑ M ∈ range (n + 1), ∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, auxiliaryWeight n M * g (permutedMarkedCountTable sample perm M marks) ∂productLaw P n)
= ∫ z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d, if z.1 ≤ n then g z.2 else 0 ∂CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw n P
Proof (Lean source)
-- @node: CappedMarkedCountIntegralIdentity lemma CappedMarkedCountIntegralIdentity {n d : ℕ} (P : DiscreteLaw d) : ∀ g : ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → ℝ, Integrable g (idealCountLaw (n := n) P) → (∫ sample : Fin n → Obs d, ∑ M ∈ range (n + 1), ∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, auxiliaryWeight n M * g (permutedMarkedCountTable sample perm M marks) ∂productLaw P n) = ∫ z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d, if z.1 ≤ n then g z.2 else 0 ∂CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw n P := by classical intro g hg let tableMap := fun s : FiniteSample (Obs d × Bool) => (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap s).2 let μ := finitePoissonSampleLaw ((CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.obsLaw P).prod fairBoolLaw) ((n : ℝ≥0) / 4) have hmean : toNNReal ((n : ℝ) / 4) = (n : ℝ≥0) / 4 := by apply NNReal.eq rw [Real.coe_toNNReal ((n : ℝ) / 4) (by positivity)] norm_num have hμ : μ = finitePoissonSampleLaw ((CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.obsLaw P).prod CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedFairMarkLaw) (toNNReal ((n : ℝ) / 4)) := by simp only [μ, hmean, fairBoolLaw_eq_uncappedFairMarkLaw] have htable : Measure.map tableMap μ = idealCountLaw (n := n) P := by rw [← uncappedMarkedCountLaw_table_eq_idealCountLaw (n := n) P] unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw rw [Measure.map_map measurable_snd CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_uncappedMarkedCountMap] rw [hμ] rfl have htable_meas : Measurable tableMap := CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_uncappedMarkedCountMap.snd have hG : Integrable (g ∘ tableMap) μ := by apply (integrable_map_measure (by simpa [htable] using hg.aestronglyMeasurable) htable_meas.aemeasurable).mp simpa [htable] using hg have hcap := capped_marked_prefix_integral (CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.obsLaw P) ((n : ℝ≥0) / 4) n (g ∘ tableMap) hG have hprefix (sample : Fin n → Obs d) (M : Fin (n + 1)) (perm : Perm (Fin n)) (marks : Fin n → Bool) : (g ∘ tableMap) (prefixOfLE (fun i => (sample (perm i), marks i)) M.val (le_of_lt_succ M.isLt)) = g (permutedMarkedCountTable sample perm M.val marks) := by dsimp only [Function.comp_apply, tableMap] rw [ permutedMarkedCountTable_eq_uncapped_prefix sample perm M.val marks (le_of_lt_succ M.isLt)] simp_rw [hprefix] at hcap have hset : MeasurableSet {s : FiniteSample (Obs d × Bool) | s.count ≤ n} := Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.measurable_finiteSample_count measurableSet_Iic have hif_meas : AEStronglyMeasurable (fun s => if s.count ≤ n then (g ∘ tableMap) s else 0) μ := by have hind := hG.aestronglyMeasurable.indicator hset convert hind using 1 funext s by_cases hs : s.count ≤ n <;> simp [indicator, hs] calc _ = ∫ sample : Fin n → Obs d, ∑ M : Fin (n + 1), ∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, ((poissonMeasure ((n : ℝ≥0) / 4)) {M.val}).toReal / ((card (Perm (Fin n)) : ℝ) * (card (Fin n → Bool) : ℝ)) * g (permutedMarkedCountTable sample perm M.val marks) ∂Measure.pi (fun _ : Fin n => CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.obsLaw P) := by congr 1 funext sample simpa only [auxiliaryWeight] using (Fin.sum_univ_eq_sum_range (n := n + 1) (fun M => ∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, ((poissonMeasure ((n : ℝ≥0) / 4)) {M}).toReal / ((card (Perm (Fin n)) : ℝ) * (card (Fin n → Bool) : ℝ)) * g (permutedMarkedCountTable sample perm M marks))).symm _ = ∫ s, if s.count ≤ n then (g ∘ tableMap) s else 0 ∂μ := hcap _ = _ := by unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw have hread := CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_uncappedMarkedCountMap (d := d) rw [← hμ, integral_map hread.aemeasurable (Measurable.of_discrete.aestronglyMeasurable : AEStronglyMeasurable (fun z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d => if z.1 ≤ n then g z.2 else 0) (Measure.map CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap μ))] rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.CappedMarkedCountIntegralIdentity · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapCoupling.lean:141
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.CapTransfer 19 declarations Capped, conditional-averaged threshold-process risk.

Capped, conditional-averaged threshold-process risk.

The true dual curve, restricted to the shadow-price interval, is a continuous Path.

Definition (Lean source)
d :
ℕ
epsilon :
ℝ
P :
dualProcessPath epsilon P :
by let G : Path := ∑ j : Fin d, ⟨fun t : Time
=> thresholdFunReal epsilon t.1 (cellVector P j), thresholdFunReal_continuous_time epsilon (cellVector P j)⟩ refine ⟨fun t : Time => dualProcessReal epsilon P t.1, G.continuous.congr ?_⟩ intro t simp [G, dualProcessReal, dualProcess, thresholdFunReal, t.2]
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualProcessPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:19

On a nonnegative four-vector, each arm value lies between zero and the total mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
u :
Cell → ℝ
hu :
∀ z, 0 ≤ u z
a :
Fin 2
conclusion 1
0 ≤ armValue epsilon a u
conclusion 2
armValue epsilon a u ≤ totalMass u
Proof (Lean source)
-- @node: armValue_mem_totalMass lemma armValue_mem_totalMass {epsilon : ℝ} (he : 0 < epsilon) (u : Cell → ℝ) (hu : ∀ z, 0 ≤ u z) (a : Fin 2) : 0 ≤ armValue epsilon a u ∧ armValue epsilon a u ≤ totalMass u := by have harm0 : 0 ≤ armMassFn a u := by unfold armMassFn exact add_nonneg (hu _) (hu _) have htotal0 : 0 ≤ totalMass u := by unfold totalMass armMassFn exact add_nonneg (add_nonneg (hu _) (hu _)) (add_nonneg (hu _) (hu _)) have hsuccess : u (a, 1) ≤ armMassFn a u := by unfold armMassFn linarith [hu (a, 0)] let D := max (armMassFn a u) (epsilon * totalMass u) have hD0 : 0 ≤ D := le_trans harm0 (le_max_left _ _) by_cases hD : D = 0 · have hs0 : u (a, 1) = 0 := by have : armMassFn a u = 0 := le_antisymm (le_trans (le_max_left _ _) (le_of_eq hD)) harm0 linarith [hu (a, 1)] simp [armValue, D, hD, hs0, htotal0] · have hDpos : 0 < D := lt_of_le_of_ne hD0 (Ne.symm hD) have hfrac0 : 0 ≤ u (a, 1) / D := div_nonneg (hu _) hD0 have hfrac1 : u (a, 1) / D ≤ 1 := by rw [div_le_one hDpos] exact hsuccess.trans (le_max_left _ _) unfold armValue change 0 ≤ totalMass u * u (a, 1) / D ∧ totalMass u * u (a, 1) / D ≤ totalMass u constructor · exact div_nonneg (mul_nonneg htotal0 (hu _)) hD0 · rw [mul_div_assoc] nlinarith [mul_le_mul_of_nonneg_left hfrac1 htotal0]
CausalSmith.Stat.DiscreteBudgetvalueCurve.armValue_mem_totalMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:31
theorem dualProcessReal_mem_unit Lemma dualProcessReal_mem_unit in the paper ↗

The true dual threshold lies between zero and one after summing the cell masses of a discrete law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon lambda :
ℝ
he :
0 < epsilon
P :
hlambda :
lambda ∈ Icc (0 : ℝ) 1
conclusion 1
0 ≤ dualProcessReal epsilon P lambda
conclusion 2
dualProcessReal epsilon P lambda ≤ 1
Proof (Lean source)
-- @node: dualProcessReal_mem_unit lemma dualProcessReal_mem_unit {d : ℕ} {epsilon lambda : ℝ} (he : 0 < epsilon) (P : DiscreteLaw d) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : 0 ≤ dualProcessReal epsilon P lambda ∧ dualProcessReal epsilon P lambda ≤ 1 := by have hq (j : Fin d) (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hthreshold (j : Fin d) : 0 ≤ thresholdFun epsilon ⟨lambda, hlambda⟩ (cellVector P j) ∧ thresholdFun epsilon ⟨lambda, hlambda⟩ (cellVector P j) ≤ totalMass (cellVector P j) := by obtain ⟨hg0, hg0le⟩ := armValue_mem_totalMass he _ (hq j) 0 obtain ⟨hg1, hg1le⟩ := armValue_mem_totalMass he _ (hq j) 1 unfold thresholdFun constructor · positivity · rw [add_max] apply max_le · simpa using hg0le · have hmass0 : 0 ≤ totalMass (cellVector P j) := by unfold totalMass armMassFn exact add_nonneg (add_nonneg (hq j _) (hq j _)) (add_nonneg (hq j _) (hq j _)) calc armValue epsilon 0 (cellVector P j) + (armValue epsilon 1 (cellVector P j) - armValue epsilon 0 (cellVector P j) - lambda * totalMass (cellVector P j)) = armValue epsilon 1 (cellVector P j) - lambda * totalMass (cellVector P j) := by ring _ ≤ totalMass (cellVector P j) := by nlinarith [mul_nonneg hlambda.1 hmass0] have hmass : ∑ j : Fin d, totalMass (cellVector P j) = 1 := by have hcell (j : Fin d) : totalMass (cellVector P j) = cellMass P j := by simp [totalMass, armMassFn, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring simpa only [hcell] using discreteLaw_sum_cellMass P simp only [dualProcessReal, dif_pos hlambda, dualProcess] constructor · exact Finset.sum_nonneg fun j _ => (hthreshold j).1 · calc _ ≤ ∑ j : Fin d, totalMass (cellVector P j) := Finset.sum_le_sum fun j _ => (hthreshold j).2 _ = 1 := hmass
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualProcessReal_mem_unit · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:68
theorem dualProcessPath_norm_le_one

The true dual target Path has unit supremum norm. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
P :
‖dualProcessPath epsilon P‖ ≤ 1
Proof (Lean source)
-- @node: dualProcessPath_norm_le_one lemma dualProcessPath_norm_le_one {d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (P : DiscreteLaw d) : ‖dualProcessPath epsilon P‖ ≤ 1 := by apply (ContinuousMap.norm_le _ (by norm_num)).2 intro t change |dualProcessReal epsilon P t.1| ≤ 1 rw [abs_le] exact ⟨by linarith [(dualProcessReal_mem_unit he P t.2).1], (dualProcessReal_mem_unit he P t.2).2⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualProcessPath_norm_le_one · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:122
def auxiliaryThresholdPath

One auxiliary Jackson estimate, restricted to the shadow-price interval, as a continuous path.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
auxiliaryThresholdPath epsilon he hn hd sample perm M marks :
by refine ⟨fun t
=> auxiliaryThresholdProcess epsilon sample perm M marks t.1, ?_⟩ unfold auxiliaryThresholdProcess apply continuous_finsetSum intro j _ apply jacksonCellStatistic_continuous_time intro lambda apply pilotRectangle_threshold_pullback_continuousOn he · have hn' : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) positivity · exact hd
CausalSmith.Stat.DiscreteBudgetvalueCurve.auxiliaryThresholdPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:134

The ideal Jackson estimate is a continuous path for every count table.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
idealThresholdPath epsilon he hn hd counts :
by refine ⟨fun t
=> ∑ j : Fin d, jacksonCellStatistic epsilon t.1 ((n : ℝ) / 8) d (counts.1 j) (counts.2 j), ?_⟩ apply continuous_finsetSum intro j _ apply jacksonCellStatistic_continuous_time intro lambda apply pilotRectangle_threshold_pullback_continuousOn he · have hn' : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) positivity · exact hd
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealThresholdPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:152
theorem poissonQuarterCapTail_le_paperRemainder Lemma poissonQuarterCapTail_le_paperRemainder in the paper ↗

The promoted quarter-mean Poisson cap estimate implies the weaker exponential remainder used in equation (37) of the paper. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n :
ℕ
((poissonMeasure ((n : ℝ≥0) / 4)) (Ioi n)).toReal ≤ exp (-(n : ℝ) / 16)
Proof (Lean source)
-- @node: poissonQuarterCapTail_le_paperRemainder lemma poissonQuarterCapTail_le_paperRemainder (n : ℕ) : ((poissonMeasure ((n : ℝ≥0) / 4)) (Ioi n)).toReal ≤ exp (-(n : ℝ) / 16) := by have htail := poisson_quarter_mean_cap_tail n have hreal : ((poissonMeasure ((n : ℝ≥0) / 4)) (Ioi n)).toReal ≤ exp (-(n : ℝ) / 2) := by exact (ENNReal.le_ofReal_iff_toReal_le (measure_ne_top _ _) (Real.exp_nonneg _)).mp htail exact hreal.trans (Real.exp_le_exp.mpr (by have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg _ linarith))
CausalSmith.Stat.DiscreteBudgetvalueCurve.poissonQuarterCapTail_le_paperRemainder · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:169
def idealErrorProcess

The uncapped shadow-price process in the ideal Poisson experiment.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
lambda :
ℝ
idealErrorProcess epsilon P counts lambda :
ℝ
∑ j : Fin d, (jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j) - thresholdFunReal epsilon lambda (cellVector P j))
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealErrorProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:185
theorem idealThresholdPath_error_norm_eq

The ideal path error has exactly the paper's scalar supremum loss. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
‖idealThresholdPath epsilon he hn hd counts - dualProcessPath epsilon P‖
= sSup ((fun lambda : ℝ => |idealErrorProcess (n := n) epsilon P counts lambda|) '' Icc 0 1)
Proof (Lean source)
-- @node: idealThresholdPath_error_norm_eq lemma idealThresholdPath_error_norm_eq {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) : ‖idealThresholdPath epsilon he hn hd counts - dualProcessPath epsilon P‖ = sSup ((fun lambda : ℝ => |idealErrorProcess (n := n) epsilon P counts lambda|) '' Icc 0 1) := by rw [← path_norm_eq_sSup_abs_restrict (fun lambda => idealErrorProcess (n := n) epsilon P counts lambda)] · congr 1 apply ContinuousMap.ext intro t simp [idealThresholdPath, dualProcessPath, idealErrorProcess, dualProcessReal, dualProcess, thresholdFunReal, t.2] · apply ((idealThresholdPath epsilon he hn hd counts).continuous.sub (dualProcessPath epsilon P).continuous).congr intro t simp [idealThresholdPath, dualProcessPath, idealErrorProcess, dualProcessReal, dualProcess, thresholdFunReal, t.2]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealThresholdPath_error_norm_eq · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:195
theorem idealProcessRisk_integrand_integrable Lemma idealProcessRisk_integrand_integrable in the paper ↗

The squared supremum loss of the full uncapped ideal process is integrable for every discrete law; this coarse fact uses no overlap assumption. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
Integrable (fun counts => sSup ((fun lambda : ℝ => |idealErrorProcess (n := n) epsilon P counts lambda|) '' Icc 0 1) ^ 2) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealProcessRisk_integrand_integrable lemma idealProcessRisk_integrand_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) : Integrable (fun counts => sSup ((fun lambda : ℝ => |idealErrorProcess (n := n) epsilon P counts lambda|) '' Icc 0 1) ^ 2) (idealCountLaw (n := n) P) := by classical let cellSup := fun counts (j : Fin d) => sSup ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) let envelope := fun counts => (d : ℝ) * ∑ j : Fin d, cellSup counts j ^ 2 have henv : Integrable envelope (idealCountLaw (n := n) P) := by dsimp [envelope] apply Integrable.const_mul apply integrable_finsetSum intro j _ simpa [cellSup] using idealClippedCell_error_sSup_sq_integrable epsilon he hn hd P j apply henv.mono' (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with counts rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hcellBdd (j : Fin d) : BddAbove ((fun lambda : ℝ => |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)|) '' Icc 0 1) := by refine ⟨((3 * (1 + epsilon⁻¹) + 1) + (d : ℝ) ^ (1 / 4 : ℝ)) * ∑ z : Cell, (|pilotCenter ((n : ℝ) / 8) (counts.1 j) z - cellVector P j z| + pilotHalfWidth ((n : ℝ) / 8) d (counts.1 j) z), ?_⟩ rintro y ⟨lambda, hlambda, rfl⟩ exact idealClippedCell_error_le_badScore he hn hd P counts j lambda hlambda have hcell0 (j : Fin d) : 0 ≤ cellSup counts j := by dsimp [cellSup] exact le_trans (abs_nonneg _) (le_csSup (hcellBdd j) ⟨0, by simp, rfl⟩) have hcellPoint (j : Fin d) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : |idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)| ≤ cellSup counts j := by exact le_csSup (hcellBdd j) ⟨lambda, hlambda, rfl⟩ let totalSet := (fun lambda : ℝ => |idealErrorProcess (n := n) epsilon P counts lambda|) '' Icc 0 1 have htotalPoint (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : |idealErrorProcess (n := n) epsilon P counts lambda| ≤ ∑ j : Fin d, cellSup counts j := by unfold idealErrorProcess calc |∑ j : Fin d, (jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j) - thresholdFunReal epsilon lambda (cellVector P j))| ≤ ∑ j : Fin d, |jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j) - thresholdFunReal epsilon lambda (cellVector P j)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j : Fin d, cellSup counts j := by apply Finset.sum_le_sum intro j _ simpa [idealClippedCellPath] using hcellPoint j lambda hlambda have htotalBdd : BddAbove totalSet := by refine ⟨∑ j : Fin d, cellSup counts j, ?_⟩ rintro y ⟨lambda, hlambda, rfl⟩ exact htotalPoint lambda hlambda have htotal0 : 0 ≤ sSup totalSet := le_trans (abs_nonneg _) (le_csSup htotalBdd ⟨0, by simp, rfl⟩) have htotal : sSup totalSet ≤ ∑ j : Fin d, cellSup counts j := csSup_le ⟨|idealErrorProcess (n := n) epsilon P counts 0|, ⟨0, by simp, rfl⟩⟩ (by rintro y ⟨lambda, hlambda, rfl⟩ exact htotalPoint lambda hlambda) have hsum0 : 0 ≤ ∑ j : Fin d, cellSup counts j := Finset.sum_nonneg fun j _ => hcell0 j have hsq : (sSup totalSet) ^ 2 ≤ (∑ j : Fin d, cellSup counts j) ^ 2 := pow_le_pow_left₀ htotal0 htotal 2 have hcs : (∑ j : Fin d, cellSup counts j) ^ 2 ≤ (d : ℝ) * ∑ j : Fin d, cellSup counts j ^ 2 := by simpa using pow_sum_le_card_mul_sum_pow (s := (Finset.univ : Finset (Fin d))) (f := fun j => cellSup counts j) (fun j _ => hcell0 j) 1 dsimp [envelope] exact (by simpa [totalSet] using hsq.trans hcs)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealProcessRisk_integrand_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:218
theorem idealErrorProcess_good_add_bad Lemma idealErrorProcess_good_add_bad in the paper ↗

The good and bad pilot events partition the ideal cell error exactly. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
lambda :
ℝ
idealErrorProcess (n := n) epsilon P counts lambda
= idealPilotErrorPart (n := n) epsilon lambda P counts true
+ idealPilotErrorPart (n := n) epsilon lambda P counts false
Proof (Lean source)
-- @node: idealErrorProcess_good_add_bad lemma idealErrorProcess_good_add_bad {n d : ℕ} (epsilon : ℝ) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (lambda : ℝ) : idealErrorProcess (n := n) epsilon P counts lambda = idealPilotErrorPart (n := n) epsilon lambda P counts true + idealPilotErrorPart (n := n) epsilon lambda P counts false := by classical simp only [idealErrorProcess, idealPilotErrorPart, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j _ by_cases h : idealPilotGood (n := n) P counts j <;> simp [h]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealErrorProcess_good_add_bad · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:302
theorem jacksonDegree_exponential_budget

The structural Jackson degree leaves a fixed power of the alphabet to absorb the coefficient envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
hd :
16 ≤ d
exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d)
≤ exp 115 * (d : ℝ) ^ (1 / 16 : ℝ)
Proof (Lean source)
-- @node: jacksonDegree_exponential_budget lemma jacksonDegree_exponential_budget (d : ℕ) (hd : 16 ≤ d) : exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d) ≤ exp 115 * (d : ℝ) ^ (1 / 16 : ℝ) := by have hdpos : (0 : ℝ) < d := by exact_mod_cast (show 0 < d by omega) have hdge : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) have hL : logAlphabet d = 1 + log d := by unfold logAlphabet rw [Real.log_mul (by positivity : exp 1 ≠ 0) (ne_of_gt hdpos)] simp have hLge : 1 ≤ logAlphabet d := by rw [hL] have := Real.log_nonneg hdge linarith have hfloor : (⌊jacksonDegreeConstant * logAlphabet d⌋₊ : ℝ) ≤ logAlphabet d / 512 := by calc _ ≤ jacksonDegreeConstant * logAlphabet d := Nat.floor_le (by unfold jacksonDegreeConstant; positivity) _ = logAlphabet d / 512 := by unfold jacksonDegreeConstant; ring have hK : (jacksonDegree d : ℝ) ≤ 2 + logAlphabet d / 512 := by unfold jacksonDegree rw [Nat.cast_max] exact max_le (by linarith) (by linarith) have hKnonneg : (0 : ℝ) ≤ jacksonDegree d := Nat.cast_nonneg _ have hscale : 24 * (jacksonDegree d : ℝ) * logAlphabet d + 16 * (jacksonDegree d : ℝ) ^ 2 ≤ 114 * logAlphabet d + (logAlphabet d) ^ 2 / 16 := by have hprod := mul_nonneg (show 0 ≤ 2 + logAlphabet d / 512 - (jacksonDegree d : ℝ) by linarith) (show 0 ≤ 2 + logAlphabet d / 512 + (jacksonDegree d : ℝ) by positivity) nlinarith [sq_nonneg (logAlphabet d - 1)] have hbound : 24 * (jacksonDegree d : ℝ) + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d ≤ 114 + logAlphabet d / 16 := by have hLpos : 0 < logAlphabet d := by linarith calc _ = (24 * (jacksonDegree d : ℝ) * logAlphabet d + 16 * (jacksonDegree d : ℝ) ^ 2) / logAlphabet d := by field_simp _ ≤ (114 * logAlphabet d + (logAlphabet d) ^ 2 / 16) / logAlphabet d := by gcongr _ = _ := by field_simp have hexp : exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d) ≤ exp (115 + log d / 16) := by apply Real.exp_le_exp.mpr rw [hL] at hbound ⊢ linarith calc _ ≤ exp (115 + log d / 16) := hexp _ = exp 115 * (d : ℝ) ^ (1 / 16 : ℝ) := by rw [Real.exp_add, Real.rpow_def_of_pos hdpos] congr 1 ring_nf
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonDegree_exponential_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:317

Constants completing the common-polynomial handle. One constant works for all sample sizes, alphabets, observed laws, cells, and shadow prices.

Definition (Lean source)
epsilon :
ℝ
processHandle epsilon :
Set ℝ
{C | 0 < C ∧ ∀ (n d : ℕ) (P : DiscreteLaw d), 1 ≤ n → 16 ≤ d → (d : ℝ) / logAlphabet d ≤ n → (∀ pilot : Cell → ℕ, let m := (n : ℝ) / 8 let L := logAlphabet d let S := ∑ zeta : Cell, pilotRadius m d pilot zeta jacksonCoefficientBV epsilon m d pilot ≤ C * S * exp (12 * jacksonDegree d) ∧ S ^ 2 * exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / L) ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * S ^ 2) ∧ centeredIdealPilotErrorRisk (n := n) epsilon P true ≤ C * d / (((n : ℝ) / 8) * logAlphabet d) ∧ (∀ j : Fin d, ∀ lambda ∈ Icc (0 : ℝ) 1, uncappedJacksonCellBias (n := n) epsilon lambda P j ≤ C * (sqrt (cellMass P j / (((n : ℝ) / 8) * logAlphabet d)) + 1 / (((n : ℝ) / 8) * logAlphabet d))) ∧ (∀ j : Fin d, badPilotCellEnvelope (n := n) epsilon P j ≤ C * (d : ℝ) ^ (1 / 4 : ℝ) * exp (-10 * logAlphabet d) * badPilotCellScale (n := n) P j) ∧ centeredIdealPilotErrorRisk (n := n) epsilon P false ≤ C * d / (((n : ℝ) / 8) * logAlphabet d)}
CausalSmith.Stat.DiscreteBudgetvalueCurve.processHandle · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:377

Squared supremum error in the ideal, uncapped count experiment.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
idealProcessRisk epsilon P :
ℝ
∫ counts, (sSup ((fun lambda : ℝ => |idealErrorProcess (n := n) epsilon P counts lambda|) '' Icc 0 1)) ^ 2 ∂idealCountLaw (n := n) P
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealProcessRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:408

The expected squared continuum error of the deterministic averaged process.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
averagedProcessRisk epsilon P :
ℝ
∫ sample : Fin n → Obs d, (sSup ((fun lambda : ℝ => |averagedThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1)) ^ 2 ∂productLaw P n
CausalSmith.Stat.DiscreteBudgetvalueCurve.averagedProcessRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:417
def finiteCapEstimatePath

The finite auxiliary estimator path, with the overflow atom assigned the zero path exactly as in the capped construction.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
sample :
Fin n → Obs d
finiteCapEstimatePath epsilon he hn hd sample :
clause 1
| none => 0
clause 2
| some a => auxiliaryThresholdPath epsilon he hn hd sample a.2.1 a.1 a.2.2
CausalSmith.Stat.DiscreteBudgetvalueCurve.finiteCapEstimatePath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:426
theorem finiteCapEstimatePath_average_apply

The weighted finite auxiliary path evaluates to the deterministic averaged threshold process. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
sample :
Fin n → Obs d
t :
(∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a • finiteCapEstimatePath epsilon he hn hd sample a) t
= averagedThresholdProcess epsilon sample t.1
Proof (Lean source)
-- @node: finiteCapEstimatePath_average_apply lemma finiteCapEstimatePath_average_apply {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (sample : Fin n → Obs d) (t : Time) : (∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a • finiteCapEstimatePath epsilon he hn hd sample a) t = averagedThresholdProcess epsilon sample t.1 := by classical simp only [ContinuousMap.sum_apply, ContinuousMap.smul_apply, smul_eq_mul] change (∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * finiteCapEstimatePath epsilon he hn hd sample a t) = _ rw [Fintype.sum_option] simp only [finiteCapEstimatePath, ContinuousMap.zero_apply, mul_zero, zero_add] simp_rw [Fintype.sum_prod_type] unfold averagedThresholdProcess cappedThresholdProcess rw [← Fin.sum_univ_eq_sum_range] apply Finset.sum_congr rfl intro M _ simp only [finiteCapAuxWeight, auxiliaryWeight, auxiliaryThresholdPath] have hM : M.val ≤ n := le_of_lt_succ M.isLt simp only [if_pos hM] simp [auxiliaryThresholdPath] rw [show (poissonMeasure ((n : ℝ≥0) / 4) {M.val}).toReal * ((∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, auxiliaryThresholdProcess epsilon sample perm M.val marks t.1) / ((card (Perm (Fin n)) : ℝ) * (2 : ℝ) ^ n)) = ((poissonMeasure ((n : ℝ≥0) / 4) {M.val}).toReal / ((card (Perm (Fin n)) : ℝ) * (2 : ℝ) ^ n)) * (∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, auxiliaryThresholdProcess epsilon sample perm M.val marks t.1) by ring] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro perm _ rw [Finset.mul_sum]
CausalSmith.Stat.DiscreteBudgetvalueCurve.finiteCapEstimatePath_average_apply · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:435
theorem finiteCapErrorPath_average_apply

The finite auxiliary average of error paths is the averaged estimator error path pointwise. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
sample :
Fin n → Obs d
t :
(∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a • (finiteCapEstimatePath epsilon he hn hd sample a - dualProcessPath epsilon P)) t
= averagedThresholdProcess epsilon sample t.1 - dualProcessReal epsilon P t.1
Proof (Lean source)
-- @node: finiteCapErrorPath_average_apply lemma finiteCapErrorPath_average_apply {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (sample : Fin n → Obs d) (t : Time) : (∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a • (finiteCapEstimatePath epsilon he hn hd sample a - dualProcessPath epsilon P)) t = averagedThresholdProcess epsilon sample t.1 - dualProcessReal epsilon P t.1 := by classical have hest := finiteCapEstimatePath_average_apply epsilon he hn hd sample t simp only [ContinuousMap.sum_apply, ContinuousMap.smul_apply, ContinuousMap.sub_apply, smul_eq_mul] change (∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * (finiteCapEstimatePath epsilon he hn hd sample a t - dualProcessPath epsilon P t)) = _ simp_rw [mul_sub] rw [Finset.sum_sub_distrib, ← Finset.sum_mul, finiteCapAuxWeight_sum, one_mul] change (∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * finiteCapEstimatePath epsilon he hn hd sample a t) - _ = _ rw [show (∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * finiteCapEstimatePath epsilon he hn hd sample a t) = averagedThresholdProcess epsilon sample t.1 by simpa using hest] rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.finiteCapErrorPath_average_apply · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:476
theorem capTransferRisk

Transfer from ideal uncapped Poisson error to the capped, averaged fixed-sample estimator; the cap penalty is stated separately. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
1 ≤ n
16 ≤ d
P :
averagedProcessRisk (n := n) epsilon P
≤ C * (idealProcessRisk (n := n) epsilon P + exp (-(n : ℝ) / 16))
Proof (Lean source)
lemma capTransferRisk (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ n d : ℕ, 1 ≤ n → 16 ≤ d → ∀ P : DiscreteLaw d, averagedProcessRisk (n := n) epsilon P ≤ C * (idealProcessRisk (n := n) epsilon P + exp (-(n : ℝ) / 16)) := by classical refine ⟨1, zero_lt_one, ?_⟩ intro n d hn hd P have hd' : 1 ≤ d := by omega let F := dualProcessPath epsilon P let Z := fun sample : Fin n → Obs d => fun a : FiniteCapAuxState n => finiteCapEstimatePath epsilon he hn hd' sample a - F have hJensen := finite_conditional_path_risk_le (productLaw P n) (fun _ a => finiteCapAuxWeight n a) (fun _ a => finiteCapAuxWeight_nonneg n a) (fun _ => finiteCapAuxWeight_sum n) (fun _ => measurable_const) Z (fun _ => measurable_of_countable _) (Integrable.of_finite : Integrable (fun sample : Fin n → Obs d => ∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * ‖Z sample a‖ ^ 2) (productLaw P n)) let g := fun counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ) => ‖idealThresholdPath epsilon he hn hd' counts - F‖ ^ 2 have hg : Integrable g (idealCountLaw (n := n) P) := by have h := idealProcessRisk_integrand_integrable epsilon he hn hd' P apply h.congr filter_upwards [] with counts dsimp [g, F] rw [idealThresholdPath_error_norm_eq epsilon he hn hd' P counts] have hcouple := CappedMarkedCountIntegralIdentity (n := n) P g hg let uncapped := CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw n P have hfull : Integrable (fun z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d => g z.2) uncapped := by change Integrable (g ∘ snd) uncapped have hmap := uncappedMarkedCountLaw_table_eq_idealCountLaw (n := n) P apply (integrable_map_measure (by rw [show Measure.map snd uncapped = idealCountLaw (n := n) P by simpa [uncapped] using hmap] exact hg.aestronglyMeasurable) measurable_snd.aemeasurable).mp rw [show Measure.map snd uncapped = idealCountLaw (n := n) P by simpa [uncapped] using hmap] exact hg have htrunc : Integrable (fun z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d => if z.1 ≤ n then g z.2 else 0) uncapped := by apply hfull.mono' (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with z split_ifs <;> simp [g, abs_of_nonneg] have htrunc_le : (∫ z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d, if z.1 ≤ n then g z.2 else 0 ∂uncapped) ≤ ∫ counts, g counts ∂idealCountLaw (n := n) P := by have hle : (∫ z : ℕ × CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable d, if z.1 ≤ n then g z.2 else 0 ∂uncapped) ≤ ∫ z, g z.2 ∂uncapped := by apply integral_mono htrunc hfull exact fun z => by dsimp split_ifs <;> simp [g] have hmap := uncappedMarkedCountLaw_table_eq_idealCountLaw (n := n) P calc _ ≤ ∫ z, g z.2 ∂uncapped := hle _ = ∫ counts, g counts ∂idealCountLaw (n := n) P := by rw [← hmap] rw [integral_map measurable_snd.aemeasurable (measurable_of_countable _).aestronglyMeasurable] have hright : (∫ sample : Fin n → Obs d, ∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * ‖Z sample a‖ ^ 2 ∂productLaw P n) ≤ (∫ counts, g counts ∂idealCountLaw (n := n) P) + ((poissonMeasure ((n : ℝ≥0) / 4)) (Ioi n)).toReal := by rw [show (∫ sample : Fin n → Obs d, ∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a * ‖Z sample a‖ ^ 2 ∂productLaw P n) = ((poissonMeasure ((n : ℝ≥0) / 4)) (Ioi n)).toReal * ‖F‖ ^ 2 + ∫ sample : Fin n → Obs d, ∑ M ∈ range (n + 1), ∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, auxiliaryWeight n M * g (permutedMarkedCountTable sample perm M marks) ∂productLaw P n by simp only [Z, Fintype.sum_option, finiteCapAuxWeight, finiteCapEstimatePath, zero_sub, norm_neg] rw [integral_add] · rw [integral_const] simp only [Measure.real, measure_univ, ENNReal.toReal_one, one_smul] congr 1 apply integral_congr_ae filter_upwards [] with sample simp_rw [Fintype.sum_prod_type] rw [← Fin.sum_univ_eq_sum_range] apply Finset.sum_congr rfl intro M _ apply Finset.sum_congr rfl intro perm _ apply Finset.sum_congr rfl intro marks _ congr 2 · exact integrable_const _ · exact Integrable.of_finite] rw [hcouple] have hF2 : ‖F‖ ^ 2 ≤ 1 := by nlinarith [dualProcessPath_norm_le_one he P, norm_nonneg F] have htail0 : 0 ≤ ((poissonMeasure ((n : ℝ≥0) / 4)) (Ioi n)).toReal := ENNReal.toReal_nonneg nlinarith [htrunc_le] have hleft : averagedProcessRisk (n := n) epsilon P = ∫ sample : Fin n → Obs d, ‖∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a • Z sample a‖ ^ 2 ∂productLaw P n := by unfold averagedProcessRisk apply integral_congr_ae filter_upwards [] with sample rw [← path_norm_eq_sSup_abs_restrict (fun lambda => averagedThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda)] · congr 2 apply ContinuousMap.ext intro t exact (finiteCapErrorPath_average_apply epsilon he hn hd' P sample t).symm · let W : Path := ∑ a : FiniteCapAuxState n, finiteCapAuxWeight n a • Z sample a apply W.continuous.congr intro t exact finiteCapErrorPath_average_apply epsilon he hn hd' P sample t have hideal : (∫ counts, g counts ∂idealCountLaw (n := n) P) = idealProcessRisk (n := n) epsilon P := by unfold idealProcessRisk apply integral_congr_ae filter_upwards [] with counts dsimp [g, F] rw [idealThresholdPath_error_norm_eq epsilon he hn hd' P counts] rw [hleft, one_mul, ← hideal] exact hJensen.trans (hright.trans (add_le_add (le_refl _) (poissonQuarterCapTail_le_paperRemainder n)))
CausalSmith.Stat.DiscreteBudgetvalueCurve.capTransferRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapTransfer.lean:505
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.CapacityAlphabetPadding 17 declarations Zero-mass padding of the paper's full-data causal laws.

Zero-mass padding of the paper's full-data causal laws.

def padCausalObs

Embed an observed record along an enlargement of its covariate alphabet.

Definition (Lean source)
r d :
ℕ
h :
r ≤ d
padCausalObs h :
Obs r → Obs d
fun z => (castLE h z.1, z.2.1, z.2.2)

Embed a full-data record along an enlargement of its covariate alphabet.

Definition (Lean source)
r d :
ℕ
h :
r ≤ d
padCausalFullObs h :
fun z => (castLE h z.1, z.2.1, z.2.2.1, z.2.2.2.1, z.2.2.2.2)
def padPotentialLaw

Extend a full-data causal law by zero mass on the new covariate cells.

Definition (Lean source)
r d :
ℕ
h :
r ≤ d
Q :
padPotentialLaw h Q :
Qpad :
⟨Q.pmf.map (padCausalFullObs h)⟩ (: CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw d)
have hcons : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency Qpad := by intro z hz change ((Q.pmf.map (padCausalFullObs h)) z).toReal
= 0 rw [PMF.map_apply] apply (ENNReal.toReal_eq_zero_iff _).2 left rw [ENNReal.tsum_eq_zero] intro w split_ifs with hw · have hwbad : w.2.2.1 ≠ (if w.2.1 then w.2.2.2.2 else w.2.2.2.1) := by intro heq apply hz have hgood : (padCausalFullObs h w).2.2.1 = (if (padCausalFullObs h w).2.1 then (padCausalFullObs h w).2.2.2.2 else (padCausalFullObs h w).2.2.2.1) := by simpa [padCausalFullObs] using heq exact hw ▸ hgood have hzero := Q.property.1 w hwbad change (Q.pmf w).toReal = 0 at hzero rcases (ENNReal.toReal_eq_zero_iff _).1 hzero with hz0 | htop · exact hz0 · exact ((Q.pmf.apply_ne_top w) htop).elim · rfl let hcanonical := canonicalObservedOutcome_of_consistency Qpad hcons ⟨Classical.choose hcanonical, Qpad, Classical.choose_spec hcanonical, hcons⟩
theorem padPotentialLaw_fullMass_castLE

Padded full atom masses agree with the original masses on embedded cells. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
x :
Fin r
a y y0 y1 :
fullMass (padPotentialLaw h Q) (castLE h x, a, y, y0, y1)
= fullMass Q (x, a, y, y0, y1)
Proof (Lean source)
-- @node: padPotentialLaw_fullMass_castLE lemma padPotentialLaw_fullMass_castLE {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (x : Fin r) (a y y0 y1 : Bool) : fullMass (padPotentialLaw h Q) (castLE h x, a, y, y0, y1) = fullMass Q (x, a, y, y0, y1) := by unfold fullMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass simp only [padPotentialLaw, PMF.map_apply] rw [tsum_eq_single (x, a, y, y0, y1)] · simp [padCausalFullObs, PotentialLaw.pmf] · intro z hz simp only [ite_eq_right_iff] intro heq exact (hz ((padCausalFullObs_injective h) heq.symm)).elim
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_fullMass_castLE · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:65
theorem padPotentialLaw_fullMass_new

Every atom in a newly added covariate cell has zero padded mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
x :
Fin d
hx :
r ≤ (x : ℕ)
a y y0 y1 :
fullMass (padPotentialLaw h Q) (x, a, y, y0, y1) = 0
Proof (Lean source)
-- @node: padPotentialLaw_fullMass_new lemma padPotentialLaw_fullMass_new {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (x : Fin d) (hx : r ≤ (x : ℕ)) (a y y0 y1 : Bool) : fullMass (padPotentialLaw h Q) (x, a, y, y0, y1) = 0 := by unfold fullMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass simp only [padPotentialLaw, PMF.map_apply] apply (ENNReal.toReal_eq_zero_iff _).2 left rw [ENNReal.tsum_eq_zero] intro z split_ifs with heq · have hv := congrArg (fun w : FullObs d => (w.1 : ℕ)) heq simp only [padCausalFullObs] at hv have : (z.1 : ℕ) = (x : ℕ) := by simpa using hv.symm omega · rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_fullMass_new · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:80
theorem padPotentialLaw_poCellMass_castLE

Padded cell masses agree with the original masses on embedded cells. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
x :
Fin r
Proof (Lean source)
-- @node: padPotentialLaw_poCellMass_castLE lemma padPotentialLaw_poCellMass_castLE {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (x : Fin r) : poCellMass (padPotentialLaw h Q) (castLE h x) = poCellMass Q x := by simp only [poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, padPotentialLaw_fullMass_castLE]
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_poCellMass_castLE · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:99
theorem padPotentialLaw_poRegression_castLE

Padded regressions agree with the original regressions on embedded cells. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
a :
Fin 2
x :
Fin r
Proof (Lean source)
-- @node: padPotentialLaw_poRegression_castLE lemma padPotentialLaw_poRegression_castLE {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (a : Fin 2) (x : Fin r) : poRegression (padPotentialLaw h Q) a (castLE h x) = poRegression Q a x := by simp only [poRegression, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression, padPotentialLaw_poCellMass_castLE, padPotentialLaw_fullMass_castLE]
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_poRegression_castLE · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:107
theorem padPotentialLaw_poCellMass_new

Newly added cells have zero padded mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
x :
Fin d
hx :
r ≤ (x : ℕ)
Proof (Lean source)
-- @node: padPotentialLaw_poCellMass_new lemma padPotentialLaw_poCellMass_new {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (x : Fin d) (hx : r ≤ (x : ℕ)) : poCellMass (padPotentialLaw h Q) x = 0 := by simp only [poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, padPotentialLaw_fullMass_new h Q x hx] simp
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_poCellMass_new · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:115
theorem padPotentialLaw_effect_new

Newly added cells have totalized regression and effect zero. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
x :
Fin d
hx :
r ≤ (x : ℕ)
effect (padPotentialLaw h Q) x = 0
Proof (Lean source)
-- @node: padPotentialLaw_effect_new lemma padPotentialLaw_effect_new {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (x : Fin d) (hx : r ≤ (x : ℕ)) : effect (padPotentialLaw h Q) x = 0 := by have hm := padPotentialLaw_poCellMass_new h Q x hx unfold effect simp [poRegression, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression, hm]
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_effect_new · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:138
theorem padPotentialLaw_effect_castLE

Padding preserves effects on embedded cells. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
x :
Fin r
effect (padPotentialLaw h Q) (castLE h x) = effect Q x
Proof (Lean source)
-- @node: padPotentialLaw_effect_castLE lemma padPotentialLaw_effect_castLE {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (x : Fin r) : effect (padPotentialLaw h Q) (castLE h x) = effect Q x := by simp only [effect, padPotentialLaw_poRegression_castLE]
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_effect_castLE · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:147
theorem padPotentialLaw_controlValue

Padding preserves the never-treat value. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
Proof (Lean source)
-- @node: padPotentialLaw_controlValue lemma padPotentialLaw_controlValue {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) : controlValue (padPotentialLaw h Q) = controlValue Q := by classical unfold controlValue calc (∑ x : Fin d, poCellMass (padPotentialLaw h Q) x * poRegression (padPotentialLaw h Q) 0 x) = ∑ x : Fin d, if hx : (x : ℕ) < r then poCellMass Q ⟨x, hx⟩ * poRegression Q 0 ⟨x, hx⟩ else 0 := by apply Finset.sum_congr rfl intro x _ split_ifs with hx · let xi : Fin r := ⟨x, hx⟩ have he : castLE h xi = x := Fin.ext (by rfl) calc _ = poCellMass (padPotentialLaw h Q) (castLE h xi) * poRegression (padPotentialLaw h Q) 0 (castLE h xi) := by rw [he] _ = poCellMass Q xi * poRegression Q 0 xi := by rw [padPotentialLaw_poCellMass_castLE, padPotentialLaw_poRegression_castLE] · have hnew : r ≤ (x : ℕ) := Nat.le_of_not_gt hx rw [padPotentialLaw_poCellMass_new h Q x hnew] simp _ = _ := by simpa using sum_castLE_ite h (fun x => poCellMass Q x * poRegression Q 0 x)
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_controlValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:154
theorem padPotentialLaw_budgetValue

Zero-mass alphabet padding preserves the budget-constrained value. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
b :
ℝ
Proof (Lean source)
-- @node: padPotentialLaw_budgetValue lemma padPotentialLaw_budgetValue {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (b : ℝ) : budgetValue (padPotentialLaw h Q) b = budgetValue Q b := by classical unfold budgetValue split_ifs with hb · rw [padPotentialLaw_controlValue h Q] congr 1 apply congrArg sSup ext v constructor · rintro ⟨pi, hpi, rfl⟩ let rho : Fin r → ℝ := fun x => pi (castLE h x) refine ⟨rho, ?_, ?_⟩ · refine ⟨fun x => hpi.1 (castLE h x), ?_⟩ simpa [rho, padded_weighted_sum h Q pi] using hpi.2 · simpa [rho] using (padded_gain_sum h Q pi).symm · rintro ⟨rho, hrho, rfl⟩ let pi := extendPolicy h rho refine ⟨pi, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · intro x dsimp [pi, extendPolicy] split_ifs with hx · exact hrho.1 ⟨x, hx⟩ · norm_num · rw [padded_weighted_sum] simpa [pi, extendPolicy] using hrho.2 · change (∑ x : Fin d, poCellMass (padPotentialLaw h Q) x * pi x * effect (padPotentialLaw h Q) x) = ∑ x : Fin r, poCellMass Q x * rho x * effect Q x rw [padded_gain_sum] simp [pi, extendPolicy] · rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_budgetValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:236
theorem padPotentialLaw_capacityHardClass

Zero-mass padding preserves all restrictions defining the capacity hard class and its binding half-budget certificate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
hr :
2 ≤ r
h :
r ≤ d
epsilon :
ℝ
Q :
hQ :
Q ∈ capacityHardClass r epsilon
Proof (Lean source)
-- @node: padPotentialLaw_capacityHardClass lemma padPotentialLaw_capacityHardClass {r d : ℕ} (hr : 2 ≤ r) (h : r ≤ d) {epsilon : ℝ} {Q : PotentialLaw r} (hQ : Q ∈ capacityHardClass r epsilon) : padPotentialLaw h Q ∈ capacityHardClass d epsilon := by classical rcases hQ with ⟨hmodel, hvalue, heffects, hbinding⟩ refine ⟨?_, ?_, ?_, ?_⟩ · refine ⟨hr.trans h, hmodel.overlapParameter, ?_, ?_, ?_⟩ · intro z hz by_cases hx : (z.1 : ℕ) < r · let x : Fin r := ⟨z.1, hx⟩ have he : castLE h x = z.1 := Fin.ext (by rfl) let z0 : FullObs r := (x, z.2.1, z.2.2.1, z.2.2.2.1, z.2.2.2.2) have hez : padCausalFullObs h z0 = z := by apply Prod.ext · exact he · rfl have hs := hmodel.consistency z0 (by simpa [z0] using hz) rw [← hez] change fullMass (padPotentialLaw h Q) (castLE h x, z.2.1, z.2.2.1, z.2.2.2.1, z.2.2.2.2) = 0 exact (padPotentialLaw_fullMass_castLE h Q x z.2.1 z.2.2.1 z.2.2.2.1 z.2.2.2.2).trans (by simpa [z0] using hs) · exact padPotentialLaw_fullMass_new h Q z.1 (Nat.le_of_not_gt hx) z.2.1 z.2.2.1 z.2.2.2.1 z.2.2.2.2 · intro x a y0 y1 by_cases hx : (x : ℕ) < r · let xi : Fin r := ⟨x, hx⟩ have he : castLE h xi = x := Fin.ext (by rfl) rw [← he, padPotentialLaw_poJointAtom_castLE, padPotentialLaw_poCellMass_castLE, padPotentialLaw_poTreatmentAtom_castLE, padPotentialLaw_poPairAtom_castLE] exact hmodel.exchangeability xi a y0 y1 · obtain ⟨hp, ht, hj⟩ := padPotentialLaw_poAtoms_new h Q x (Nat.le_of_not_gt hx) simp [hp, ht, hj, padPotentialLaw_poCellMass_new h Q x (Nat.le_of_not_gt hx)] · intro x hxpos by_cases hx : (x : ℕ) < r · let xi : Fin r := ⟨x, hx⟩ have he : castLE h xi = x := Fin.ext (by rfl) rw [← he, padPotentialLaw_propensity_castLE] apply hmodel.overlap xi rw [← he, padPotentialLaw_cellMass_castLE] at hxpos exact hxpos · have hz : cellMass (observedMarginal (padPotentialLaw h Q)) x = 0 := by simp [cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, padPotentialLaw_jointMass_new h Q x (Nat.le_of_not_gt hx)] linarith · simpa [padPotentialLaw_budgetValue] using hvalue · intro x hxpos by_cases hx : (x : ℕ) < r · let xi : Fin r := ⟨x, hx⟩ have he : castLE h xi = x := Fin.ext (by rfl) rw [← he, padPotentialLaw_effect_castLE] apply heffects xi rw [← he, padPotentialLaw_poCellMass_castLE] at hxpos exact hxpos · rw [padPotentialLaw_poCellMass_new h Q x (Nat.le_of_not_gt hx)] at hxpos linarith · rcases hbinding with ⟨rho, hrho, hmass, hgain⟩ let pi := extendPolicy h rho refine ⟨pi, ?_, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · intro x dsimp [pi, extendPolicy] split_ifs with hx · exact hrho.1 ⟨x, hx⟩ · norm_num · rw [padded_weighted_sum] simpa [pi, extendPolicy] using hrho.2 · rw [padded_weighted_sum] simpa [pi, extendPolicy] using hmass · rw [padPotentialLaw_budgetValue, padPotentialLaw_controlValue, padded_gain_sum] simpa [pi, extendPolicy] using hgain
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_capacityHardClass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:342
theorem padPotentialLaw_observedMarginal_pmf

The observed PMF of a padded potential law is the pushforward of the original observed PMF. With the specified inputs and conditions, the stated relationship holds.

Formal statement
r d :
ℕ
h :
r ≤ d
Q :
Proof (Lean source)
-- @node: padPotentialLaw_observedMarginal_pmf lemma padPotentialLaw_observedMarginal_pmf {r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) : (observedMarginal (padPotentialLaw h Q)).pmf = (observedMarginal Q).pmf.map (padCausalObs h) := by change map _ (map (padCausalFullObs h) Q.val.pmf) = map (padCausalObs h) (map _ Q.val.pmf) rw [PMF.map_comp, PMF.map_comp] congr 1
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_observedMarginal_pmf · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:422
theorem padPotentialLaw_productLaw_map

Coordinatewise padding transports the iid observed sample law exactly. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n r d :
ℕ
h :
r ≤ d
Q :
Measure.map (fun z : Fin n → Obs r => fun i => padCausalObs h (z i)) (productLaw (observedMarginal Q) n)
= productLaw (observedMarginal (padPotentialLaw h Q)) n
Proof (Lean source)
-- @node: padPotentialLaw_productLaw_map lemma padPotentialLaw_productLaw_map {n r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) : Measure.map (fun z : Fin n → Obs r => fun i => padCausalObs h (z i)) (productLaw (observedMarginal Q) n) = productLaw (observedMarginal (padPotentialLaw h Q)) n := by unfold productLaw CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.productLaw rw [Measure.pi_map_pi (fun _ => (measurable_of_finite (padCausalObs h)).aemeasurable)] congr 1 funext i unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.obsLaw rw [PMF.toMeasure_map (padCausalObs h) _ (measurable_of_finite _)] congr 1 exact (padPotentialLaw_observedMarginal_pmf h Q).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.padPotentialLaw_productLaw_map · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:434
theorem sqRisk_padPotentialLaw

Pulling an estimator back along coordinatewise alphabet padding preserves its squared risk, including the half-budget target. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n r d :
ℕ
h :
r ≤ d
Q :
T :
(Fin n → Obs d) → ℝ
hT :
sqRisk (productLaw (observedMarginal Q) n) (fun z => T (fun i => padCausalObs h (z i))) (budgetValue Q (1 / 2))
= sqRisk (productLaw (observedMarginal (padPotentialLaw h Q)) n) T (budgetValue (padPotentialLaw h Q) (1 / 2))
Proof (Lean source)
-- @node: sqRisk_padPotentialLaw lemma sqRisk_padPotentialLaw {n r d : ℕ} (h : r ≤ d) (Q : PotentialLaw r) (T : (Fin n → Obs d) → ℝ) (hT : Measurable T) : sqRisk (productLaw (observedMarginal Q) n) (fun z => T (fun i => padCausalObs h (z i))) (budgetValue Q (1 / 2)) = sqRisk (productLaw (observedMarginal (padPotentialLaw h Q)) n) T (budgetValue (padPotentialLaw h Q) (1 / 2)) := by unfold sqRisk rw [padPotentialLaw_budgetValue] let μ := productLaw (observedMarginal Q) n have hi := MeasureTheory.integral_map (μ := μ) (φ := fun z : Fin n → Obs r => fun i => padCausalObs h (z i)) (f := fun z : Fin n → Obs d => (T z - budgetValue Q (1 / 2)) ^ 2) (measurable_of_finite _).aemeasurable ((hT.sub measurable_const).pow_const 2).aestronglyMeasurable rw [padPotentialLaw_productLaw_map h Q] at hi exact hi.symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.sqRisk_padPotentialLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:451
theorem pairedL1_lower_transport_capacity_padded

A paired lower bound on an even subalphabet transfers to any larger paper alphabet by zero-mass padding. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k d :
ℕ
hk :
1 ≤ k
hkd :
2 * k ≤ d
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
L :
ℝ
hL :
0 < L
hlower :
L ≤ twoSampleL1MinimaxRisk n k
mu :
PotentialLaw d → Measure (Fin n → Obs d)
hmu :
∀ Q, IidSampling (observedMarginal Q) (mu Q)
T :
{f : (Fin n → Obs d) → ℝ // Measurable f}
∃ Q : PotentialLaw d,
conclusion 1
Q ∈ capacityHardClass d epsilon
conclusion 2
(1 / 32 : ℝ) ^ 2 * (L / 2) ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2))
Proof (Lean source)
-- @node: pairedL1_lower_transport_capacity_padded lemma pairedL1_lower_transport_capacity_padded {n k d : ℕ} (hk : 1 ≤ k) (hkd : 2 * k ≤ d) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (L : ℝ) (hL : 0 < L) (hlower : L ≤ twoSampleL1MinimaxRisk n k) (mu : PotentialLaw d → Measure (Fin n → Obs d)) (hmu : ∀ Q, IidSampling (observedMarginal Q) (mu Q)) (T : {f : (Fin n → Obs d) → ℝ // Measurable f}) : ∃ Q : PotentialLaw d, Q ∈ capacityHardClass d epsilon ∧ (1 / 32 : ℝ) ^ 2 * (L / 2) ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2)) := by let Tsmall : {f : (Fin n → Obs (2 * k)) → ℝ // Measurable f} := ⟨fun z => T.1 (fun i => padCausalObs hkd (z i)), measurable_of_finite _⟩ obtain ⟨Q, hQ, hrisk⟩ := pairedL1_lower_transport_capacity hk epsilon he he' L hL hlower Tsmall refine ⟨padPotentialLaw hkd Q, padPotentialLaw_capacityHardClass (by omega) hkd hQ, ?_⟩ rw [hmu (padPotentialLaw hkd Q)] exact hrisk.trans_eq (sqRisk_padPotentialLaw hkd Q T.1 T.2)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedL1_lower_transport_capacity_padded · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityAlphabetPadding.lean:472
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.CapacityLowerTransport 5 declarations Fixed-sample transport from paired L1 estimation to half-budget value.

Fixed-sample transport from paired L1 estimation to half-budget value.

def pairedSampleMarkovKernel

The parameter-free paired randomization as a Mathlib Markov kernel.

Definition (Lean source)
n k :
ℕ
pairedSampleMarkovKernel n k :
Kernel ((Fin n → Fin k) × (Fin n → Fin k)) (Fin n → Obs (2 * k))
Kernel.ofFunOfCountable (fun x => (pairedSampleKernel n x).toMeasure)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleMarkovKernel · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityLowerTransport.lean:14
instance pairedSampleMarkovKernel_isMarkov

For n, this instance provides the stated structure.

Definition (Lean source)
instance pairedSampleMarkovKernel_isMarkov (n k : ℕ) : IsMarkovKernel (pairedSampleMarkovKernel n k) := by refine ⟨fun x => ?_⟩ change IsProbabilityMeasure ((pairedSampleKernel n x).toMeasure) infer_instance
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleMarkovKernel_isMarkov · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityLowerTransport.lean:21
theorem pairedSampleMarkovKernel_comp_twoSampleLaw

The paired Markov kernel sends the fixed two-sample law exactly to the observed iid law of the normalized paired causal construction. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
productLaw (observedMarginal (pairedLaw r theta)) n
= pairedSampleMarkovKernel n k ∘ₘ twoSampleLaw n (R, S)
Proof (Lean source)
-- @node: pairedSampleMarkovKernel_comp_twoSampleLaw lemma pairedSampleMarkovKernel_comp_twoSampleLaw {n k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) : productLaw (observedMarginal (pairedLaw r theta)) n = pairedSampleMarkovKernel n k ∘ₘ twoSampleLaw n (R, S) := by apply Measure.ext_iff_singleton.2 intro z rw [Measure.bind_apply (MeasurableSet.singleton z) (pairedSampleMarkovKernel n k).aemeasurable, lintegral_fintype] simp only [pairedSampleMarkovKernel, Kernel.ofFunOfCountable, Kernel.coe_mk] simp_rw [PMF.toMeasure_apply_singleton _ _ (MeasurableSet.singleton _)] simpa [mul_comm] using (pairedSampleKernel_reproduces R S r theta hr htheta z).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleMarkovKernel_comp_twoSampleLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityLowerTransport.lean:28
theorem pairedL1_lower_transport_capacity

Any positive paired-L1 minimax lower bound transfers, with the exact 1/32 affine scale, to an even-alphabet capacity-active causal instance. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k :
ℕ
hk :
1 ≤ k
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
L :
ℝ
hL :
0 < L
hlower :
L ≤ twoSampleL1MinimaxRisk n k
T :
{f : (Fin n → Obs (2 * k)) → ℝ // Measurable f}
∃ Q : PotentialLaw (2 * k),
conclusion 1
Q ∈ capacityHardClass (2 * k) epsilon
conclusion 2
(1 / 32 : ℝ) ^ 2 * (L / 2)
≤ sqRisk (productLaw (observedMarginal Q) n) T.1 (budgetValue Q (1 / 2))
Proof (Lean source)
-- @node: pairedL1_lower_transport_capacity lemma pairedL1_lower_transport_capacity {n k : ℕ} (hk : 1 ≤ k) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (L : ℝ) (hL : 0 < L) (hlower : L ≤ twoSampleL1MinimaxRisk n k) (T : {f : (Fin n → Obs (2 * k)) → ℝ // Measurable f}) : ∃ Q : PotentialLaw (2 * k), Q ∈ capacityHardClass (2 * k) epsilon ∧ (1 / 32 : ℝ) ^ 2 * (L / 2) ≤ sqRisk (productLaw (observedMarginal Q) n) T.1 (budgetValue Q (1 / 2)) := by classical let r : ProbabilitySimplex k × ProbabilitySimplex k → ProbabilitySimplex k := fun RS => choose (normalizedPairedParameters RS.1 RS.2) let theta : ProbabilitySimplex k × ProbabilitySimplex k → PairedContrasts k := fun RS => choose (Classical.choose_spec (normalizedPairedParameters RS.1 RS.2)) have hr (RS : ProbabilitySimplex k × ProbabilitySimplex k) : ∀ i, (r RS).1 i = (RS.1.1 i + RS.2.1 i) / 2 := (Classical.choose_spec (Classical.choose_spec (normalizedPairedParameters RS.1 RS.2))).1 have ht (RS : ProbabilitySimplex k × ProbabilitySimplex k) : ∀ i, (theta RS).1 i = if RS.1.1 i + RS.2.1 i = 0 then 0 else (RS.1.1 i - RS.2.1 i) / (8 * (RS.1.1 i + RS.2.1 i)) := (Classical.choose_spec (Classical.choose_spec (normalizedPairedParameters RS.1 RS.2))).2 let P := fun RS : ProbabilitySimplex k × ProbabilitySimplex k => twoSampleLaw n RS let Q := fun RS : ProbabilitySimplex k × ProbabilitySimplex k => productLaw (observedMarginal (pairedLaw (r RS) (theta RS))) n letI : NeZero k := ⟨by omega⟩ let U : ProbabilitySimplex k := ⟨fun _ => (k : ℝ)⁻¹, by constructor · intro i positivity · simp [Finset.sum_const, Fintype.card_fin] ⟩ letI : Nonempty (ProbabilitySimplex k × ProbabilitySimplex k) := ⟨(U, U)⟩ letI (RS : ProbabilitySimplex k × ProbabilitySimplex k) : IsProbabilityMeasure (P RS) := by dsimp [P, twoSampleLaw, simplexSampleLaw] infer_instance have hsource : ∀ sourceEst : ((Fin n → Fin k) × (Fin n → Fin k)) → ℝ, Measurable sourceEst → UniformlyBounded sourceEst → ∃ RS, L / 2 ≤ sqRisk (P RS) sourceEst (simplexL1 RS.1 RS.2) := by intro sourceEst hmeas _ let est : TwoSampleEstimator n k := ⟨sourceEst, hmeas⟩ have hmin : twoSampleL1MinimaxRisk n k ≤ ⨆ RS, twoSampleL1Risk n est RS := by unfold twoSampleL1MinimaxRisk unfold twoSampleL1MinimaxRisk simpa [worstCaseRiskReal] using (minimaxValue_le_worstCaseRisk_of_nonneg (fun _ _ => by unfold twoSampleL1Risk positivity) est) have hstrict : L / 2 < ⨆ RS, twoSampleL1Risk n est RS := by have : L / 2 < L := by linarith exact this.trans_le (hlower.trans hmin) obtain ⟨RS, hRS⟩ := (lt_ciSup_iff (twoSampleL1Risk_bddAbove_all est)).mp hstrict exact ⟨RS, by simpa [P, twoSampleL1Risk, twoSampleL1Risk, est, sqRisk] using hRS.le⟩ have htransport := forall_estimator_exists_sqRisk_ge_of_kernel_affine_transport P Q (pairedSampleMarkovKernel n k) (fun RS => simplexL1 RS.1 RS.2) (1 / 32) (3 / 8) (L / 2) (by norm_num) (fun RS => by simpa [P, Q] using (pairedSampleMarkovKernel_comp_twoSampleLaw (n := n) RS.1 RS.2 (r RS) (theta RS) (hr RS) (ht RS))) hsource T.1 T.2 (by obtain ⟨M, hM⟩ := Finite.bddAbove_range (fun z => |T.1 z|) refine ⟨max M 0, le_max_right _ _, fun z => ?_⟩ exact (hM ⟨z, rfl⟩).trans (le_max_left _ _)) obtain ⟨RS, hRS⟩ := htransport let Q0 := pairedLaw (r RS) (theta RS) have hcompletion : PairedCompletion Q0 (r RS) (theta RS) := pairedLaw_completion (r RS) (theta RS) have hbinding := pairedCompletion_bindingValue Q0 (r RS) (theta RS) hcompletion epsilon he he' hk refine ⟨Q0, ?_, ?_⟩ · exact ⟨pairedCompletion_modelClass hk epsilon he he' Q0 (r RS) (theta RS) hcompletion, pairedCompletion_budgetValue_one Q0 (r RS) (theta RS) hcompletion, fun j hj => pairedCompletion_effect_bounds Q0 (r RS) (theta RS) hcompletion j hj, hbinding.1⟩ · rw [show budgetValue Q0 (1 / 2) = (1 / 32 : ℝ) * simplexL1 RS.1 RS.2 + 3 / 8 by rw [normalizedPairedBudgetValue hk epsilon he he' RS.1 RS.2 (r RS) (theta RS) Q0 hcompletion (hr RS) (ht RS)] ring] simpa [Q, Q0] using hRS
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedL1_lower_transport_capacity · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityLowerTransport.lean:47
theorem pairedL1_lower_transport_capacity_iid

The same transport uses any supplied sampling-law family satisfying the paper's IidSampling equality, rather than a definitionally chosen product. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k :
ℕ
hk :
1 ≤ k
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
L :
ℝ
hL :
0 < L
hlower :
L ≤ twoSampleL1MinimaxRisk n k
mu :
PotentialLaw (2 * k) → Measure (Fin n → Obs (2 * k))
hmu :
∀ Q, IidSampling (observedMarginal Q) (mu Q)
T :
{f : (Fin n → Obs (2 * k)) → ℝ // Measurable f}
∃ Q : PotentialLaw (2 * k),
conclusion 1
Q ∈ capacityHardClass (2 * k) epsilon
conclusion 2
(1 / 32 : ℝ) ^ 2 * (L / 2) ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2))
Proof (Lean source)
-- @node: pairedL1_lower_transport_capacity_iid lemma pairedL1_lower_transport_capacity_iid {n k : ℕ} (hk : 1 ≤ k) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (L : ℝ) (hL : 0 < L) (hlower : L ≤ twoSampleL1MinimaxRisk n k) (mu : PotentialLaw (2 * k) → Measure (Fin n → Obs (2 * k))) (hmu : ∀ Q, IidSampling (observedMarginal Q) (mu Q)) (T : {f : (Fin n → Obs (2 * k)) → ℝ // Measurable f}) : ∃ Q : PotentialLaw (2 * k), Q ∈ capacityHardClass (2 * k) epsilon ∧ (1 / 32 : ℝ) ^ 2 * (L / 2) ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2)) := by obtain ⟨Q, hQ, hrisk⟩ := pairedL1_lower_transport_capacity hk epsilon he he' L hL hlower T refine ⟨Q, hQ, ?_⟩ rw [hmu Q] exact hrisk
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedL1_lower_transport_capacity_iid · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CapacityLowerTransport.lean:145
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.CitedGates 10 declarations The cited known-reference lower bound used by the two-sample reduction.

The cited known-reference lower bound used by the two-sample reduction.

theorem simplexMass_sum

A simplex vector has total ENNReal mass one. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R :
ProbabilitySimplex k
∑ i : Fin k, ofReal (R.1 i) = 1
Proof (Lean source)
lemma simplexMass_sum {k : ℕ} (R : ProbabilitySimplex k) : ∑ i : Fin k, ofReal (R.1 i) = 1 := simplexMass_sum R
CausalSmith.Stat.DiscreteBudgetvalueCurve.simplexMass_sum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:13
def simplexPMF

The PMF of a probability-simplex vector.

Definition (Lean source)
k :
ℕ
R :
ProbabilitySimplex k
simplexPMF R :
PMF (Fin k)
CausalSmith.Stat.DiscreteBudgetvalueCurve.simplexPMF · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:18
def simplexSampleLaw

The fixed-sample law from a simplex vector.

Definition (Lean source)
k :
ℕ
R :
ProbabilitySimplex k
n :
ℕ
simplexSampleLaw R n :
Measure (Fin n → Fin k)
CausalSmith.Stat.DiscreteBudgetvalueCurve.simplexSampleLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:22
def simplexL1

Discrete L1 distance.

Definition (Lean source)
k :
ℕ
R S :
ProbabilitySimplex k
simplexL1 R S :
ℝ
theorem simplexL1_nonneg_le_two Lemma simplexL1_nonneg_le_two in the paper ↗

The simplex l1 nonneg le two result. It proves the stated conclusion.

Formal statement
k :
ℕ
R S :
ProbabilitySimplex k
conclusion 1
0 ≤ simplexL1 R S
conclusion 2
simplexL1 R S ≤ 2
Proof (Lean source)
lemma simplexL1_nonneg_le_two {k : ℕ} (R S : ProbabilitySimplex k) : 0 ≤ simplexL1 R S ∧ simplexL1 R S ≤ 2 := by simpa only [simplexL1] using simplexL1_nonneg_le_two R S
CausalSmith.Stat.DiscreteBudgetvalueCurve.simplexL1_nonneg_le_two · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:32

The simplex l1 self result. It proves the stated conclusion.

Formal statement
k :
ℕ
R :
ProbabilitySimplex k
simplexL1 R R = 0
Proof (Lean source)
lemma simplexL1_self {k : ℕ} (R : ProbabilitySimplex k) : simplexL1 R R = 0 := by simpa only [simplexL1] using simplexL1_self R
CausalSmith.Stat.DiscreteBudgetvalueCurve.simplexL1_self · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:39

The simplex l1 symm result. It proves the stated conclusion.

Formal statement
k :
ℕ
R S :
ProbabilitySimplex k
simplexL1 R S = simplexL1 S R
Proof (Lean source)
lemma simplexL1_symm {k : ℕ} (R S : ProbabilitySimplex k) : simplexL1 R S = simplexL1 S R := by simpa only [simplexL1] using simplexL1_symm R S
CausalSmith.Stat.DiscreteBudgetvalueCurve.simplexL1_symm · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:46
def KnownL1Estimator

All measurable scalar estimators using the first sample and a known reference vector.

Definition (Lean source)
n k :
ℕ
KnownL1Estimator n k :
Type
{f : (Fin n → Fin k) → ℝ // Measurable f}
CausalSmith.Stat.DiscreteBudgetvalueCurve.KnownL1Estimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:52
def knownL1Risk

Fixed-reference L1 squared risk.

Definition (Lean source)
k :
ℕ
n :
ℕ
S :
ProbabilitySimplex k
est :
R :
ProbabilitySimplex k
knownL1Risk n S est R :
ℝ
∫ z, (est.1 z - simplexL1 R S) ^ 2 ∂simplexSampleLaw R n
CausalSmith.Stat.DiscreteBudgetvalueCurve.knownL1Risk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:56

Jiao, Han, and Weissman (2018), Minimax estimation of the L1 distance, Theorem 3, equation (24), and the discussion following Theorem 6; arXiv:1705.00807v7. The known-reference large-alphabet bound in its stated regime.

Definition (Lean source)
JHWKnownQL1LowerRegime :
Sort 0
∀ a0 C0 : ℝ,
0 < a0 → ∃ c : ℝ, 0 < c ∧ ∃ k0 : ℕ, ∀ k n : ℕ, k0
≤ k → a0 * k / log k ≤ n → log n ≤ C0 * log k → c * k / (n * log n) ≤ sSup (range (fun S : ProbabilitySimplex k => minimaxValueReal (knownL1Risk n S)))
CausalSmith.Stat.DiscreteBudgetvalueCurve.JHWKnownQL1LowerRegime · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CitedGates.lean:61
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.CoefficientEnvelope 1 declarations The coefficient-process bounded-variation quantity.

The coefficient-process bounded-variation quantity.

def jacksonCoefficientBV

Sum of the bounded-variation norms of normalized polynomial coefficients.

Definition (Lean source)
epsilon m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
jacksonCoefficientBV epsilon m d pilot :
ℝ
center :
pilotMidpoint m d pilot
radius :
pilotRadius m d pilot
Finset.univ.sum (fun alpha : Fin 4 → Fin (2 * (K - 1) + 1) => abs (jacksonCoefficient epsilon 0 K center radius (fun i => (alpha i : ℕ))) + (eVariationOn (fun lambda => jacksonCoefficient epsilon lambda K center radius (fun i => (alpha i : ℕ))) (Icc 0 1)).toReal)
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficientBV · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/CoefficientEnvelope.lean:13
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.Estimator 10 declarations The deterministic, auxiliary-randomization-averaged curve estimator.

The deterministic, auxiliary-randomization-averaged curve estimator.

def empiricalCellVector

The empirical observed four-mass vector.

Definition (Lean source)
n d :
ℕ
sample :
Fin n → Obs d
j :
Fin d
empiricalCellVector sample j :
Cell → ℝ
fun zeta
=> (∑ i : Fin n, if (sample i).1 = j ∧ (sample i).2.1 = finTwoEquiv zeta.1 ∧ (sample i).2.2 = finTwoEquiv zeta.2 then (1 : ℝ) else 0) / n
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalCellVector · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:13
def empiricalThresholdProcess

The plug-in threshold process used below the alphabet cutoff.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
lambda :
ℝ
empiricalThresholdProcess epsilon sample lambda :
ℝ
∑ j, thresholdFunReal epsilon lambda (empiricalCellVector sample j)
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalThresholdProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:20
def auxiliaryThresholdProcess

The uncapped pilot/evaluation threshold process for one auxiliary draw.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
lambda :
ℝ
auxiliaryThresholdProcess epsilon sample perm M marks lambda :
ℝ
∑ j : Fin d, jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (fun zeta => markedCellCount sample perm M marks false j zeta) (fun zeta => markedCellCount sample perm M marks true j zeta)
CausalSmith.Stat.DiscreteBudgetvalueCurve.auxiliaryThresholdProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:25
def cappedThresholdProcess

The cap event contributes the zero threshold process.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
lambda :
ℝ
cappedThresholdProcess epsilon sample perm M marks lambda :
ℝ
if M ≤ n then auxiliaryThresholdProcess epsilon sample perm M marks lambda else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.cappedThresholdProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:34
def averagedThresholdProcess

Exact finite average over Poisson count, permutation, and fair marks.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
lambda :
ℝ
averagedThresholdProcess epsilon sample lambda :
ℝ
∑ M ∈ range (n + 1), ((poissonMeasure ((n : ℝ≥0) / 4)) {M}).toReal * ((∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, cappedThresholdProcess epsilon sample perm M marks lambda) / ((card (Perm (Fin n)) : ℝ) * (card (Fin n → Bool) : ℝ)))
CausalSmith.Stat.DiscreteBudgetvalueCurve.averagedThresholdProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:40
def estimatedThresholdProcess

The process used by the two nonconstant estimator branches.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
lambda :
ℝ
estimatedThresholdProcess epsilon sample lambda :
ℝ
if d < boundedAlphabetCutoff then empiricalThresholdProcess epsilon sample lambda else averagedThresholdProcess epsilon sample lambda
CausalSmith.Stat.DiscreteBudgetvalueCurve.estimatedThresholdProcess · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:50
def estimatedBudgetValue

The projected dual minimum, with no optimizer choice.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
b :
ℝ
estimatedBudgetValue epsilon sample b :
ℝ
min 1 (max 0 (sInf ((fun lambda : ℝ => b * lambda + estimatedThresholdProcess epsilon sample lambda) '' Icc 0 1)))
CausalSmith.Stat.DiscreteBudgetvalueCurve.estimatedBudgetValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:57
def jfEstimator

For n, epsilon, sample, the jf estimator definition specifies the stated object.

Definition (Lean source)
n d :
ℕ
epsilon b0 :
ℝ
sample :
Fin n → Obs d
jfEstimator n d epsilon b0 sample :
Icc b0 (1 - b0) → ℝ
fun b => if d ≥ boundedAlphabetCutoff ∧
n < (d : ℝ) / logAlphabet d then 1 / 2 else estimatedBudgetValue epsilon sample b.1
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:64
theorem jfEstimator_admissible

Measurability and global boundedness of the clipped curve estimator. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
conclusion 1
Measurable (jfEstimator n d epsilon b0)
conclusion 2
∃ B : ℝ, ∀ z b, |jfEstimator n d epsilon b0 z b| ≤ B
Proof (Lean source)
lemma jfEstimator_admissible (n d : ℕ) (epsilon b0 : ℝ) : Measurable (jfEstimator n d epsilon b0) ∧ ∃ B : ℝ, ∀ z b, |jfEstimator n d epsilon b0 z b| ≤ B := by constructor · exact measurable_of_finite _ · refine ⟨1, ?_⟩ intro z b unfold jfEstimator split_ifs · norm_num · unfold estimatedBudgetValue apply abs_le.mpr constructor · exact le_trans (by norm_num : (-1 : ℝ) ≤ 0) (le_min (by norm_num : (0 : ℝ) ≤ 1) (le_max_left _ _)) · exact min_le_left _ _
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_admissible · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:72
def jfCurveEstimator

The estimator packaged for the minimax infimum.

Definition (Lean source)
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
jfCurveEstimator n d epsilon b0 hb0 :
⟨jfEstimator n d epsilon b0, hb0, jfEstimator_admissible n d epsilon b0⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfCurveEstimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/Estimator.lean:90
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.FactorialMoments 11 declarations Products of centered factorial lifts for the four coordinates.

Products of centered factorial lifts for the four coordinates.

A bounded monomial coefficient of the local Jackson polynomial, packaged as a continuous threshold path.

Definition (Lean source)
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
a :
Fin 4 → Fin (D + 1)
localJacksonCoefficientPath epsilon K center radius hK hpull hD a :
⟨fun lambda
=> jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)), jacksonCoefficient_continuous_time epsilon K center radius hK hpull hD a⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonCoefficientPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:17
theorem localJacksonCoefficientPath_bv

Every local Jackson coefficient path has finite total variation. This is the paper-side regularity premise required by the clipped Poisson factorial path moment theorem. With the specified inputs and conditions, the stated relationship holds.

Formal statement
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
a :
Fin 4 → Fin (D + 1)
eVariationOn (localJacksonCoefficientPath epsilon K center radius hK hpull hD a) univ < ⊤
Proof (Lean source)
-- @node: localJacksonCoefficientPath_bv lemma localJacksonCoefficientPath_bv {D : ℕ} (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hD : 2 * (K - 1) ≤ D) (a : Fin 4 → Fin (D + 1)) : eVariationOn (localJacksonCoefficientPath epsilon K center radius hK hpull hD a) univ < ⊤ := by let p : Time → MvPolynomial (Fin 4) ℝ := fun lambda => localJacksonPolynomial epsilon lambda K center radius have hdeg (lambda : Time) (i : Fin 4) : (p lambda).degreeOf i ≤ D := (localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK (hpull lambda) i).trans hD have hgrid (b : Fin 4 → Fin (D + 1)) : Continuous (fun lambda : Time => eval (fun i => (b i : ℝ)) (p lambda)) := localJacksonPolynomial_fixed_eval_continuous_time epsilon K center radius hK hpull hD _ have hcont (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : Continuous (fun lambda : Time => eval x (p lambda)) := localJacksonPolynomial_eval_continuous_time epsilon K center radius hK hpull x hx have hcubeBV (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : eVariationOn (⟨fun lambda : Time => eval x (p lambda), hcont x hx⟩ : Path) univ < ⊤ := by obtain ⟨C, hLip⟩ := localJacksonPolynomial_eval_lipschitz_time epsilon K center radius hK hpull x hx have hid : BoundedVariationOn (id : Time → Time) univ := by have hm : Monotone (fun t : Time => (t : ℝ)) := fun s t hst => hst have hv : BoundedVariationOn (fun t : Time => (t : ℝ)) univ := MonotoneOn.boundedVariationOn (hm.monotoneOn _) (fun t _ => abs_le.2 ⟨by linarith [t.property.1], t.property.2⟩) exact hv apply lt_top_iff_ne_top.mpr simpa [BoundedVariationOn, Function.comp_def] using hLip.comp_boundedVariationOn hid have h := tensorCoefficientPath_bv_of_cube p hdeg hgrid hcont hcubeBV a simpa [localJacksonCoefficientPath, tensorCoefficientPath, jacksonCoefficient_eq_tensorCoeffs] using h
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonCoefficientPath_bv · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:33

The clipped four-count factorial polynomial driven by the paper's local Jackson coefficient paths.

Definition (Lean source)
Ω :
Type*
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
W :
Fin 4 → Ω → ℕ
m cap :
ℝ
ω :
Ω
localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω :
fourPoissonFactorialPath (localJacksonCoefficientPath epsilon K center radius hK hpull hD) W m (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) cap ω
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonFourPoissonFactorialPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:83
theorem localJacksonFourPoissonFactorialPath_apply

Pointwise, the paper-specific factorial path is exactly the symmetric clip of the Jackson coefficient polynomial in the normalized factorial monomials. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
Type*
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
W :
Fin 4 → Ω → ℕ
m cap :
ℝ
ω :
Ω
lambda :
localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω lambda
= min cap (max (-cap) (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * fourFactorialMonomial W m (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) a ω))
Proof (Lean source)
-- @node: localJacksonFourPoissonFactorialPath_apply lemma localJacksonFourPoissonFactorialPath_apply {Ω : Type*} {D : ℕ} (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hD : 2 * (K - 1) ≤ D) (W : Fin 4 → Ω → ℕ) (m cap : ℝ) (ω : Ω) (lambda : Time) : localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω lambda = min cap (max (-cap) (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * fourFactorialMonomial W m (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) a ω)) := by simp [localJacksonFourPoissonFactorialPath, fourPoissonFactorialPath, clippedFinitePath, scalarClip, localJacksonCoefficientPath, mul_comm]
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonFourPoissonFactorialPath_apply · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:100
theorem jacksonCellStatistic_eq_localJacksonFourPoissonFactorialPath

Adding back the center threshold identifies the generic clipped factorial path with the paper's complete clipped Jackson cell statistic. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
Type*
epsilon m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
hK :
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
ω :
Ω
lambda :
thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)
+ localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta : Cell, pilotRadius m d pilot zeta) ω lambda
= jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) ω)
Proof (Lean source)
-- @node: jacksonCellStatistic_eq_localJacksonFourPoissonFactorialPath lemma jacksonCellStatistic_eq_localJacksonFourPoissonFactorialPath {Ω : Type*} (epsilon m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (hK : 0 < jacksonDegree d) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (ω : Ω) (lambda : Time) : thresholdFunReal epsilon lambda (pilotMidpoint m d pilot) + localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta : Cell, pilotRadius m d pilot zeta) ω lambda = jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) ω) := by rw [localJacksonFourPoissonFactorialPath_apply] unfold jacksonCellStatistic jacksonCellRaw dsimp only congr 2 rw [add_sub_cancel_left] congr 1 apply Finset.sum_congr rfl intro a ha congr 1 unfold fourFactorialMonomial factorialProduct centeredFactorial factorialLift rw [Finset.prod_div_distrib] simp only [Equiv.apply_symm_apply]
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellStatistic_eq_localJacksonFourPoissonFactorialPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:126
theorem localJacksonFourPoissonFactorialPath_sq_bound

The paper-specific local Jackson factorial path inherits measurability, samplewise bounded variation, integrability, and the promoted exponential square path-size estimate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
m L :
ℝ
hm :
0 < m
hL :
0 < L
hR :
∀ i, 0 < radius (CellFourEquiv.symm i)
hcenter :
∀ i, |(rate i : ℝ) / m - center (CellFourEquiv.symm i)| ≤ radius (CellFourEquiv.symm i)
hvariance :
∀ i, (rate i : ℝ) / (m ^ 2 * radius (CellFourEquiv.symm i) ^ 2) ≤ 1 / L
cap :
ℝ
hcap :
0 ≤ cap
conclusion 1
Measurable (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap)
conclusion 2
ω :
eVariationOn (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω) univ < ⊤
conclusion 3
Integrable (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap) μ
conclusion 4
Integrable (fun ω => (pathSize (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω)) ^ 2) μ
conclusion 5
(∫ ω, (pathSize (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω)) ^ 2 ∂μ)
≤ (∑ a, (pathSize (localJacksonCoefficientPath epsilon K center radius hK hpull hD a)) ^ 2) * ∑ _a : Fin 4 → Fin (D + 1), exp (4 * (D : ℝ) ^ 2 / L)
Proof (Lean source)
-- @node: localJacksonFourPoissonFactorialPath_sq_bound lemma localJacksonFourPoissonFactorialPath_sq_bound {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {D : ℕ} (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hD : 2 * (K - 1) ≤ D) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m L : ℝ) (hm : 0 < m) (hL : 0 < L) (hR : ∀ i, 0 < radius (CellFourEquiv.symm i)) (hcenter : ∀ i, |(rate i : ℝ) / m - center (CellFourEquiv.symm i)| ≤ radius (CellFourEquiv.symm i)) (hvariance : ∀ i, (rate i : ℝ) / (m ^ 2 * radius (CellFourEquiv.symm i) ^ 2) ≤ 1 / L) (cap : ℝ) (hcap : 0 ≤ cap) : Measurable (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap) ∧ (∀ ω, eVariationOn (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω) univ < ⊤) ∧ Integrable (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap) μ ∧ Integrable (fun ω => (pathSize (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω)) ^ 2) μ ∧ (∫ ω, (pathSize (localJacksonFourPoissonFactorialPath epsilon K center radius hK hpull hD W m cap ω)) ^ 2 ∂μ) ≤ (∑ a, (pathSize (localJacksonCoefficientPath epsilon K center radius hK hpull hD a)) ^ 2) * ∑ _a : Fin 4 → Fin (D + 1), exp (4 * (D : ℝ) ^ 2 / L) := by unfold localJacksonFourPoissonFactorialPath exact fourPoissonFactorialPath_sq_bound μ (localJacksonCoefficientPath epsilon K center radius hK hpull hD) (localJacksonCoefficientPath_bv epsilon K center radius hK hpull hD) W rate hWmeas hWlaw hWindep m L hm hL (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) hR hcenter hvariance cap hcap
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonFourPoissonFactorialPath_sq_bound · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:161
theorem centeredFactorial_eq_factorialLift Lemma centeredFactorial_eq_factorialLift in the paper ↗

The paper's centered falling-factorial coordinate is exactly the generic Poisson factorial lift. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m z :
ℝ
N h :
ℕ
Proof (Lean source)
-- @node: centeredFactorial_eq_factorialLift lemma centeredFactorial_eq_factorialLift (m z : ℝ) (N h : ℕ) : centeredFactorial m z N h = factorialLift m z N h := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredFactorial_eq_factorialLift · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:208
def factorialMonomial

A monomial's centered factorial lift on the pilot rectangle.

Definition (Lean source)
m :
ℝ
d :
ℕ
pilot eval :
Cell → ℕ
alpha :
Fin 4 → ℕ
factorialMonomial m d pilot eval alpha :
ℝ
∏ i : Fin 4, centeredFactorial m (pilotMidpoint m d pilot (CellFourEquiv.symm i)) (eval (CellFourEquiv.symm i)) (alpha i) / pilotRadius m d pilot (CellFourEquiv.symm i) ^ (alpha i)
CausalSmith.Stat.DiscreteBudgetvalueCurve.factorialMonomial · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:215
theorem factorialMonomial_eq_fourFactorialMonomial Lemma factorialMonomial_eq_fourFactorialMonomial in the paper ↗

A paper factorial monomial is the generic normalized four-coordinate factorial monomial after reindexing the four cells. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
Type*
D :
ℕ
m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
a :
Fin 4 → Fin (D + 1)
ω :
Ω
factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) ω) (fun i => (a i : ℕ))
= fourFactorialMonomial W m (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) a ω
Proof (Lean source)
-- @node: factorialMonomial_eq_fourFactorialMonomial lemma factorialMonomial_eq_fourFactorialMonomial {Ω : Type*} {D : ℕ} (m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (a : Fin 4 → Fin (D + 1)) (ω : Ω) : factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) ω) (fun i => (a i : ℕ)) = fourFactorialMonomial W m (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) a ω := by classical unfold factorialMonomial fourFactorialMonomial factorialProduct simp only [centeredFactorial_eq_factorialLift, Equiv.apply_symm_apply, Finset.prod_div_distrib]
CausalSmith.Stat.DiscreteBudgetvalueCurve.factorialMonomial_eq_fourFactorialMonomial · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:223

Under independent Poisson evaluation counts, the mean of a paper factorial monomial is the corresponding normalized product of powers. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
D :
ℕ
m :
ℝ
hm :
m ≠ 0
d :
ℕ
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
a :
Fin 4 → Fin (D + 1)
(∫ ω, factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) ω) (fun i => (a i : ℕ)) ∂μ)
= (∏ i, ((rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)) ^ (a i : ℕ)) / ∏ i, pilotRadius m d pilot (CellFourEquiv.symm i) ^ (a i : ℕ)
Proof (Lean source)
-- @node: factorialMonomial_mean lemma factorialMonomial_mean {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {D : ℕ} (m : ℝ) (hm : m ≠ 0) (d : ℕ) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (a : Fin 4 → Fin (D + 1)) : (∫ ω, factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) ω) (fun i => (a i : ℕ)) ∂μ) = (∏ i, ((rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)) ^ (a i : ℕ)) / ∏ i, pilotRadius m d pilot (CellFourEquiv.symm i) ^ (a i : ℕ) := by simp_rw [factorialMonomial_eq_fourFactorialMonomial] unfold fourFactorialMonomial rw [integral_div] rw [factorialProduct_mean μ W rate hWlaw hWindep m]
CausalSmith.Stat.DiscreteBudgetvalueCurve.factorialMonomial_mean · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:239
theorem factorialMonomial_square_envelope Lemma factorialMonomial_square_envelope in the paper ↗

The paper's normalized four-coordinate factorial monomial inherits the generic exponential square-moment envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
D :
ℕ
m L :
ℝ
hm :
0 < m
hL :
0 < L
d :
ℕ
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
hR :
∀ i, 0 < pilotRadius m d pilot (CellFourEquiv.symm i)
hcenter :
∀ i,
|(rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)|
≤ pilotRadius m d pilot (CellFourEquiv.symm i)
hvariance :
∀ i, (rate i : ℝ) / (m ^ 2 * pilotRadius m d pilot (CellFourEquiv.symm i) ^ 2) ≤ 1 / L
a :
Fin 4 → Fin (D + 1)
(∫ ω, (factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) ω) (fun i => (a i : ℕ))) ^ 2 ∂μ)
≤ exp (4 * (D : ℝ) ^ 2 / L)
Proof (Lean source)
-- @node: factorialMonomial_square_envelope lemma factorialMonomial_square_envelope {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {D : ℕ} (m L : ℝ) (hm : 0 < m) (hL : 0 < L) (d : ℕ) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (hR : ∀ i, 0 < pilotRadius m d pilot (CellFourEquiv.symm i)) (hcenter : ∀ i, |(rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)| ≤ pilotRadius m d pilot (CellFourEquiv.symm i)) (hvariance : ∀ i, (rate i : ℝ) / (m ^ 2 * pilotRadius m d pilot (CellFourEquiv.symm i) ^ 2) ≤ 1 / L) (a : Fin 4 → Fin (D + 1)) : (∫ ω, (factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) ω) (fun i => (a i : ℕ))) ^ 2 ∂μ) ≤ exp (4 * (D : ℝ) ^ 2 / L) := by simp_rw [factorialMonomial_eq_fourFactorialMonomial] exact factorialProduct_four_square_envelope μ W rate hWlaw hWindep m L hm hL (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) hR hcenter hvariance (fun i => (a i : ℕ)) D (fun i => le_of_lt_succ (a i).isLt)
CausalSmith.Stat.DiscreteBudgetvalueCurve.factorialMonomial_square_envelope · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/FactorialMoments.lean:258
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.GoodPilotAggregate 5 declarations Identification and simplification of the aggregate good-pilot path risk.

Identification and simplification of the aggregate good-pilot path risk.

theorem centeredIdealGoodPilotErrorRisk_eq_path_integral

The paper's scalar centered good-pilot risk is exactly the squared norm risk of the centered sum of its continuous cell paths. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
hprob :
hcont :
n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true (: ∀ j counts, Continuous (fun lambda : Time
= ∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j true (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j true (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P
Proof (Lean source)
-- @node: centeredIdealGoodPilotErrorRisk_eq_path_integral lemma centeredIdealGoodPilotErrorRisk_eq_path_integral {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) : let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true centeredIdealPilotErrorRisk (n := n) epsilon P true = ∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j true (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j true (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P := by classical dsimp only letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := hprob let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true let X : Fin d → ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun j counts => idealPilotErrorCellPath epsilon P counts j true (hcont j counts) have hXint (j : Fin d) : Integrable (X j) (idealCountLaw (n := n) P) := by simpa [X, hcont] using idealGoodPilotCellPath_integrable epsilon he he' hn hd P hprob j have hmean (lambda : Time) : idealPilotErrorMean (n := n) epsilon lambda P true = ∑ j : Fin d, ∫ x, X j x lambda ∂idealCountLaw (n := n) P := by unfold idealPilotErrorMean simp_rw [idealPilotErrorPart_eq_sum_cells] rw [integral_finsetSum] · simp [X, idealPilotErrorCellPath] · intro j _ simpa [X, idealPilotErrorCellPath] using (ContinuousMap.evalCLM ℝ lambda).integrable_comp (hXint j) have heval (j : Fin d) (lambda : Time) : (∫ x, X j x ∂idealCountLaw (n := n) P) lambda = ∫ x, X j x lambda ∂idealCountLaw (n := n) P := by simpa using ((ContinuousMap.evalCLM ℝ lambda).integral_comp_comm (hXint j)).symm apply integral_congr_ae exact Filter.Eventually.of_forall fun counts => by let Z : Path := ∑ j, (X j counts - ∫ x, X j x ∂idealCountLaw (n := n) P) have hpoint (lambda : Time) : Z lambda = idealPilotErrorPart (n := n) epsilon lambda P counts true - idealPilotErrorMean (n := n) epsilon lambda P true := by dsimp [Z] simp_rw [ContinuousMap.sum_apply, ContinuousMap.sub_apply, heval] rw [idealPilotErrorPart_eq_sum_cells, hmean] rw [Finset.sum_sub_distrib] simp only [X, idealPilotErrorCellPath] congr 1 have hg : Continuous (fun lambda : Time => idealPilotErrorPart (n := n) epsilon lambda P counts true - idealPilotErrorMean (n := n) epsilon lambda P true) := by convert Z.continuous using 1 funext lambda exact (hpoint lambda).symm change (sSup ((fun lambda : ℝ => |idealPilotErrorPart (n := n) epsilon lambda P counts true - idealPilotErrorMean (n := n) epsilon lambda P true|) '' Icc 0 1)) ^ 2 = ‖Z‖ ^ 2 rw [← path_norm_eq_sSup_abs_restrict (fun lambda => idealPilotErrorPart (n := n) epsilon lambda P counts true - idealPilotErrorMean (n := n) epsilon lambda P true) hg] congr 2 apply ContinuousMap.ext intro lambda exact (hpoint lambda).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealGoodPilotErrorRisk_eq_path_integral · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotAggregate.lean:14
theorem centeredIdealGoodPilotError_continuous

The centered aggregate good-pilot error is continuous in the shadow price. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
hprob :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
Continuous (fun lambda : Time => idealPilotErrorPart (n := n) epsilon lambda P counts true - idealPilotErrorMean (n := n) epsilon lambda P true)
Proof (Lean source)
lemma centeredIdealGoodPilotError_continuous {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) : Continuous (fun lambda : Time => idealPilotErrorPart (n := n) epsilon lambda P counts true - idealPilotErrorMean (n := n) epsilon lambda P true) := by classical let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true let X : Fin d → ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun j x => idealPilotErrorCellPath epsilon P x j true (hcont j x) have hXint (j : Fin d) : Integrable (X j) (idealCountLaw (n := n) P) := by simpa [X, hcont] using idealGoodPilotCellPath_integrable epsilon he he' hn hd P hprob j let Y : Path := ∑ j, X j counts let M : Path := ∑ j, ∫ x, X j x ∂idealCountLaw (n := n) P apply (Y - M).continuous.congr intro lambda have heval (j : Fin d) : (∫ x, X j x ∂idealCountLaw (n := n) P) lambda = ∫ x, X j x lambda ∂idealCountLaw (n := n) P := by simpa using ((ContinuousMap.evalCLM ℝ lambda).integral_comp_comm (hXint j)).symm simp only [Y, M, ContinuousMap.sub_apply, ContinuousMap.sum_apply] simp_rw [heval] rw [idealPilotErrorPart_eq_sum_cells] unfold idealPilotErrorMean simp_rw [idealPilotErrorPart_eq_sum_cells] rw [integral_finsetSum] · simp [X, idealPilotErrorCellPath] · intro j _ simpa [X, idealPilotErrorCellPath] using (ContinuousMap.evalCLM ℝ lambda).integrable_comp (hXint j)
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealGoodPilotError_continuous · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotAggregate.lean:89
theorem centeredIdealGoodPilotErrorRisk_le_raw

Equations (21), (32), and (33), before the final elementary rate simplification, bound the exact scalar good-pilot risk. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)
Proof (Lean source)
-- @node: centeredIdealGoodPilotErrorRisk_le_raw lemma centeredIdealGoodPilotErrorRisk_le_raw (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d), IsProbabilityMeasure (idealCountLaw (n := n) P) → centeredIdealPilotErrorRisk (n := n) epsilon P true ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) := by obtain ⟨C, hC, hbound⟩ := idealGoodPilotError_centered_maximal_quantitative epsilon he he' refine ⟨C, hC, ?_⟩ intro n d hn hd P hprob rw [centeredIdealGoodPilotErrorRisk_eq_path_integral epsilon he he' hn hd P hprob] exact hbound hn hd P hprob
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealGoodPilotErrorRisk_le_raw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotAggregate.lean:128
theorem goodPilot_raw_scale_le_rate

The logarithmic cell-scale expression in the raw equation (33) bound is absorbed by the advertised d /(m log(ed)) rate on the paper's main branch. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
hbranch :
(d : ℝ) / logAlphabet d ≤ n
(d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)
≤ 2000000 * d / (((n : ℝ) / 8) * logAlphabet d)
Proof (Lean source)
-- @node: goodPilot_raw_scale_le_rate lemma goodPilot_raw_scale_le_rate {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (hbranch : (d : ℝ) / logAlphabet d ≤ n) : (d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) ≤ 2000000 * d / (((n : ℝ) / 8) * logAlphabet d) := by let m : ℝ := (n : ℝ) / 8 let L : ℝ := logAlphabet d let r : ℝ := (d : ℝ) ^ (1 / 16 : ℝ) have hm : 0 < m := by dsimp [m]; positivity have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) have hdpos : (0 : ℝ) < d := lt_of_lt_of_le zero_lt_one hdreal have hLform : L = 1 + log d := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] have hL : 0 < L := by rw [hLform] linarith [Real.log_nonneg hdreal] have hr : 1 ≤ r := Real.one_le_rpow hdreal (by norm_num) have hr0 : 0 ≤ r := le_trans zero_le_one hr have hr16 : r ^ 16 = (d : ℝ) := by dsimp [r] rw [← Real.rpow_natCast, ← Real.rpow_mul (Nat.cast_nonneg d)] norm_num have hlog := Real.log_natCast_le_rpow_div d (show (0 : ℝ) < 1 / 16 by norm_num) have hLr : L ≤ 17 * r := by rw [hLform] dsimp [r] norm_num at hlog ⊢ nlinarith [Real.one_le_rpow hdreal (by norm_num : (0 : ℝ) ≤ 1 / 16)] have hL0 : 0 ≤ L := hL.le have hL2 : L ^ 2 ≤ (17 * r) ^ 2 := pow_le_pow_left₀ hL0 hLr 2 have hL4 : L ^ 4 ≤ (17 * r) ^ 4 := pow_le_pow_left₀ hL0 hLr 4 have hr3 : r ^ 3 ≤ (d : ℝ) := by rw [← hr16] exact pow_le_pow_right₀ hr (by omega) have hr5 : r ^ 5 ≤ (d : ℝ) := by rw [← hr16] exact pow_le_pow_right₀ hr (by omega) have hfirst : 2 * r * L ^ 2 ≤ 578 * d := by calc 2 * r * L ^ 2 ≤ 2 * r * (17 * r) ^ 2 := by gcongr _ = 578 * r ^ 3 := by ring _ ≤ 578 * d := by gcongr have hddiv : (d : ℝ) / m ≤ 8 * L := by apply (div_le_iff₀ hm).2 have hdle : (d : ℝ) ≤ (n : ℝ) * L := (div_le_iff₀ hL).1 hbranch dsimp [m] nlinarith have hsecond : 2 * r * ((d : ℝ) / m) * L ^ 3 ≤ (16 * 17 ^ 4) * d := by calc 2 * r * ((d : ℝ) / m) * L ^ 3 ≤ 2 * r * (8 * L) * L ^ 3 := by gcongr _ = 16 * r * L ^ 4 := by ring _ ≤ 16 * r * (17 * r) ^ 4 := by gcongr _ = (16 * 17 ^ 4) * r ^ 5 := by ring _ ≤ (16 * 17 ^ 4) * d := by gcongr apply (le_div_iff₀ (mul_pos hm hL)).2 change r * (2 * L / m + 2 * d * (L / m) ^ 2) * (m * L) ≤ 2000000 * d have hrearrange : r * (2 * L / m + 2 * d * (L / m) ^ 2) * (m * L) = 2 * r * L ^ 2 + 2 * r * ((d : ℝ) / m) * L ^ 3 := by field_simp rw [hrearrange] nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_raw_scale_le_rate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotAggregate.lean:148
theorem centeredIdealGoodPilotErrorRisk_le_rate

Equation (33) in its advertised rate form. The constant depends only on the fixed overlap level through the preceding Jackson envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
hbranch :
(d : ℝ) / logAlphabet d ≤ n
P :
≤ C * d / (((n : ℝ) / 8) * logAlphabet d)
Proof (Lean source)
-- @node: centeredIdealGoodPilotErrorRisk_le_rate lemma centeredIdealGoodPilotErrorRisk_le_rate (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (hbranch : (d : ℝ) / logAlphabet d ≤ n) (P : DiscreteLaw d), IsProbabilityMeasure (idealCountLaw (n := n) P) → centeredIdealPilotErrorRisk (n := n) epsilon P true ≤ C * d / (((n : ℝ) / 8) * logAlphabet d) := by obtain ⟨C₀, hC₀, hraw⟩ := centeredIdealGoodPilotErrorRisk_le_raw epsilon he he' refine ⟨2000000 * C₀, by positivity, ?_⟩ intro n d hn hd hbranch P hprob calc centeredIdealPilotErrorRisk (n := n) epsilon P true ≤ C₀ * ((d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)) := by simpa [mul_assoc] using hraw hn hd P hprob _ ≤ C₀ * (2000000 * d / (((n : ℝ) / 8) * logAlphabet d)) := by gcongr exact goodPilot_raw_scale_le_rate hn hd hbranch _ = (2000000 * C₀) * d / (((n : ℝ) / 8) * logAlphabet d) := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredIdealGoodPilotErrorRisk_le_rate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotAggregate.lean:221
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.GoodPilotCellMoment 9 declarations Deterministic target correction and full good-pilot cell moments.

Deterministic target correction and full good-pilot cell moments.

theorem measurable_pathSize_run Lemma measurable_pathSize_run in the paper ↗

The promoted measurability of total variation makes the paper's path-size functional Borel measurable on the continuous-path space. The stated relationship holds.

Formal statement
Measurable (pathSize : Path → ℝ)
Proof (Lean source)
-- @node: measurable_pathSize_run lemma measurable_pathSize_run : Measurable (pathSize : Path → ℝ) := by letI : BorelSpace Path := ⟨rfl⟩ unfold pathSize exact continuous_norm.measurable.add measurable_pathTV
CausalSmith.Stat.DiscreteBudgetvalueCurve.measurable_pathSize_run · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:15
theorem measurable_pathSize_sq_add_const Lemma measurable_pathSize_sq_add_const in the paper ↗

Adding a fixed continuous path preserves measurability of squared path size for a measurable random path. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Omega :
Type*
F :
Omega → Path
hF :
g :
Measurable (fun omega => pathSize (F omega + g) ^ 2)
Proof (Lean source)
-- @node: measurable_pathSize_sq_add_const lemma measurable_pathSize_sq_add_const {Omega : Type*} [MeasurableSpace Omega] (F : Omega → Path) (hF : Measurable F) (g : Path) : Measurable (fun omega => pathSize (F omega + g) ^ 2) := by letI : BorelSpace Path := ⟨rfl⟩ exact (measurable_pathSize_run.comp (hF.add measurable_const)).pow_const 2
CausalSmith.Stat.DiscreteBudgetvalueCurve.measurable_pathSize_sq_add_const · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:23

Path size is subadditive on bounded-variation paths. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f g :
hf :
hg :
pathSize (f + g) ≤ pathSize f + pathSize g
Proof (Lean source)
-- @node: pathSize_add_le lemma pathSize_add_le (f g : Path) (hf : eVariationOn f univ < ⊤) (hg : eVariationOn g univ < ⊤) : pathSize (f + g) ≤ pathSize f + pathSize g := by have hvarneg : eVariationOn (fun t => -g t) univ = eVariationOn g univ := by unfold eVariationOn congr 1 with p congr 1 with i show edist (-(g (p.2.1 (i + 1)))) (-(g (p.2.1 i))) = edist (g (p.2.1 (i + 1))) (g (p.2.1 i)) exact edist_neg_neg (G := ℝ) _ _ have hvarneg' : eVariationOn (-g) univ = eVariationOn g univ := by change eVariationOn (fun t => -g t) univ = _ exact hvarneg have hneg : eVariationOn (-g) univ < ⊤ := by rw [hvarneg'] exact hg have hsizeNeg : pathSize (-g) = pathSize g := by unfold pathSize pathTV rw [norm_neg, hvarneg'] have h := pathSize_sub_le f (-g) hf hneg simpa only [sub_neg_eq_add, hsizeNeg] using h

The deterministic threshold discrepancy between a pilot midpoint and the true cell vector, viewed as a path on the threshold interval.

Definition (Lean source)
n d :
ℕ
epsilon :
ℝ
P :
pilot :
Cell → ℕ
j :
Fin d
idealGoodThresholdCorrectionPath epsilon P pilot j :
⟨fun lambda : Time
=> thresholdFunReal epsilon lambda (pilotMidpoint ((n : ℝ) / 8) d pilot)
- thresholdFunReal epsilon lambda (cellVector P j), (thresholdFunReal_continuous_time epsilon (pilotMidpoint ((n : ℝ) / 8) d pilot)).sub (thresholdFunReal_continuous_time epsilon (cellVector P j))⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodThresholdCorrectionPath · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:57
theorem idealGoodThresholdCorrectionPath_bv

The deterministic threshold correction always has finite variation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
P :
pilot :
Cell → ℕ
j :
Fin d
eVariationOn (idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j) univ < ⊤
Proof (Lean source)
-- @node: idealGoodThresholdCorrectionPath_bv lemma idealGoodThresholdCorrectionPath_bv {n d : ℕ} (epsilon : ℝ) (P : DiscreteLaw d) (pilot : Cell → ℕ) (j : Fin d) : eVariationOn (idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j) univ < ⊤ := by let u := pilotMidpoint ((n : ℝ) / 8) d pilot let v := cellVector P j have hlip := (thresholdFunReal_lipschitz_time epsilon u).sub (thresholdFunReal_lipschitz_time epsilon v) have hid : BoundedVariationOn (id : Time → Time) univ := by have hm : Monotone (fun t : Time => (t : ℝ)) := fun s t hst => hst exact MonotoneOn.boundedVariationOn (hm.monotoneOn _) (fun t _ => abs_le.2 ⟨by linarith [t.property.1], t.property.2⟩) apply lt_top_iff_ne_top.mpr simpa [idealGoodThresholdCorrectionPath, u, v, BoundedVariationOn, Function.comp_def] using hlip.comp_boundedVariationOn hid
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodThresholdCorrectionPath_bv · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:70
theorem idealGoodThresholdCorrectionPath_size_le

On a good pilot cell, the deterministic target correction has path size at most an epsilon-dependent constant times the sum of pilot radii. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
idealPilotGood (n := n) P counts j
pathSize (idealGoodThresholdCorrectionPath (n := n) epsilon P (counts.1 j) j)
≤ C * ∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (counts.1 j) zeta
Proof (Lean source)
-- @node: idealGoodThresholdCorrectionPath_size_le lemma idealGoodThresholdCorrectionPath_size_le (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d), ∀ (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d), idealPilotGood (n := n) P counts j → pathSize (idealGoodThresholdCorrectionPath (n := n) epsilon P (counts.1 j) j) ≤ C * ∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (counts.1 j) zeta := by obtain ⟨C₀, hC₀, hthreshold⟩ := thresholdFun_bv_lipschitz epsilon he he' refine ⟨2 * C₀ + 1, by linarith, ?_⟩ intro n d hn hd P counts j hgood let u := pilotMidpoint ((n : ℝ) / 8) d (counts.1 j) let v := cellVector P j let f := idealGoodThresholdCorrectionPath (n := n) epsilon P (counts.1 j) j have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg this] have hu (zeta : Cell) : 0 ≤ u zeta := by dsimp [u, pilotMidpoint] have hlo : 0 ≤ pilotLower ((n : ℝ) / 8) d (counts.1 j) zeta := le_max_left _ _ have hup : 0 ≤ pilotUpper ((n : ℝ) / 8) d (counts.1 j) zeta := by unfold pilotUpper pilotCenter pilotHalfWidth pilotRadiusConstant positivity positivity have hv (zeta : Cell) : 0 ≤ v zeta := ENNReal.toReal_nonneg have hlip := (thresholdFunReal_lipschitz_time epsilon u).sub (thresholdFunReal_lipschitz_time epsilon v) have hid : BoundedVariationOn (id : Time → Time) univ := by have hm : Monotone (fun t : Time => (t : ℝ)) := fun s t hst => hst exact MonotoneOn.boundedVariationOn (hm.monotoneOn _) (fun t _ => abs_le.2 ⟨by linarith [t.property.1], t.property.2⟩) have hfBV : eVariationOn f univ < ⊤ := by apply lt_top_iff_ne_top.mpr simpa [f, idealGoodThresholdCorrectionPath, u, v, BoundedVariationOn, Function.comp_def] using hlip.comp_boundedVariationOn hid have hbv := hthreshold u v hu hv have hdist : (∑ zeta : Cell, |u zeta - v zeta|) ≤ ∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (counts.1 j) zeta := by apply Finset.sum_le_sum intro zeta hzeta simpa [u, v, abs_sub_comm] using idealPilotGood_center_mem_radius hn P counts j hgood zeta have hbase := pathSize_le_two_endpointVariation f hfBV have heq : |f timeZero| + pathTV f = bvNorm (fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v) := by change |thresholdFunReal epsilon 0 u - thresholdFunReal epsilon 0 v| + (eVariationOn (fun lambda : Time => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v) univ).toReal = _ unfold bvNorm congr 1 exact congrArg toReal (eVariationOn_time_eq_Icc (fun lambda : ℝ => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v)) rw [heq] at hbase have hCdist := (hbv.trans (mul_le_mul_of_nonneg_left hdist hC₀)) have hS : 0 ≤ ∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (counts.1 j) zeta := Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by positivity) (show 1 ≤ d by omega) (counts.1 j) z).le nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodThresholdCorrectionPath_size_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:88
theorem idealGoodCellErrorPath_eq_factorial_add_correction

With a fixed good pilot table, the complete ideal cell-error path is the sum of its factorial evaluation path and deterministic target correction. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p e :
(Fin d × Fin 4) → ℕ
j :
Fin d
hgood :
pilot :
W :
fun i table => poissonTableCell j table i (: Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ)
hpull :
fun lambda
=> pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda
= localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W ((n : ℝ) / 8) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) e
+ idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j
Proof (Lean source)
-- @node: idealGoodCellErrorPath_eq_factorial_add_correction lemma idealGoodCellErrorPath_eq_factorial_add_correction {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p e : (Fin d × Fin 4) → ℕ) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, curryCountTable e) j) : let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i table => poissonTableCell j table i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda idealPilotErrorCellPath epsilon P (curryCountTable p, curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable p, curryCountTable e) j true) = localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W ((n : ℝ) / 8) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) e + idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j := by dsimp only let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i table => poissonTableCell j table i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda ext lambda have hstat := jacksonCellStatistic_eq_localJacksonFourPoissonFactorialPath epsilon ((n : ℝ) / 8) d pilot W (by unfold jacksonDegree; omega) hpull e lambda have heval : (fun zeta => W (CellFourEquiv zeta) e) = curryCountTable e j := by funext zeta rfl rw [heval] at hstat change idealPilotErrorCell (n := n) epsilon lambda P (curryCountTable p, curryCountTable e) j true = _ simp only [idealPilotErrorCell, hgood, if_pos, ContinuousMap.add_apply] change jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d pilot (curryCountTable e j) - thresholdFunReal epsilon lambda (cellVector P j) = _ change _ = localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) _ hpull _ W ((n : ℝ) / 8) _ e lambda + (thresholdFunReal epsilon lambda (pilotMidpoint ((n : ℝ) / 8) d pilot) - thresholdFunReal epsilon lambda (cellVector P j)) linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodCellErrorPath_eq_factorial_add_correction · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:159
theorem idealGoodCellErrorPath_size_le

Pointwise on a good pilot cell, the complete ideal error path is bounded by the factorial path size plus an epsilon-dependent radius-sum correction. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
p e :
(Fin d × Fin 4) → ℕ
j :
Fin d
hgood :
∃ C : ℝ,
0 < C
conclusion 1
pilot :
W :
fun i table => poissonTableCell j table i (: Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ)
hpull :
fun lambda
=> pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda
≤ pathSize (localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W ((n : ℝ) / 8) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) e)
+ C * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta
Proof (Lean source)
-- @node: idealGoodCellErrorPath_size_le lemma idealGoodCellErrorPath_size_le {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p e : (Fin d × Fin 4) → ℕ) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, curryCountTable e) j) : ∃ C : ℝ, 0 < C ∧ let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i table => poissonTableCell j table i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda pathSize (idealPilotErrorCellPath epsilon P (curryCountTable p, curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable p, curryCountTable e) j true)) ≤ pathSize (localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W ((n : ℝ) / 8) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) e) + C * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta := by obtain ⟨C, hC, hcorr⟩ := idealGoodThresholdCorrectionPath_size_le epsilon he he' have hcorr := hcorr hn hd P (curryCountTable p, curryCountTable e) j hgood refine ⟨C, hC, ?_⟩ dsimp only let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i table => poissonTableCell j table i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda let fact := localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W ((n : ℝ) / 8) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) e let corr := idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j have hgood0 : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j := by simpa [idealPilotGood] using hgood have hpkg := goodPilot_localJacksonFourPoissonFactorialPath_sq_bound epsilon he hn hd P p j hgood0 have hfactBV : eVariationOn fact univ < ⊤ := by simpa [fact, pilot, W, hpull] using hpkg.2.1 e have hcorrBV : eVariationOn corr univ < ⊤ := by exact idealGoodThresholdCorrectionPath_bv epsilon P pilot j have hadd := pathSize_add_le fact corr hfactBV hcorrBV have heq := idealGoodCellErrorPath_eq_factorial_add_correction epsilon he hn hd P p e j hgood rw [heq] have hc : pathSize fact + pathSize corr ≤ pathSize fact + C * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta := by have := add_le_add_right (by simpa [corr, pilot] using hcorr) (pathSize fact) simpa [add_comm] using this exact hadd.trans (by simpa [fact, pilot, W, hpull] using hc)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodCellErrorPath_size_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:210
theorem goodPilot_fullCellErrorPath_sq_integral_le

Conditional on a fixed good pilot table, the full cell-error path has the paper's equation (21) squared path-size scale. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → ℕ
j :
Fin d
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (curryCountTable p j) zeta) ^ 2
Proof (Lean source)
-- @node: goodPilot_fullCellErrorPath_sq_integral_le lemma goodPilot_fullCellErrorPath_sq_integral_le (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d), ∀ (p : (Fin d × Fin 4) → ℕ) (j : Fin d), idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j → let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) Integrable (fun e => pathSize (idealPilotErrorCellPath epsilon P (curryCountTable p, curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable p, curryCountTable e) j true)) ^ 2) mu ∧ (∫ e, pathSize (idealPilotErrorCellPath epsilon P (curryCountTable p, curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable p, curryCountTable e) j true)) ^ 2 ∂mu) ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (curryCountTable p j) zeta) ^ 2 := by obtain ⟨Ccoef, hCcoef, hcoef⟩ := jacksonCoefficientBV_pilot_le epsilon he he' obtain ⟨Cc, hCc, hcorrAll⟩ := idealGoodThresholdCorrectionPath_size_le epsilon he he' let Cf : ℝ := 4 * Ccoef ^ 2 * exp 123 refine ⟨2 * Cf + 2 * Cc ^ 2, by dsimp [Cf]; positivity, ?_⟩ intro n d hn hd P p j hgood let m : ℝ := (n : ℝ) / 8 let pilot := curryCountTable p j let S : ℝ := ∑ zeta : Cell, pilotRadius m d pilot zeta let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i table => poissonTableCell j table i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) he (by positivity) (show 1 ≤ d by omega) pilot lambda let fact : ((Fin d × Fin 4) → ℕ) → Path := fun e => localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W m ((d : ℝ) ^ (1 / 4 : ℝ) * S) e let corr : Path := idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j let err : ((Fin d × Fin 4) → ℕ) → Path := fun e => idealPilotErrorCellPath epsilon P (curryCountTable p, curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable p, curryCountTable e) j true) let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw] infer_instance have hfactBound := goodPilot_localJacksonFourPoissonFactorialPath_sq_integral_le epsilon he hn hd P p j hgood Ccoef hCcoef.le (hcoef ((n : ℝ) / 8) (by positivity) d (by omega) (curryCountTable p j)) have hCf : 0 < Cf := by dsimp [Cf]; positivity have hgood0 : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j := hgood have hcorrBound := hcorrAll hn hd P (curryCountTable p, fun _ _ => 0) j hgood0 have hpkg := goodPilot_localJacksonFourPoissonFactorialPath_sq_bound epsilon he hn hd P p j hgood have hfactMeas : Measurable fact := by simpa [fact, m, pilot, S, W, hpull, mu] using hpkg.1 have hfactBV (e) : eVariationOn (fact e) univ < ⊤ := by simpa [fact, m, pilot, S, W, hpull, mu] using hpkg.2.1 e have hfactInt : Integrable (fun e => pathSize (fact e) ^ 2) mu := by simpa [fact, m, pilot, S, W, hpull, mu] using hpkg.2.2 have hcorrBV : eVariationOn corr univ < ⊤ := by exact idealGoodThresholdCorrectionPath_bv epsilon P pilot j have hcorrSize : pathSize corr ≤ Cc * S := by simpa [corr, S, m, pilot] using hcorrBound have herrEq (e) : err e = fact e + corr := by simpa [err, fact, corr, m, pilot, S, W, hpull] using (idealGoodCellErrorPath_eq_factorial_add_correction epsilon he hn hd P p e j (by simpa [idealPilotGood] using hgood)) have herrMeas : Measurable err := by letI : BorelSpace Path := ⟨rfl⟩ rw [show err = fun e => fact e + corr by funext e exact herrEq e] exact hfactMeas.add measurable_const have herrSqMeas : Measurable (fun e => pathSize (err e) ^ 2) := (measurable_pathSize_run.comp herrMeas).pow_const 2 have hpoint (e) : pathSize (err e) ^ 2 ≤ 2 * pathSize (fact e) ^ 2 + 2 * (Cc * S) ^ 2 := by have hsize : pathSize (err e) ≤ pathSize (fact e) + Cc * S := by rw [herrEq] exact (pathSize_add_le (fact e) corr (hfactBV e) hcorrBV).trans (add_le_add_right hcorrSize _) have hnonneg : 0 ≤ pathSize (err e) := pathSize_nonneg _ have hright : 0 ≤ pathSize (fact e) + Cc * S := hnonneg.trans hsize have hsquare : pathSize (err e) ^ 2 ≤ (pathSize (fact e) + Cc * S) ^ 2 := (sq_le_sq₀ hnonneg hright).2 hsize nlinarith [sq_nonneg (pathSize (fact e) - Cc * S), hsquare] have henvInt : Integrable (fun e => 2 * pathSize (fact e) ^ 2 + 2 * (Cc * S) ^ 2) mu := (hfactInt.const_mul 2).add (integrable_const _) have herrInt : Integrable (fun e => pathSize (err e) ^ 2) mu := by apply henvInt.mono' herrSqMeas.aestronglyMeasurable filter_upwards [] with e rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact hpoint e refine ⟨by simpa [err] using herrInt, ?_⟩ change (∫ e, pathSize (err e) ^ 2 ∂mu) ≤ (2 * Cf + 2 * Cc ^ 2) * (d : ℝ) ^ (1 / 16 : ℝ) * S ^ 2 have hint := integral_mono herrInt henvInt hpoint have hfactBound' : (∫ e, pathSize (fact e) ^ 2 ∂mu) ≤ Cf * (d : ℝ) ^ (1 / 16 : ℝ) * S ^ 2 := by simpa [fact, m, pilot, S, W, hpull, mu] using hfactBound have hdpow : 1 ≤ (d : ℝ) ^ (1 / 16 : ℝ) := Real.one_le_rpow (by exact_mod_cast (show 1 ≤ d by omega)) (by norm_num) calc (∫ e, pathSize (err e) ^ 2 ∂mu) ≤ ∫ e, (2 * pathSize (fact e) ^ 2 + 2 * (Cc * S) ^ 2) ∂mu := hint _ = 2 * (∫ e, pathSize (fact e) ^ 2 ∂mu) + 2 * (Cc * S) ^ 2 := by rw [integral_add, integral_const_mul, integral_const, probReal_univ, one_smul] · exact hfactInt.const_mul 2 · exact integrable_const _ _ ≤ 2 * (Cf * (d : ℝ) ^ (1 / 16 : ℝ) * S ^ 2) + 2 * (Cc * S) ^ 2 := by gcongr _ ≤ (2 * Cf + 2 * Cc ^ 2) * (d : ℝ) ^ (1 / 16 : ℝ) * S ^ 2 := by have hS2 : 0 ≤ S ^ 2 := sq_nonneg S nlinarith [mul_le_mul_of_nonneg_right hdpow (sq_nonneg Cc)]
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_fullCellErrorPath_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellMoment.lean:275
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.GoodPilotCellOuterMoment 21 declarations Block-local composition and unconditional good-pilot cell moments.

Block-local composition and unconditional good-pilot cell moments.

Boolean reflection of the paper's cellwise good-pilot event.

Definition (Lean source)
n d :
ℕ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
idealPilotGoodBool P counts j :
by classical exact decide (idealPilotGood (n := n) P counts j)
theorem idealPilotGoodBool_eq_true

The Boolean good-pilot event reflects the propositional definition. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
idealPilotGoodBool (n := n) P counts j = true ↔ idealPilotGood (n := n) P counts j
Proof (Lean source)
-- @node: idealPilotGoodBool_eq_true lemma idealPilotGoodBool_eq_true {n d : ℕ} (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) : idealPilotGoodBool (n := n) P counts j = true ↔ idealPilotGood (n := n) P counts j := by classical simp [idealPilotGoodBool]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGoodBool_eq_true · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:24

Embed four counts into one cell of a flattened count table.

Definition (Lean source)
d :
ℕ
j :
Fin d
u :
Fin 4 → ℕ
singleCellCountTable j u :
(Fin d × Fin 4) → ℕ
fun iz => if iz.1 = j then u iz.2 else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.singleCellCountTable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:33
theorem poissonTableCell_singleCellCountTable

Extracting the embedded cell recovers its four counts. The cell extraction identity follows.

Formal statement
d :
ℕ
j :
Fin d
u :
Fin 4 → ℕ
Proof (Lean source)
-- @node: poissonTableCell_singleCellCountTable @[simp] lemma poissonTableCell_singleCellCountTable {d : ℕ} (j : Fin d) (u : Fin 4 → ℕ) : poissonTableCell j (singleCellCountTable j u) = u := by funext i simp [poissonTableCell, singleCellCountTable]
CausalSmith.Stat.DiscreteBudgetvalueCurve.poissonTableCell_singleCellCountTable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:38
theorem curryCountTable_eq_at_of_poissonTableCell_eq

At the selected cell, currying a table depends only on its extracted four-count block. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
j :
Fin d
p q :
(Fin d × Fin 4) → ℕ
Proof (Lean source)
-- @node: curryCountTable_eq_of_poissonTableCell_eq lemma curryCountTable_eq_at_of_poissonTableCell_eq {d : ℕ} (j : Fin d) (p q : (Fin d × Fin 4) → ℕ) (h : poissonTableCell j p = poissonTableCell j q) : curryCountTable p j = curryCountTable q j := by funext z exact congrFun h (CellFourEquiv z)
CausalSmith.Stat.DiscreteBudgetvalueCurve.curryCountTable_eq_at_of_poissonTableCell_eq · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:45
theorem idealPilotGood_singleCell_iff

The paper's good-pilot predicate is local to the selected four-count pilot block. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
j :
Fin d
p :
(Fin d × Fin 4) → ℕ
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
↔ idealPilotGood (n := n) P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), fun _ _ => 0) j
Proof (Lean source)
-- @node: idealPilotGood_singleCell_iff lemma idealPilotGood_singleCell_iff {n d : ℕ} (P : DiscreteLaw d) (j : Fin d) (p : (Fin d × Fin 4) → ℕ) : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j ↔ idealPilotGood (n := n) P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), fun _ _ => 0) j := by unfold idealPilotGood have hcell : curryCountTable p j = curryCountTable (singleCellCountTable j (poissonTableCell j p)) j := by apply curryCountTable_eq_at_of_poissonTableCell_eq simp change (∀ zeta : Cell, |pilotCenter ((n : ℝ) / 8) (curryCountTable p j) zeta - cellVector P j zeta| ≤ pilotHalfWidth ((n : ℝ) / 8) d (curryCountTable p j) zeta / 4) ↔ ∀ zeta : Cell, |pilotCenter ((n : ℝ) / 8) (curryCountTable (singleCellCountTable j (poissonTableCell j p)) j) zeta - cellVector P j zeta| ≤ pilotHalfWidth ((n : ℝ) / 8) d (curryCountTable (singleCellCountTable j (poissonTableCell j p)) j) zeta / 4 rw [hcell]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood_singleCell_iff · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:54
theorem idealPilotErrorCellPath_singleCell_local

Replacing both flattened tables by their selected-cell embeddings leaves the selected ideal cell-error path unchanged. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Proof (Lean source)
-- @node: idealPilotErrorCellPath_singleCell_local lemma idealPilotErrorCellPath_singleCell_local {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (p e : (Fin d × Fin 4) → ℕ) (j : Fin d) : idealPilotErrorCellPath epsilon P (curryCountTable p, curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P (curryCountTable p, curryCountTable e) j true) = idealPilotErrorCellPath epsilon P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), curryCountTable (singleCellCountTable j (poissonTableCell j e))) j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), curryCountTable (singleCellCountTable j (poissonTableCell j e))) j true) := by apply ContinuousMap.ext intro lambda change idealPilotErrorCell (n := n) epsilon lambda P (curryCountTable p, curryCountTable e) j true = idealPilotErrorCell (n := n) epsilon lambda P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), curryCountTable (singleCellCountTable j (poissonTableCell j e))) j true have hp : curryCountTable p j = curryCountTable (singleCellCountTable j (poissonTableCell j p)) j := by apply curryCountTable_eq_at_of_poissonTableCell_eq simp have heval : curryCountTable e j = curryCountTable (singleCellCountTable j (poissonTableCell j e)) j := by apply curryCountTable_eq_at_of_poissonTableCell_eq simp unfold idealPilotErrorCell idealPilotGood simp only [hp, heval]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotErrorCellPath_singleCell_local · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:79
theorem flatGoodPilotCellPath_sq_integral_le

Under the two flattened Poisson table laws, the indicator-weighted full good-pilot cell path has the unconditional equation (21) moment scale. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → ℝ≥0)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
Integrable (fun pe => (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0)) (mu.prod mu)
(∫ pe, (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0) ∂mu.prod mu)
≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2
Proof (Lean source)
-- @node: flatGoodPilotCellPath_sq_integral_le lemma flatGoodPilotCellPath_sq_integral_le (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d), ∀ j : Fin d, let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) Integrable (fun pe => (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0)) (mu.prod mu) ∧ (∫ pe, (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0) ∂mu.prod mu) ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2 := by classical obtain ⟨C₀, hC₀, hsectionUniform⟩ := goodPilot_fullCellErrorPath_sq_integral_le epsilon he he' refine ⟨32 * pilotRadiusConstant ^ 2 * C₀, by unfold pilotRadiusConstant positivity, ?_⟩ intro n d hn hd P j dsimp only let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let good : (Fin 4 → ℕ) → Bool := fun u => decide (idealPilotGood (n := n) P (curryCountTable (singleCellCountTable j u), fun _ _ => 0) j) let phi : (Fin 4 → ℕ) → (Fin 4 → ℕ) → ℝ := fun u v => pathSize (idealPilotErrorCellPath epsilon P (curryCountTable (singleCellCountTable j u), curryCountTable (singleCellCountTable j v)) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable (singleCellCountTable j u), curryCountTable (singleCellCountTable j v)) j true)) ^ 2 let bound : ((Fin d × Fin 4) → ℕ) → ℝ := fun p => C₀ * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (curryCountTable p j) zeta) ^ 2 have hgoodMeas : Measurable good := measurable_of_countable _ have hphiMeas : Measurable (uncurry phi) := measurable_of_countable _ have hphiNonneg (u v) : 0 ≤ phi u v := by dsimp [phi]; positivity have hsectionInt (p : (Fin d × Fin 4) → ℕ) : Integrable (fun e : (Fin d × Fin 4) → ℕ => if good (poissonTableCell j p) then phi (poissonTableCell j p) (poissonTableCell j e) else 0) mu := by by_cases hg : good (poissonTableCell j p) = true · simp only [hg, if_true] have hprop : idealPilotGood (n := n) P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), fun _ _ => 0) j := by simpa [good] using hg have hpkg := hsectionUniform hn hd P (singleCellCountTable j (poissonTableCell j p)) j hprop have hi := hpkg.1 apply hi.congr filter_upwards [] with e dsimp [phi] rw [idealPilotErrorCellPath_singleCell_local epsilon he hn (show 1 ≤ d by omega) P (singleCellCountTable j (poissonTableCell j p)) e j] simp · have hg' : good (poissonTableCell j p) = false := Bool.eq_false_of_not_eq_true hg simp [hg'] have hradius := pilotRadius_sum_sq_integral_le_cellScale hn hd P j have hboundInt : Integrable bound mu := by exact hradius.1.const_mul (C₀ * (d : ℝ) ^ (1 / 16 : ℝ)) have hsectionBound (p : (Fin d × Fin 4) → ℕ) : (∫ e : (Fin d × Fin 4) → ℕ, (if good (poissonTableCell j p) then phi (poissonTableCell j p) (poissonTableCell j e) else 0) ∂mu) ≤ bound p := by by_cases hg : good (poissonTableCell j p) = true · simp only [hg, if_true] have hprop : idealPilotGood (n := n) P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), fun _ _ => 0) j := by simpa [good] using hg have hpkg := hsectionUniform hn hd P (singleCellCountTable j (poissonTableCell j p)) j hprop have heq : (∫ e, phi (poissonTableCell j p) (poissonTableCell j e) ∂mu) = ∫ e, pathSize (idealPilotErrorCellPath epsilon P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), curryCountTable e) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable (singleCellCountTable j (poissonTableCell j p)), curryCountTable e) j true)) ^ 2 ∂mu := by apply integral_congr_ae filter_upwards [] with e dsimp [phi] rw [idealPilotErrorCellPath_singleCell_local epsilon he hn (show 1 ≤ d by omega) P (singleCellCountTable j (poissonTableCell j p)) e j] simp rw [heq] have hcell : curryCountTable (singleCellCountTable j (poissonTableCell j p)) j = curryCountTable p j := by symm apply curryCountTable_eq_at_of_poissonTableCell_eq simp simpa [bound, mu, rate, hcell] using hpkg.2 · have hg' : good (poissonTableCell j p) = false := Bool.eq_false_of_not_eq_true hg simp only [hg', Bool.false_eq_true, if_false, integral_zero] dsimp [bound] exact mul_nonneg (mul_nonneg hC₀.le (Real.rpow_nonneg (by positivity) _)) (sq_nonneg _) have hflat := poissonTable_cell_nonneg_integral_le_of_sections rate rate j good hgoodMeas phi hphiMeas hphiNonneg hsectionInt bound hboundInt hsectionBound have hidentify (pe : ((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) : (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0) = (if good (poissonTableCell j pe.1) then phi (poissonTableCell j pe.1) (poissonTableCell j pe.2) else 0) := by have hiff := idealPilotGood_singleCell_iff (n := n) P j pe.1 by_cases hg : idealPilotGood (n := n) P (curryCountTable pe.1, fun _ _ => 0) j · have hgb : good (poissonTableCell j pe.1) = true := by simp [good, hiff.mp hg] have hgoodBool : idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j = true := (idealPilotGoodBool_eq_true P _ j).2 hg simp only [hgoodBool, hgb, if_true] dsimp [phi] rw [← idealPilotErrorCellPath_singleCell_local epsilon he hn (show 1 ≤ d by omega) P pe.1 pe.2 j] · have hgb : good (poissonTableCell j pe.1) = false := by have hcanon : ¬ idealPilotGood (n := n) P (curryCountTable (singleCellCountTable j (poissonTableCell j pe.1)), fun _ _ => 0) j := fun hc => hg (hiff.mpr hc) simp [good, hcanon] have hgoodBool : idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P _ j).1 ht) simp [hgoodBool, hgb] let f : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) → ℝ := fun pe => if good (poissonTableCell j pe.1) then phi (poissonTableCell j pe.1) (poissonTableCell j pe.2) else 0 have hfMeas : Measurable f := poissonTable_cell_indicator_measurable j good hgoodMeas phi hphiMeas have hfNonneg (pe) : 0 ≤ f pe := by dsimp [f] split_ifs <;> simp [hphiNonneg] have hnorm : (fun p => ∫ e, ‖f (p, e)‖ ∂mu) = (fun p => ∫ e, f (p, e) ∂mu) := by funext p congr 1 funext e rw [Real.norm_eq_abs, abs_of_nonneg (hfNonneg (p, e))] have houter : Integrable (fun p => ∫ e, ‖f (p, e)‖ ∂mu) mu := by letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance rw [hnorm] apply integrable_of_le_of_le (g₁ := fun _ => (0 : ℝ)) (g₂ := bound) · exact hfMeas.stronglyMeasurable.integral_prod_right'.aestronglyMeasurable · exact Filter.Eventually.of_forall fun p => integral_nonneg fun e => hfNonneg (p, e) · exact Filter.Eventually.of_forall hsectionBound · exact integrable_const 0 · exact hboundInt have hfInt : Integrable f (mu.prod mu) := (integrable_prod_iff hfMeas.aestronglyMeasurable).2 ⟨Filter.Eventually.of_forall hsectionInt, houter⟩ have horigInt : Integrable (fun pe => (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0)) (mu.prod mu) := by apply hfInt.congr exact Filter.Eventually.of_forall fun pe => (hidentify pe).symm refine ⟨horigInt, ?_⟩ calc _ = ∫ pe, (if good (poissonTableCell j pe.1) then phi (poissonTableCell j pe.1) (poissonTableCell j pe.2) else 0) ∂mu.prod mu := by apply integral_congr_ae exact Filter.Eventually.of_forall hidentify _ ≤ ∫ p, bound p ∂mu := hflat _ ≤ (32 * pilotRadiusConstant ^ 2 * C₀) * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2 := by rw [show (∫ p, bound p ∂mu) = (C₀ * (d : ℝ) ^ (1 / 16 : ℝ)) * ∫ p, (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d (curryCountTable p j) zeta) ^ 2 ∂mu by rw [integral_const_mul] ] have hcoef : 0 ≤ C₀ * (d : ℝ) ^ (1 / 16 : ℝ) := by positivity have := mul_le_mul_of_nonneg_left hradius.2 hcoef nlinarith [sq_nonneg (badPilotCellScale (n := n) P j)]
CausalSmith.Stat.DiscreteBudgetvalueCurve.flatGoodPilotCellPath_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:115
theorem idealGoodPilotCellPath_sq_integral_le

Pushing the flattened product experiment through the count-table equivalence gives the unconditional full good-pilot cell moment under the paper's idealCountLaw. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
Integrable (fun counts => pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2) (idealCountLaw (n := n) P)
(∫ counts, (if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 else 0) ∂idealCountLaw (n := n) P)
≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2
Proof (Lean source)
-- @node: idealGoodPilotCellPath_sq_integral_le lemma idealGoodPilotCellPath_sq_integral_le (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d), ∀ j : Fin d, Integrable (fun counts => pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2) (idealCountLaw (n := n) P) ∧ (∫ counts, (if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 else 0) ∂idealCountLaw (n := n) P) ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2 := by classical obtain ⟨C, hC, hflat⟩ := flatGoodPilotCellPath_sq_integral_le epsilon he he' refine ⟨C, hC, ?_⟩ intro n d hn hd P j have hflatj := hflat hn hd P j let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let F : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) → (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ) := fun pe => (curryCountTable pe.1, curryCountTable pe.2) let g : ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → ℝ := fun counts => if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 else 0 have hF : Measurable F := by fun_prop have hg : Measurable g := measurable_of_countable _ have hmap : Measure.map F (mu.prod mu) = idealCountLaw (n := n) P := by simpa [F, mu, rate] using map_flatIdealCountLaw (n := n) P have hintegral : (∫ counts, g counts ∂idealCountLaw (n := n) P) = ∫ pe, g (F pe) ∂mu.prod mu := by rw [← hmap, integral_map hF.aemeasurable hg.aestronglyMeasurable] rw [show (∫ counts, (if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 else 0) ∂idealCountLaw (n := n) P) = ∫ counts, g counts ∂idealCountLaw (n := n) P by rfl] rw [hintegral] have hpoint (pe : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ))) : g (F pe) = (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0) := by dsimp [g, F] have hgood : idealPilotGood (n := n) P (curryCountTable pe.1, curryCountTable pe.2) j ↔ idealPilotGood (n := n) P (curryCountTable pe.1, fun _ _ => 0) j := by rfl by_cases hp : idealPilotGood (n := n) P (curryCountTable pe.1, curryCountTable pe.2) j · have hp0 := hgood.mp hp have hb : idealPilotGoodBool (n := n) P (curryCountTable pe.1, curryCountTable pe.2) j = true := (idealPilotGoodBool_eq_true P _ j).2 hp have hb0 : idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j = true := (idealPilotGoodBool_eq_true P _ j).2 hp0 simp [hb, hb0] · have hp0 : ¬ idealPilotGood (n := n) P (curryCountTable pe.1, fun _ _ => 0) j := fun h => hp (hgood.mpr h) have hb : idealPilotGoodBool (n := n) P (curryCountTable pe.1, curryCountTable pe.2) j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hp ((idealPilotGoodBool_eq_true P _ j).1 ht) have hb0 : idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hp0 ((idealPilotGoodBool_eq_true P _ j).1 ht) simp [hb, hb0] have hcompInt : Integrable (g ∘ F) (mu.prod mu) := by apply hflatj.1.congr exact Filter.Eventually.of_forall fun pe => (hpoint pe).symm have hgMapInt : Integrable g (Measure.map F (mu.prod mu)) := (integrable_map_measure hg.aestronglyMeasurable hF.aemeasurable).2 hcompInt have hgIdealInt : Integrable g (idealCountLaw (n := n) P) := by rw [← hmap] exact hgMapInt have hpathInt : Integrable (fun counts => pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2) (idealCountLaw (n := n) P) := by apply hgIdealInt.congr exact Filter.Eventually.of_forall fun counts => by dsimp [g] by_cases hgood : idealPilotGood (n := n) P counts j · have hb := (idealPilotGoodBool_eq_true P counts j).2 hgood simp [hb] · have hb : idealPilotGoodBool (n := n) P counts j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hgood ((idealPilotGoodBool_eq_true P counts j).1 ht) have hz : idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true) = 0 := by apply ContinuousMap.ext intro lambda simp [idealPilotErrorCellPath, idealPilotErrorCell, hgood] rw [hz] simp [hb, pathSize, pathTV, eVariationOn] refine ⟨hpathInt, ?_⟩ calc (∫ pe, g (F pe) ∂mu.prod mu) = ∫ pe, (if idealPilotGoodBool (n := n) P (curryCountTable pe.1, fun _ _ => 0) j then pathSize (idealPilotErrorCellPath epsilon P (curryCountTable pe.1, curryCountTable pe.2) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable pe.1, curryCountTable pe.2) j true)) ^ 2 else 0) ∂mu.prod mu := by apply integral_congr_ae exact Filter.Eventually.of_forall hpoint _ ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2 := by simpa [mu, rate] using hflatj.2
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:329
theorem idealGoodPilotCellPath_sq_eq_indicator

Outside the good-pilot event, the good = true cell path is the zero path; hence its squared path size equals its indicator-weighted version. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
= if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j true)) ^ 2 else 0
Proof (Lean source)
-- @node: idealGoodPilotCellPath_sq_eq_indicator lemma idealGoodPilotCellPath_sq_eq_indicator {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) : pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j true)) ^ 2 = if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j true)) ^ 2 else 0 := by classical by_cases hg : idealPilotGood (n := n) P counts j · have hb := (idealPilotGoodBool_eq_true P counts j).2 hg simp [hb] · have hb : idealPilotGoodBool (n := n) P counts j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P counts j).1 ht) have hz : idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j true) = 0 := by apply ContinuousMap.ext intro lambda simp [idealPilotErrorCellPath, idealPilotErrorCell, hg] rw [hz] simp [hb, pathSize, pathTV, eVariationOn]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_sq_eq_indicator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:461
theorem eVariationOn_path_add_lt_top Lemma eVariationOn_path_add_lt_top in the paper ↗

A sum of two finite-variation continuous paths again has finite extended variation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f g :
hf :
hg :
eVariationOn (f + g) univ < ⊤
Proof (Lean source)
-- @node: eVariationOn_path_add_lt_top lemma eVariationOn_path_add_lt_top (f g : Path) (hf : eVariationOn f univ < ⊤) (hg : eVariationOn g univ < ⊤) : eVariationOn (f + g) univ < ⊤ := by have hnegEq : eVariationOn (-g) univ = eVariationOn g univ := by unfold eVariationOn congr 1 with p congr 1 with i exact edist_neg_neg (G := ℝ) _ _ have hnegEq' : eVariationOn (-g) univ = eVariationOn g univ := by change eVariationOn (fun t => -g t) univ = _ exact hnegEq have hneg : eVariationOn (-g) univ < ⊤ := by rw [hnegEq']; exact hg have hle := eVariationOn_path_sub_le f (-g) rw [sub_neg_eq_add] at hle exact hle.trans_lt (ENNReal.add_lt_top.mpr ⟨hf, hneg⟩)
CausalSmith.Stat.DiscreteBudgetvalueCurve.eVariationOn_path_add_lt_top · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:489
theorem idealGoodPilotCellPath_bv

Every realization of the good-pilot cell path has finite variation: it is zero off the good event and factorial path plus correction on that event. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
eVariationOn (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) univ < ⊤
Proof (Lean source)
-- @node: idealGoodPilotCellPath_bv lemma idealGoodPilotCellPath_bv {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) : eVariationOn (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) univ < ⊤ := by classical by_cases hgood : idealPilotGood (n := n) P counts j · let p := flattenCountTable counts.1 let e := flattenCountTable counts.2 have hp : curryCountTable p = counts.1 := by exact (countTableEquiv d).right_inv counts.1 have heval : curryCountTable e = counts.2 := by exact (countTableEquiv d).right_inv counts.2 have hgoodFlat : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j := by simpa [hp, idealPilotGood] using hgood have hpkg := goodPilot_localJacksonFourPoissonFactorialPath_sq_bound epsilon he hn hd P p j hgoodFlat let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → ℕ) → ℕ := fun i table => poissonTableCell j table i let hpull := fun lambda => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := (n : ℝ) / 8) he (by positivity) (show 1 ≤ d by omega) pilot lambda let fact := localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint ((n : ℝ) / 8) d pilot) (pilotRadius ((n : ℝ) / 8) d pilot) (by unfold jacksonDegree; omega) hpull (le_refl _) W ((n : ℝ) / 8) ((d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta, pilotRadius ((n : ℝ) / 8) d pilot zeta) e let corr := idealGoodThresholdCorrectionPath (n := n) epsilon P pilot j have hfact : eVariationOn fact univ < ⊤ := by simpa [fact, pilot, W, hpull] using hpkg.2.1 e have hcorr : eVariationOn corr univ < ⊤ := idealGoodThresholdCorrectionPath_bv epsilon P pilot j have heq := idealGoodCellErrorPath_eq_factorial_add_correction epsilon he hn hd P p e j (by simpa [hp, heval] using hgood) have hpathEq : idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true) = fact + corr := by simpa [p, e, hp, heval, fact, corr, pilot, W, hpull] using heq rw [hpathEq] exact eVariationOn_path_add_lt_top fact corr hfact hcorr · have hz : idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true) = 0 := by apply ContinuousMap.ext intro lambda simp [idealPilotErrorCellPath, idealPilotErrorCell, hgood] rw [hz] simp [eVariationOn]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_bv · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:508
theorem idealGoodPilotCellPath_ae_bv

The pointwise finite-variation result supplies the almost-everywhere BV hypothesis used by the centered maximal theorem. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
∀ᵐ counts ∂idealCountLaw (n := n) P, eVariationOn (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) univ < ⊤
Proof (Lean source)
-- @node: idealGoodPilotCellPath_ae_bv lemma idealGoodPilotCellPath_ae_bv {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : ∀ᵐ counts ∂idealCountLaw (n := n) P, eVariationOn (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) univ < ⊤ := Filter.Eventually.of_forall fun counts => idealGoodPilotCellPath_bv epsilon he hn hd P counts j
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_ae_bv · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:565
theorem idealGoodPilotCellPath_measurable

For a fixed cell, the ideal good-pilot error is a measurable random continuous path under the count-table sigma algebra. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
Measurable (fun counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j true))
Proof (Lean source)
-- @node: idealGoodPilotCellPath_measurable lemma idealGoodPilotCellPath_measurable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) : Measurable (fun counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn hd P counts j true)) := by exact measurable_of_countable _
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_measurable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:578
theorem idealGoodPilotCellPath_sq_integrable

The unconditional equation (21) theorem exports square-path-size integrability in the exact form required by the maximal inequality. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
Integrable (fun counts => pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealGoodPilotCellPath_sq_integrable lemma idealGoodPilotCellPath_sq_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : Integrable (fun counts => pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2) (idealCountLaw (n := n) P) := by obtain ⟨C, hC, hall⟩ := idealGoodPilotCellPath_sq_integral_le epsilon he he' exact (hall hn hd P j).1
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_sq_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:588
theorem idealGoodPilotCellPath_integrable

Square-path-size integrability implies Bochner integrability of the good-pilot random path. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
hprob :
j :
Fin d
Integrable (fun counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealGoodPilotCellPath_integrable lemma idealGoodPilotCellPath_integrable {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) (j : Fin d) : Integrable (fun counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) (idealCountLaw (n := n) P) := by letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := hprob letI : BorelSpace Path := ⟨rfl⟩ let F := fun counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true) have hsq : Integrable (fun counts => pathSize (F counts) ^ 2) (idealCountLaw (n := n) P) := by simpa [F] using idealGoodPilotCellPath_sq_integrable epsilon he he' hn hd P j have henv : Integrable (fun counts => 1 + pathSize (F counts) ^ 2) (idealCountLaw (n := n) P) := (integrable_const 1).add hsq apply henv.mono' (idealGoodPilotCellPath_measurable epsilon he hn (show 1 ≤ d by omega) P j).aestronglyMeasurable filter_upwards [] with counts change ‖F counts‖ ≤ 1 + pathSize (F counts) ^ 2 have hnorm : ‖F counts‖ ≤ pathSize (F counts) := by unfold pathSize exact le_add_of_nonneg_right (pathTV_nonneg _) have hsize := pathSize_nonneg (F counts) nlinarith [sq_nonneg (pathSize (F counts) - 1 / 2)]
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPath_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:604
theorem idealGoodPilotCellPaths_independent

Cellwise good-pilot error paths are mutually independent under the ideal count law because each is a measurable function of its paired pilot/evaluation four-count block. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
iIndepFun (fun j counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealGoodPilotCellPaths_independent lemma idealGoodPilotCellPaths_independent {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) : iIndepFun (fun j counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) (idealCountLaw (n := n) P) := by classical let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let X : Fin d → ((Fin d × Fin 4) → ℕ) → (Fin 4 → ℕ) := fun j p => poissonTableCell j p let F : (((Fin d × Fin 4) → ℕ) × ((Fin d × Fin 4) → ℕ)) → (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ) := fun pe => (curryCountTable pe.1, curryCountTable pe.2) let G : Fin d → ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) → Path := fun j counts => idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true) let phi : Fin d → ((Fin 4 → ℕ) × (Fin 4 → ℕ)) → Path := fun j uv => idealPilotErrorCellPath epsilon P (curryCountTable (singleCellCountTable j uv.1), curryCountTable (singleCellCountTable j uv.2)) j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P (curryCountTable (singleCellCountTable j uv.1), curryCountTable (singleCellCountTable j uv.2)) j true) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance letI : BorelSpace Path := ⟨rfl⟩ have hXmeas : ∀ j, Measurable (X j) := by intro j; fun_prop have hXind : iIndepFun X mu := by change iIndepFun (fun j p z => p (j, z)) mu simpa [mu, rate] using poissonTable_cell_blocks_independent rate have hpair : iIndepFun (fun j pe => (X j pe.1, X j pe.2)) (mu.prod mu) := iIndepFun_pair_prod hXmeas hXmeas hXind hXind have hphi : ∀ j, Measurable (phi j) := by intro j exact measurable_of_countable _ have hcanon := hpair.comp phi hphi have hflat : iIndepFun (fun j pe => G j (F pe)) (mu.prod mu) := by apply hcanon.congr intro j exact Filter.Eventually.of_forall fun pe => by dsimp [G, F, phi, X] exact (idealPilotErrorCellPath_singleCell_local epsilon he hn (show 1 ≤ d by omega) P pe.1 pe.2 j).symm have hmap : Measure.map F (mu.prod mu) = idealCountLaw (n := n) P := by simpa [F, mu, rate] using map_flatIdealCountLaw (n := n) P have hGmeas : ∀ j, Measurable (G j) := by intro j exact measurable_of_countable _ letI : IsProbabilityMeasure (Measure.map F (mu.prod mu)) := Measure.isProbabilityMeasure_map (by fun_prop) rw [← hmap] apply (iIndepFun_iff_map_fun_eq_infinitePi_map hGmeas).2 have hflatMap := (iIndepFun_iff_map_fun_eq_infinitePi_map (fun j => (hGmeas j).comp (by fun_prop : Measurable F))).1 hflat calc Measure.map (fun counts j => G j counts) (Measure.map F (mu.prod mu)) = Measure.map (fun pe j => G j (F pe)) (mu.prod mu) := by rw [Measure.map_map (by fun_prop) (by fun_prop)] rfl _ = Measure.infinitePi (fun j => Measure.map (fun pe => G j (F pe)) (mu.prod mu)) := hflatMap _ = Measure.infinitePi (fun j => Measure.map (G j) (Measure.map F (mu.prod mu))) := by congr 1 funext j exact (Measure.map_map (hGmeas j) (by fun_prop : Measurable F)).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotCellPaths_independent · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:636
theorem idealGoodPilotError_centered_maximal

The abstract centered maximal inequality applies to the complete family of good-pilot cell paths under the ideal count experiment. With the specified inputs and conditions, the stated relationship holds. The argument assumes the probability-law premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
hprob :
hcont :
n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true (: ∀ j counts, Continuous (fun lambda : Time
(∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j true (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j true (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P)
≤ 16384 * ∑ j, (∫ counts, (pathSize (idealPilotErrorCellPath epsilon P counts j true (hcont j counts))) ^ 2 ∂idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealGoodPilotError_centered_maximal lemma idealGoodPilotError_centered_maximal {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (hprob : IsProbabilityMeasure (idealCountLaw (n := n) P)) : let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true (∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j true (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j true (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P) ≤ 16384 * ∑ j, (∫ counts, (pathSize (idealPilotErrorCellPath epsilon P counts j true (hcont j counts))) ^ 2 ∂idealCountLaw (n := n) P) := by dsimp only let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true exact idealPilotErrorCellPath_centered_maximal epsilon P true hprob hcont (fun j => idealGoodPilotCellPath_measurable epsilon he hn (show 1 ≤ d by omega) P j) (fun j => idealGoodPilotCellPath_integrable epsilon he he' hn hd P hprob j) (fun j => idealGoodPilotCellPath_ae_bv epsilon he hn hd P j) (fun j => idealGoodPilotCellPath_sq_integrable epsilon he he' hn hd P j) (idealGoodPilotCellPaths_independent epsilon he hn hd P)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotError_centered_maximal · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:709
theorem discreteLaw_sum_cellMass Lemma discreteLaw_sum_cellMass in the paper ↗

The marginal masses of a discrete observed law sum to one. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
P :
∑ j : Fin d, cellMass P j = 1
Proof (Lean source)
-- @node: discreteLaw_sum_cellMass lemma discreteLaw_sum_cellMass {d : ℕ} (P : DiscreteLaw d) : ∑ j : Fin d, cellMass P j = 1 := by change ∑ j : Fin d, ∑ a : Bool, ∑ y : Bool, (P.pmf (j, a, y)).toReal = 1 simpa [Fintype.sum_prod_type] using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.discreteLaw_sum_cellMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:741
theorem sum_badPilotCellScale_sq_le

Equation (32): the squared local mass scales sum to a linear mass term plus the uniform four-count remainder. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
1 ≤ d
P :
∑ j : Fin d, badPilotCellScale (n := n) P j ^ 2
≤ 2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2
Proof (Lean source)
-- @node: sum_badPilotCellScale_sq_le lemma sum_badPilotCellScale_sq_le {n d : ℕ} (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) : ∑ j : Fin d, badPilotCellScale (n := n) P j ^ 2 ≤ 2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2 := by let m : ℝ := (n : ℝ) / 8 let L : ℝ := logAlphabet d have hm : 0 < m := by dsimp [m]; positivity have hL : 0 ≤ L := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdreal] have hmass0 (j : Fin d) : 0 ≤ cellMass P j := by exact Finset.sum_nonneg fun a _ => Finset.sum_nonneg fun y _ => ENNReal.toReal_nonneg have hpoint (j : Fin d) : badPilotCellScale (n := n) P j ^ 2 ≤ 2 * (cellMass P j * L / m) + 2 * (L / m) ^ 2 := by have hA : 0 ≤ cellMass P j * L / m := div_nonneg (mul_nonneg (hmass0 j) hL) (le_of_lt hm) have hdelta : 0 ≤ L / m := by positivity have hsqrt := Real.sq_sqrt hA unfold badPilotCellScale dsimp only change (sqrt (cellMass P j * L / m) + L / m) ^ 2 ≤ _ nlinarith [sq_nonneg (sqrt (cellMass P j * L / m) - L / m)] calc ∑ j : Fin d, badPilotCellScale (n := n) P j ^ 2 ≤ ∑ j : Fin d, (2 * (cellMass P j * L / m) + 2 * (L / m) ^ 2) := by gcongr with j exact hpoint j _ = 2 * L / m + 2 * d * (L / m) ^ 2 := by rw [Finset.sum_add_distrib] simp_rw [← Finset.mul_sum, ← Finset.sum_div] rw [← Finset.sum_mul] rw [discreteLaw_sum_cellMass P] simp ring _ = 2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2 := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.sum_badPilotCellScale_sq_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:750
theorem idealGoodPilotError_centered_maximal_quantitative

Combining equations (21), (32), and the BV maximal inequality gives a single quantitative bound for the centered sum of all good-pilot paths. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
hcont :
n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true (: ∀ j counts, Continuous (fun lambda : Time
(∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j true (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j true (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P)
≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)
Proof (Lean source)
-- @node: idealGoodPilotError_centered_maximal_quantitative lemma idealGoodPilotError_centered_maximal_quantitative (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d), IsProbabilityMeasure (idealCountLaw (n := n) P) → let hcont : ∀ j counts, Continuous (fun lambda : Time => idealPilotErrorCell (n := n) epsilon lambda P counts j true) := fun j counts => idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true (∫ counts, ‖∑ j, (idealPilotErrorCellPath epsilon P counts j true (hcont j counts) - ∫ x, idealPilotErrorCellPath epsilon P x j true (hcont j x) ∂idealCountLaw (n := n) P)‖ ^ 2 ∂idealCountLaw (n := n) P) ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) := by classical obtain ⟨C₀, hC₀, hcellAll⟩ := idealGoodPilotCellPath_sq_integral_le epsilon he he' refine ⟨16384 * C₀, by positivity, ?_⟩ intro n d hn hd P hprob dsimp only have hcell (j : Fin d) : (∫ counts, pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 ∂idealCountLaw (n := n) P) ≤ C₀ * (d : ℝ) ^ (1 / 16 : ℝ) * badPilotCellScale (n := n) P j ^ 2 := by calc _ = ∫ counts, (if idealPilotGoodBool (n := n) P counts j then pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 else 0) ∂idealCountLaw (n := n) P := by apply integral_congr_ae exact Filter.Eventually.of_forall fun counts => idealGoodPilotCellPath_sq_eq_indicator epsilon he hn (show 1 ≤ d by omega) P counts j _ ≤ _ := (hcellAll hn hd P j).2 have hsum : ∑ j : Fin d, (∫ counts, pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 ∂idealCountLaw (n := n) P) ≤ (C₀ * (d : ℝ) ^ (1 / 16 : ℝ)) * ∑ j : Fin d, badPilotCellScale (n := n) P j ^ 2 := by rw [Finset.mul_sum] gcongr with j exact hcell j have hscale := sum_badPilotCellScale_sq_le hn (show 1 ≤ d by omega) P have hcoef : 0 ≤ C₀ * (d : ℝ) ^ (1 / 16 : ℝ) := by positivity calc _ ≤ 16384 * ∑ j : Fin d, (∫ counts, pathSize (idealPilotErrorCellPath epsilon P counts j true (idealPilotErrorCell_continuous_time_of_pos he hn (show 1 ≤ d by omega) P counts j true)) ^ 2 ∂idealCountLaw (n := n) P) := idealGoodPilotError_centered_maximal epsilon he he' hn hd P hprob _ ≤ 16384 * ((C₀ * (d : ℝ) ^ (1 / 16 : ℝ)) * ∑ j : Fin d, badPilotCellScale (n := n) P j ^ 2) := by gcongr _ ≤ 16384 * ((C₀ * (d : ℝ) ^ (1 / 16 : ℝ)) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2)) := by gcongr _ = (16384 * C₀) * (d : ℝ) ^ (1 / 16 : ℝ) * (2 * logAlphabet d / ((n : ℝ) / 8) + 2 * d * (logAlphabet d / ((n : ℝ) / 8)) ^ 2) := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilotError_centered_maximal_quantitative · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/GoodPilotCellOuterMoment.lean:795
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.IdealCountTransport 7 declarations Transport between flattened Poisson tables and the paper's curried count tables.

Transport between flattened Poisson tables and the paper's curried count tables.

Flatten a paper count table using the fixed four-cell equivalence.

Definition (Lean source)
d :
ℕ
t :
Fin d → Cell → ℕ
flattenCountTable t :
(Fin d × Fin 4) → ℕ
fun iz => t iz.1 (CellFourEquiv.symm iz.2)
CausalSmith.Stat.DiscreteBudgetvalueCurve.flattenCountTable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/IdealCountTransport.lean:15

Curry a flattened four-coordinate table back into the paper representation.

Definition (Lean source)
d :
ℕ
t :
(Fin d × Fin 4) → ℕ
curryCountTable t :
Fin d → Cell → ℕ
fun j z => t (j, CellFourEquiv z)

Flattening and currying are inverse table representations.

Definition (Lean source)
d :
ℕ
countTableEquiv d :
((Fin d × Fin 4) → ℕ) ≃ (Fin d → Cell → ℕ)
clause 1
clause 2
clause 3
left_inv t := by funext iz; simp [curryCountTable, flattenCountTable]
clause 4
right_inv t := by funext j z; simp [curryCountTable, flattenCountTable]

The flattened rate corresponding to one pool in idealCountLaw.

Definition (Lean source)
n d :
ℕ
P :
idealFlatRate P :
Fin d → Fin 4 → ℝ≥0
fun j z => toNNReal (((n : ℝ) / 8) * cellVector P j (CellFourEquiv.symm z))
theorem map_poissonTableLaw_curryCountTable

One flattened ideal Poisson pool pushes forward to the paper's curried pool. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
Measure.map curryCountTable (poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2))
= Measure.pi (fun j : Fin d => Measure.pi (fun z : Cell => poissonMeasure ⟨max 0 (((n : ℝ) / 8) * cellVector P j z), le_max_left 0 _⟩))
Proof (Lean source)
-- @node: map_poissonTableLaw_curryCountTable lemma map_poissonTableLaw_curryCountTable {n d : ℕ} (P : DiscreteLaw d) : Measure.map curryCountTable (poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)) = Measure.pi (fun j : Fin d => Measure.pi (fun z : Cell => poissonMeasure ⟨max 0 (((n : ℝ) / 8) * cellVector P j z), le_max_left 0 _⟩)) := by let e : (Fin d × Fin 4) ≃ (Fin d × Cell) := Equiv.prodCongr (Equiv.refl _) CellFourEquiv.symm let μ : Fin d → Cell → Measure ℕ := fun j z => poissonMeasure (idealFlatRate (n := n) P j (CellFourEquiv z)) letI : ∀ j z, IsProbabilityMeasure (μ j z) := fun j z => by dsimp [μ] infer_instance letI : ∀ j, IsProbabilityMeasure (Measure.infinitePi (μ j)) := fun j => by infer_instance have hreindex : Measure.map (MeasurableEquiv.piCongrLeft (fun _ : Fin d × Cell => ℕ) e) (Measure.infinitePi (fun iz : Fin d × Fin 4 => poissonMeasure (idealFlatRate (n := n) P iz.1 iz.2))) = Measure.infinitePi (fun iz : Fin d × Cell => μ iz.1 iz.2) := by convert Measure.infinitePi_map_piCongrLeft (fun iz : Fin d × Cell => μ iz.1 iz.2) e using 1 <;> simp [e, μ] have hcurry := Measure.infinitePi_map_curry μ unfold poissonTableLaw rw [show curryCountTable = (MeasurableEquiv.curry (Fin d) Cell ℕ) ∘ (MeasurableEquiv.piCongrLeft (fun _ : Fin d × Cell => ℕ) e) by funext t j z simp [curryCountTable, e, Function.comp_def, MeasurableEquiv.piCongrLeft, Equiv.piCongrLeft]] rw [← Measure.map_map (by fun_prop) (by fun_prop)] rw [hreindex, hcurry] rw [Measure.infinitePi_eq_pi] congr 2 funext j rw [Measure.infinitePi_eq_pi] congr 1 funext z apply congrArg poissonMeasure apply NNReal.eq simp only [μ, idealFlatRate, Equiv.symm_apply_apply, Real.coe_toNNReal, NNReal.coe_mk] exact max_comm _ _
CausalSmith.Stat.DiscreteBudgetvalueCurve.map_poissonTableLaw_curryCountTable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/IdealCountTransport.lean:40
theorem map_flatIdealCountLaw

Both flattened ideal pools push forward to idealCountLaw. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
Measure.map (fun pe => (curryCountTable pe.1, curryCountTable pe.2)) ((poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)).prod (poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)))
= idealCountLaw (n := n) P
Proof (Lean source)
-- @node: map_flatIdealCountLaw lemma map_flatIdealCountLaw {n d : ℕ} (P : DiscreteLaw d) : Measure.map (fun pe => (curryCountTable pe.1, curryCountTable pe.2)) ((poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)).prod (poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2))) = idealCountLaw (n := n) P := by change Measure.map (map curryCountTable curryCountTable) _ = _ rw [← MeasureTheory.Measure.map_prod_map _ _ (by fun_prop) (by fun_prop)] rw [map_poissonTableLaw_curryCountTable] rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.map_flatIdealCountLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/IdealCountTransport.lean:86
theorem curryCountTable_cell

Selecting a cell after currying a flat table returns its four-count block. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
j :
Fin d
t :
(Fin d × Fin 4) → ℕ
(fun z => curryCountTable t j (CellFourEquiv.symm z)) = poissonTableCell j t
Proof (Lean source)
-- @node: curryCountTable_cell lemma curryCountTable_cell {d : ℕ} (j : Fin d) (t : (Fin d × Fin 4) → ℕ) : (fun z => curryCountTable t j (CellFourEquiv.symm z)) = poissonTableCell j t := by funext z simp [curryCountTable, poissonTableCell]
CausalSmith.Stat.DiscreteBudgetvalueCurve.curryCountTable_cell · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/IdealCountTransport.lean:100
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.JacksonBias 5 declarations Cellwise expectation and scalar bias of the capped Jackson statistic.

Cellwise expectation and scalar bias of the capped Jackson statistic.

def idealCountLaw

The ideal, uncapped Poisson pilot and evaluation counts.

Definition (Lean source)
n d :
ℕ
P :
idealCountLaw P :
Measure ((Fin d → Cell → ℕ) × (Fin d → Cell → ℕ))
onePool :
Measure.pi (fun j : Fin d => Measure.pi (fun zeta : Cell => poissonMeasure ⟨max 0 (((n : ℝ) / 8) * cellVector P j zeta), le_max_left 0 _⟩)) (: Measure (Fin d → Cell → ℕ))
onePool.prod onePool
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealCountLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonBias.lean:12
def expectedUncappedJacksonCell

Uncapped cellwise expectation in the ideal Poisson count experiment.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
j :
Fin d
expectedUncappedJacksonCell epsilon lambda P j :
ℝ
∫ counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ), jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (counts.1 j) (counts.2 j) ∂idealCountLaw (n := n) P
CausalSmith.Stat.DiscreteBudgetvalueCurve.expectedUncappedJacksonCell · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonBias.lean:23

Scalar bias before the finite-sample Poisson cap transfer.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
j :
Fin d
uncappedJacksonCellBias epsilon lambda P j :
ℝ
|expectedUncappedJacksonCell (n := n) epsilon lambda P j
- thresholdFunReal epsilon lambda (cellVector P j)|
CausalSmith.Stat.DiscreteBudgetvalueCurve.uncappedJacksonCellBias · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonBias.lean:30
def expectedJacksonCell

Mean of a single capped cell statistic under data and auxiliary randomization.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
j :
Fin d
expectedJacksonCell epsilon lambda P j :
ℝ
∫ sample : Fin n → Obs d, auxiliaryAverage n (fun M perm marks => jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d (fun zeta => markedCellCount sample perm M marks false j zeta) (fun zeta => markedCellCount sample perm M marks true j zeta)) ∂productLaw P n
CausalSmith.Stat.DiscreteBudgetvalueCurve.expectedJacksonCell · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonBias.lean:36

Absolute cellwise scalar bias of the same polynomial used by the estimator.

Definition (Lean source)
n d :
ℕ
epsilon lambda :
ℝ
P :
j :
Fin d
jacksonCellBias epsilon lambda P j :
ℝ
|expectedJacksonCell (n := n) epsilon lambda P j
- thresholdFunReal epsilon lambda (cellVector P j)|
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellBias · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonBias.lean:46
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.JacksonCoefficientEnvelope 11 declarations Jackson coefficient bounded-variation envelopes and their Poisson path consequences.

Jackson coefficient bounded-variation envelopes and their Poisson path consequences.

theorem pathSize_le_two_endpointVariation Lemma pathSize_le_two_endpointVariation in the paper ↗

A finite-variation continuous path is controlled by its value at the left endpoint and its total variation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f :
hBV :
pathSize f ≤ 2 * (|f timeZero| + pathTV f)
Proof (Lean source)
-- @node: pathSize_le_two_endpointVariation lemma pathSize_le_two_endpointVariation (f : Path) (hBV : eVariationOn f univ < ⊤) : pathSize f ≤ 2 * (|f timeZero| + pathTV f) := by have hincENN (t : Time) : edist (f timeZero) (f t) ≤ eVariationOn f univ := eVariationOn.edist_le f (Set.mem_univ t) (Set.mem_univ timeZero) have hpoint (t : Time) : |f t - f timeZero| ≤ pathTV f := by have h := ENNReal.toReal_mono (ne_of_lt hBV) (hincENN t) simpa [pathTV, edist_dist, Real.dist_eq, abs_sub_comm] using h have hnorm : ‖f‖ ≤ |f timeZero| + pathTV f := by apply (ContinuousMap.norm_le f (add_nonneg (abs_nonneg _) (pathTV_nonneg f))).2 intro t rw [Real.norm_eq_abs] calc |f t| = |f timeZero + (f t - f timeZero)| := by ring_nf _ ≤ |f timeZero| + |f t - f timeZero| := abs_add_le _ _ _ ≤ |f timeZero| + pathTV f := by linarith [hpoint t] unfold pathSize have htv := pathTV_nonneg f linarith [abs_nonneg (f timeZero)]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pathSize_le_two_endpointVariation · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:19
theorem sum_pathSize_sq_le_four_endpointVariation_sq Lemma sum_pathSize_sq_le_four_endpointVariation_sq in the paper ↗

Summing the deterministic endpoint/variation bound over a finite family costs only the universal numerical factor four after squaring. With the specified inputs and conditions, the stated relationship holds.

Formal statement
ι :
Type*
f :
ι → Path
hBV :
∀ i, eVariationOn (f i) univ < ⊤
∑ i, pathSize (f i) ^ 2 ≤ 4 * (∑ i, (|f i timeZero| + pathTV (f i))) ^ 2
Proof (Lean source)
-- @node: sum_pathSize_sq_le_four_endpointVariation_sq lemma sum_pathSize_sq_le_four_endpointVariation_sq {ι : Type*} [Fintype ι] (f : ι → Path) (hBV : ∀ i, eVariationOn (f i) univ < ⊤) : ∑ i, pathSize (f i) ^ 2 ≤ 4 * (∑ i, (|f i timeZero| + pathTV (f i))) ^ 2 := by let b : ι → ℝ := fun i => |f i timeZero| + pathTV (f i) have hb (i : ι) : 0 ≤ b i := add_nonneg (abs_nonneg _) (pathTV_nonneg _) have hpoint (i : ι) : pathSize (f i) ^ 2 ≤ 4 * b i ^ 2 := by have hsize := pathSize_le_two_endpointVariation (f i) (hBV i) have hsize0 := pathSize_nonneg (f i) dsimp [b] at hsize ⊢ nlinarith [sq_nonneg (pathSize (f i) - 2 * (|f i timeZero| + pathTV (f i)))] calc ∑ i, pathSize (f i) ^ 2 ≤ ∑ i, 4 * b i ^ 2 := Finset.sum_le_sum fun i _ => hpoint i _ = 4 * ∑ i, b i ^ 2 := by rw [Finset.mul_sum] _ ≤ 4 * (∑ i, b i) ^ 2 := by exact mul_le_mul_of_nonneg_left (Finset.sum_sq_le_sq_sum_of_nonneg fun i _ => hb i) (by norm_num)
CausalSmith.Stat.DiscreteBudgetvalueCurve.sum_pathSize_sq_le_four_endpointVariation_sq · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:43
theorem eVariationOn_time_eq_Icc Lemma eVariationOn_time_eq_Icc in the paper ↗

Restricting a real function to the ordered interval [0,1] preserves exactly its extended variation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
f :
ℝ → ℝ
eVariationOn (fun t : Time => f t) univ = eVariationOn f (Icc 0 1)
Proof (Lean source)
-- @node: eVariationOn_time_eq_Icc lemma eVariationOn_time_eq_Icc (f : ℝ → ℝ) : eVariationOn (fun t : Time => f t) univ = eVariationOn f (Icc 0 1) := by unfold eVariationOn apply le_antisymm · apply iSup_le rintro ⟨n, u, hu, hus⟩ let v : ℕ → ℝ := fun i => (u i : ℝ) have hv : Monotone v := fun i j hij => hu hij have hvs : ∀ i, v i ∈ Icc (0 : ℝ) 1 := fun i => (u i).property apply le_iSup_of_le (n, ⟨v, hv, hvs⟩) rfl · apply iSup_le rintro ⟨n, u, hu, hus⟩ let v : ℕ → Time := fun i => ⟨u i, hus i⟩ have hv : Monotone v := fun i j hij => hu hij have hvs : ∀ i, v i ∈ univ := fun i => Set.mem_univ _ apply le_iSup_of_le (n, ⟨v, hv, hvs⟩) rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.eVariationOn_time_eq_Icc · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:67
theorem affinePoint_l1_sub_center_le_sum_radius Lemma affinePoint_l1_sub_center_le_sum_radius in the paper ↗

A normalized-cube affine perturbation moves from its center by at most the sum of its nonnegative coordinate radii in cellwise L1 distance. With the specified inputs and conditions, the stated relationship holds.

Formal statement
center radius :
Cell → ℝ
hR :
∀ zeta, 0 ≤ radius zeta
x :
Fin 4 → ℝ
hx :
∑ zeta : Cell, |affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) x (CellFourEquiv zeta)
- center zeta|
≤ ∑ zeta : Cell, radius zeta
Proof (Lean source)
-- @node: affinePoint_l1_sub_center_le_sum_radius lemma affinePoint_l1_sub_center_le_sum_radius (center radius : Cell → ℝ) (hR : ∀ zeta, 0 ≤ radius zeta) (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : ∑ zeta : Cell, |affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) x (CellFourEquiv zeta) - center zeta| ≤ ∑ zeta : Cell, radius zeta := by apply Finset.sum_le_sum intro zeta hzeta have hxabs : |x (CellFourEquiv zeta)| ≤ 1 := abs_le.2 (hx (CellFourEquiv zeta)) simp only [affinePoint, Equiv.symm_apply_apply, add_sub_cancel_left, abs_mul] rw [abs_of_nonneg (hR zeta)] exact mul_le_of_le_one_right (hR zeta) hxabs
CausalSmith.Stat.DiscreteBudgetvalueCurve.affinePoint_l1_sub_center_le_sum_radius · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:90
theorem tensorJacksonPathIntegral_size_le Lemma tensorJacksonPathIntegral_size_le in the paper ↗

Averaging paths against the normalized positive tensor Jackson kernel does not increase a common path-size bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
K :
ℕ
hK :
0 < K
f :
(Fin 4 → ℝ) → Path
B :
ℝ
hB :
0 ≤ B
hInt :
∀ t : Time, IntegrableOn (fun u => tensorJackson K 4 u * f u t) (periodBox 4)
hBV :
∀ u, eVariationOn (f u) univ < ⊤
hsize :
∀ u, pathSize (f u) ≤ B
∃ g : Path,
conclusion 1
t :
g t = ∫ u in periodBox 4, tensorJackson K 4 u * f u t
conclusion 2
conclusion 3
pathSize g ≤ B
Proof (Lean source)
-- @node: tensorJacksonPathIntegral_size_le lemma tensorJacksonPathIntegral_size_le (K : ℕ) (hK : 0 < K) (f : (Fin 4 → ℝ) → Path) (B : ℝ) (hB : 0 ≤ B) (hInt : ∀ t : Time, IntegrableOn (fun u => tensorJackson K 4 u * f u t) (periodBox 4)) (hBV : ∀ u, eVariationOn (f u) univ < ⊤) (hsize : ∀ u, pathSize (f u) ≤ B) : ∃ g : Path, (∀ t : Time, g t = ∫ u in periodBox 4, tensorJackson K 4 u * f u t) ∧ eVariationOn g univ < ⊤ ∧ pathSize g ≤ B := by let k : (Fin 4 → ℝ) → NNReal := fun u => ⟨tensorJackson K 4 u, tensorJackson_nonneg hK u⟩ let μ := (volume.restrict (periodBox 4)).withDensity (fun u => (k u : ENNReal)) letI : IsProbabilityMeasure μ := by apply (isProbabilityMeasure_iff).2 rw [show μ univ = ∫⁻ u, (k u : ENNReal) ∂(volume.restrict (periodBox 4)) by unfold μ rw [withDensity_apply _ MeasurableSet.univ] simp] rw [lintegral_coe_eq_integral] · have hi : (∫ u, (k u : ℝ) ∂(volume.restrict (periodBox 4))) = 1 := by change (∫ u in periodBox 4, tensorJackson K 4 u) = 1 exact tensorJackson_integral_eq_one hK rw [hi] simp · change IntegrableOn (tensorJackson K 4) (periodBox 4) exact integrableOn_tensorJackson K 4 have hkmeas : Measurable k := by unfold k fun_prop have hfInt (t : Time) : Integrable (fun u => f u t) μ := by rw [integrable_withDensity_iff_integrable_smul hkmeas] change IntegrableOn (fun u => tensorJackson K 4 u * f u t) (periodBox 4) exact hInt t obtain ⟨g, hg, hgbv, hgsize⟩ := weightedPathIntegral_size_le μ f (fun _ => 1) B 1 hB (by norm_num) (fun t => by simpa using hfInt t) (fun _ => by norm_num) hBV hsize refine ⟨g, ?_, hgbv, by simpa using hgsize⟩ intro t rw [hg t, integral_withDensity_eq_integral_smul hkmeas] simp only [one_mul] change (∫ u in periodBox 4, tensorJackson K 4 u * f u t) = _ rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.tensorJacksonPathIntegral_size_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:109
theorem localJacksonPolynomial_cube_pathSize_le

The centered local Jackson polynomial has a uniform cube path-size envelope obtained from the spatial BV Lipschitz constant and the radius sum. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hcenter :
∀ zeta, 0 ≤ center zeta
hR :
∀ zeta, 0 ≤ radius zeta
haffine :
∀ x ∈ normalizedCube 4,
∀ zeta,
0
≤ affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) x (CellFourEquiv zeta)
C :
ℝ
hC :
0 ≤ C
hthreshold :
∀ u v : Cell → ℝ
if
(∀ z, 0 ≤ u z)
and
(∀ z, 0 ≤ v z)
then
bvNorm (fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v)
≤ C * ∑ z, |u z - v z|
x :
Fin 4 → ℝ
hx :
pathSize (⟨fun lambda : Time => eval x (localJacksonPolynomial epsilon lambda K center radius), localJacksonPolynomial_eval_continuous_time epsilon K center radius hK hpull x hx⟩ : Path)
≤ 2 * C * ∑ zeta : Cell, radius zeta
Proof (Lean source)
-- @node: localJacksonPolynomial_cube_pathSize_le lemma localJacksonPolynomial_cube_pathSize_le (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hcenter : ∀ zeta, 0 ≤ center zeta) (hR : ∀ zeta, 0 ≤ radius zeta) (haffine : ∀ x ∈ normalizedCube 4, ∀ zeta, 0 ≤ affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) x (CellFourEquiv zeta)) (C : ℝ) (hC : 0 ≤ C) (hthreshold : ∀ u v : Cell → ℝ, (∀ z, 0 ≤ u z) → (∀ z, 0 ≤ v z) → bvNorm (fun lambda => thresholdFunReal epsilon lambda u - thresholdFunReal epsilon lambda v) ≤ C * ∑ z, |u z - v z|) (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : pathSize (⟨fun lambda : Time => eval x (localJacksonPolynomial epsilon lambda K center radius), localJacksonPolynomial_eval_continuous_time epsilon K center radius hK hpull x hx⟩ : Path) ≤ 2 * C * ∑ zeta : Cell, radius zeta := by let theta : Fin 4 → ℝ := fun i => arccos (x i) have hcos : (fun i => cos (theta i)) = x := by funext i exact Real.cos_arccos (hx i).1 (hx i).2 let v (u : Fin 4 → ℝ) : Cell → ℝ := fun zeta => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (cosPoint (theta - u)) (CellFourEquiv zeta) have hvnonneg (u : Fin 4 → ℝ) (zeta : Cell) : 0 ≤ v u zeta := haffine _ (cosPoint_mem_normalizedCube _) zeta let f (u : Fin 4 → ℝ) : Path := ⟨fun lambda : Time => thresholdFunReal epsilon lambda (v u) - thresholdFunReal epsilon lambda center, (thresholdFunReal_continuous_time epsilon (v u)).sub (thresholdFunReal_continuous_time epsilon center)⟩ have hfBV (u : Fin 4 → ℝ) : eVariationOn (f u) univ < ⊤ := by have hlip := (thresholdFunReal_lipschitz_time epsilon (v u)).sub (thresholdFunReal_lipschitz_time epsilon center) have hid : BoundedVariationOn (id : Time → Time) univ := by have hm : Monotone (fun t : Time => (t : ℝ)) := fun s t hst => hst exact MonotoneOn.boundedVariationOn (hm.monotoneOn _) (fun t _ => abs_le.2 ⟨by linarith [t.property.1], t.property.2⟩) apply lt_top_iff_ne_top.mpr simpa [f, BoundedVariationOn, Function.comp_def] using hlip.comp_boundedVariationOn hid have hfsize (u : Fin 4 → ℝ) : pathSize (f u) ≤ 2 * C * ∑ zeta : Cell, radius zeta := by have hbv := hthreshold (v u) center (hvnonneg u) hcenter have hdist := affinePoint_l1_sub_center_le_sum_radius center radius hR (cosPoint (theta - u)) (cosPoint_mem_normalizedCube _) have hbase := pathSize_le_two_endpointVariation (f u) (hfBV u) have heq : |f u timeZero| + pathTV (f u) = bvNorm (fun lambda => thresholdFunReal epsilon lambda (v u) - thresholdFunReal epsilon lambda center) := by change |thresholdFunReal epsilon 0 (v u) - thresholdFunReal epsilon 0 center| + (eVariationOn (fun lambda : Time => thresholdFunReal epsilon lambda (v u) - thresholdFunReal epsilon lambda center) univ).toReal = _ unfold bvNorm congr 1 exact congrArg toReal (eVariationOn_time_eq_Icc (fun lambda : ℝ => thresholdFunReal epsilon lambda (v u) - thresholdFunReal epsilon lambda center)) rw [heq] at hbase nlinarith [mul_le_mul_of_nonneg_left (hbv.trans (mul_le_mul_of_nonneg_left hdist hC)) (by norm_num : (0 : ℝ) ≤ 2)] have hfInt (t : Time) : IntegrableOn (fun u => tensorJackson K 4 u * f u t) (periodBox 4) := by have hcosCont : Continuous (fun u : Fin 4 → ℝ => cosPoint (theta - u)) := by unfold cosPoint fun_prop have ht : ContinuousOn (fun u => thresholdFunReal epsilon t (v u)) (periodBox 4) := by apply (hpull t).comp hcosCont.continuousOn intro u hu exact cosPoint_mem_normalizedCube _ have hc : Continuous (fun u : Fin 4 → ℝ => thresholdFunReal epsilon t center) := continuous_const have hk : Continuous (tensorJackson K 4) := by unfold tensorJackson fun_prop exact (hk.continuousOn.mul (ht.sub hc.continuousOn)).integrableOn_compact (by change IsCompact {u : Fin 4 → ℝ | ∀ i, u i ∈ Icc (-pi) pi} exact isCompact_pi_infinite fun _ => isCompact_Icc) obtain ⟨g, hg, hgbv, hgsize⟩ := tensorJacksonPathIntegral_size_le K hK f (2 * C * ∑ zeta : Cell, radius zeta) (mul_nonneg (mul_nonneg (by norm_num) hC) (Finset.sum_nonneg (fun z _ => hR z))) hfInt hfBV hfsize have hpath : (⟨fun lambda : Time => eval x (localJacksonPolynomial epsilon lambda K center radius), localJacksonPolynomial_eval_continuous_time epsilon K center radius hK hpull x hx⟩ : Path) = g := by ext t change eval x (localJacksonPolynomial epsilon t K center radius) = g t have heval := localJacksonPolynomial_eval_cos epsilon t K center radius hK (hpull t) theta have hevalx : eval x (localJacksonPolynomial epsilon t K center radius) = localJacksonConvolution epsilon t K center radius theta - thresholdFunReal epsilon t center := by simpa only [hcos] using heval rw [hevalx, hg t] unfold localJacksonConvolution tensorConvolution f v have hcenterInt : IntegrableOn (fun u : Fin 4 → ℝ => thresholdFunReal epsilon t center * tensorJackson K 4 u) (periodBox 4) := (integrableOn_tensorJackson K 4).const_mul _ have hfirstInt : IntegrableOn (fun u : Fin 4 → ℝ => thresholdFunReal epsilon t (fun zeta => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (cosPoint (theta - u)) (CellFourEquiv zeta)) * tensorJackson K 4 u) (periodBox 4) := by have hcosCont : Continuous (fun u : Fin 4 → ℝ => cosPoint (theta - u)) := by unfold cosPoint fun_prop have hk : Continuous (tensorJackson K 4) := by unfold tensorJackson fun_prop exact (((hpull t).comp hcosCont.continuousOn (fun u hu => cosPoint_mem_normalizedCube _)).mul hk.continuousOn).integrableOn_compact (by change IsCompact {u : Fin 4 → ℝ | ∀ i, u i ∈ Icc (-pi) pi} exact isCompact_pi_infinite fun _ => isCompact_Icc) let a (u : Fin 4 → ℝ) := thresholdFunReal epsilon t (fun zeta => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (cosPoint (theta - u)) (CellFourEquiv zeta)) let c := thresholdFunReal epsilon t center change (∫ u in periodBox 4, a u * tensorJackson K 4 u) - c = ∫ u in periodBox 4, tensorJackson K 4 u * (a u - c) have hfirstInt' : IntegrableOn (fun u => a u * tensorJackson K 4 u) (periodBox 4) := by simpa [a] using hfirstInt have hcenterInt' : IntegrableOn (fun u => c * tensorJackson K 4 u) (periodBox 4) := by simpa [c] using hcenterInt calc (∫ u in periodBox 4, a u * tensorJackson K 4 u) - c = (∫ u in periodBox 4, a u * tensorJackson K 4 u) - c * 1 := by ring _ = (∫ u in periodBox 4, a u * tensorJackson K 4 u) - c * (∫ u in periodBox 4, tensorJackson K 4 u) := by rw [tensorJackson_integral_eq_one hK] _ = (∫ u in periodBox 4, a u * tensorJackson K 4 u) - (∫ u in periodBox 4, c * tensorJackson K 4 u) := by rw [integral_const_mul] _ = ∫ u in periodBox 4, (a u * tensorJackson K 4 u - c * tensorJackson K 4 u) := by rw [integral_sub hfirstInt' hcenterInt'] _ = ∫ u in periodBox 4, tensorJackson K 4 u * (a u - c) := by apply integral_congr_ae filter_upwards [] with u ring rw [hpath] exact hgsize
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_cube_pathSize_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:158
theorem jacksonChebyshevFactor_le_exp_twelve Lemma jacksonChebyshevFactor_le_exp_twelve in the paper ↗

The explicit four-dimensional Chebyshev conversion factor is absorbed by the paper's exp (12 K) budget. With the specified inputs and conditions, the stated relationship holds.

Formal statement
K :
ℕ
hK :
0 < K
(16 : ℝ) * (↑(2 * (K - 1) + 1) : ℝ) ^ 4 * (1 + sqrt 2) ^ (4 * (2 * (K - 1)))
≤ exp (12 * K)
Proof (Lean source)
-- @node: jacksonChebyshevFactor_le_exp_twelve lemma jacksonChebyshevFactor_le_exp_twelve (K : ℕ) (hK : 0 < K) : (16 : ℝ) * (↑(2 * (K - 1) + 1) : ℝ) ^ 4 * (1 + sqrt 2) ^ (4 * (2 * (K - 1))) ≤ exp (12 * K) := by have hKreal : (1 : ℝ) ≤ K := by exact_mod_cast hK have hsub : ((K - 1 : ℕ) : ℝ) = (K : ℝ) - 1 := by rw [Nat.cast_sub (by omega)] norm_num have hD : (↑(2 * (K - 1) + 1) : ℝ) ≤ 2 * K := by norm_cast omega have hsqrt : sqrt 2 ≤ 3 / 2 := by have hs := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2) have hs0 := Real.sqrt_nonneg 2 nlinarith have hbase : 1 + sqrt 2 ≤ exp 1 := by linarith [Real.exp_one_gt_d9] have htwoK : 2 * (K : ℝ) ≤ exp K := by have he := Real.add_one_le_exp ((K : ℝ) / 2) have hexp0 : 0 ≤ exp ((K : ℝ) / 2) := (Real.exp_pos _).le have hsq : (2 * (K : ℝ)) ≤ (1 + (K : ℝ) / 2) ^ 2 := by nlinarith [sq_nonneg ((K : ℝ) - 2)] calc 2 * (K : ℝ) ≤ (1 + (K : ℝ) / 2) ^ 2 := hsq _ ≤ (exp ((K : ℝ) / 2)) ^ 2 := by nlinarith _ = exp K := by rw [← Real.exp_nat_mul]; congr 1; ring have h16 : (16 : ℝ) ≤ exp 4 := by calc (16 : ℝ) = 2 ^ 4 := by norm_num _ ≤ (exp 1) ^ 4 := pow_le_pow_left₀ (by norm_num) Real.exp_one_gt_two.le _ _ = exp 4 := by rw [← Real.exp_nat_mul]; norm_num have hpoly : (↑(2 * (K - 1) + 1) : ℝ) ^ 4 ≤ exp (4 * K) := by calc _ ≤ (2 * (K : ℝ)) ^ 4 := pow_le_pow_left₀ (by positivity) hD _ _ ≤ (exp K) ^ 4 := pow_le_pow_left₀ (by positivity) htwoK _ _ = exp (4 * K) := by rw [← Real.exp_nat_mul]; norm_num have hcheb : (1 + sqrt 2) ^ (4 * (2 * (K - 1))) ≤ exp (4 * (2 * (K - 1))) := by calc _ ≤ (exp 1) ^ (4 * (2 * (K - 1))) := pow_le_pow_left₀ (by positivity) hbase _ _ = _ := by rw [← Real.exp_nat_mul]; push_cast; rw [hsub]; ring calc _ ≤ exp 4 * exp (4 * K) * exp (4 * (2 * (K - 1))) := by gcongr _ = exp (4 + 4 * K + 4 * (2 * (K - 1))) := by rw [← Real.exp_add, ← Real.exp_add] _ ≤ exp (12 * K) := by apply Real.exp_le_exp.mpr linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonChebyshevFactor_le_exp_twelve · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:327
theorem jacksonDegree_factorial_index_exponential_budget

The finite four-coordinate factorial index set, together with the degree exponential from equation (21), is absorbed by the structural d^(1/16) budget. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
hd :
16 ≤ d
(↑(2 * (jacksonDegree d - 1) + 1) : ℝ) ^ 4 * exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d)
≤ exp 123 * (d : ℝ) ^ (1 / 16 : ℝ)
Proof (Lean source)
-- @node: jacksonDegree_factorial_index_exponential_budget lemma jacksonDegree_factorial_index_exponential_budget (d : ℕ) (hd : 16 ≤ d) : (↑(2 * (jacksonDegree d - 1) + 1) : ℝ) ^ 4 * exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d) ≤ exp 123 * (d : ℝ) ^ (1 / 16 : ℝ) := by let K := jacksonDegree d let L := logAlphabet d have hKnat : 0 < K := by unfold K jacksonDegree; omega have hKreal : (1 : ℝ) ≤ K := by exact_mod_cast hKnat have hD : (↑(2 * (K - 1) + 1) : ℝ) ≤ 2 * K := by norm_cast omega have htwoK : 2 * (K : ℝ) ≤ exp K := by have he := Real.add_one_le_exp ((K : ℝ) / 2) have hexp0 : 0 ≤ exp ((K : ℝ) / 2) := (Real.exp_pos _).le have hsq : (2 * (K : ℝ)) ≤ (1 + (K : ℝ) / 2) ^ 2 := by nlinarith [sq_nonneg ((K : ℝ) - 2)] calc 2 * (K : ℝ) ≤ (1 + (K : ℝ) / 2) ^ 2 := hsq _ ≤ (exp ((K : ℝ) / 2)) ^ 2 := by nlinarith _ = exp K := by rw [← Real.exp_nat_mul]; congr 1; ring have hcard : (↑(2 * (K - 1) + 1) : ℝ) ^ 4 ≤ exp (4 * K) := by calc _ ≤ (2 * (K : ℝ)) ^ 4 := pow_le_pow_left₀ (by positivity) hD _ _ ≤ (exp K) ^ 4 := pow_le_pow_left₀ (by positivity) htwoK _ _ = exp (4 * K) := by rw [← Real.exp_nat_mul]; norm_num have hdpos : (0 : ℝ) < d := by exact_mod_cast (show 0 < d by omega) have hdge : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) have hL : L = 1 + log d := by unfold L logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] have hLge : 1 ≤ L := by rw [hL] linarith [Real.log_nonneg hdge] have hfloor : (⌊jacksonDegreeConstant * L⌋₊ : ℝ) ≤ L / 512 := by calc _ ≤ jacksonDegreeConstant * L := Nat.floor_le (by unfold jacksonDegreeConstant; positivity) _ = L / 512 := by unfold jacksonDegreeConstant; ring have hK : (K : ℝ) ≤ 2 + L / 512 := by unfold K jacksonDegree rw [Nat.cast_max] exact max_le (by linarith) (by linarith) have hKnonneg : (0 : ℝ) ≤ K := Nat.cast_nonneg _ have hscale : 28 * (K : ℝ) * L + 16 * (K : ℝ) ^ 2 ≤ 122 * L + L ^ 2 / 16 := by have hprod := mul_nonneg (show 0 ≤ 2 + L / 512 - (K : ℝ) by linarith) (show 0 ≤ 2 + L / 512 + (K : ℝ) by positivity) nlinarith [sq_nonneg (L - 1)] have hbound : 28 * (K : ℝ) + 16 * (K : ℝ) ^ 2 / L ≤ 122 + L / 16 := by have hLpos : 0 < L := by linarith calc _ = (28 * (K : ℝ) * L + 16 * (K : ℝ) ^ 2) / L := by field_simp _ ≤ (122 * L + L ^ 2 / 16) / L := by gcongr _ = _ := by field_simp calc (↑(2 * (jacksonDegree d - 1) + 1) : ℝ) ^ 4 * exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d) ≤ exp (4 * K) * exp (24 * K + 16 * (K : ℝ) ^ 2 / L) := by simpa [K, L] using mul_le_mul_of_nonneg_right hcard (Real.exp_nonneg _) _ = exp (28 * K + 16 * (K : ℝ) ^ 2 / L) := by rw [← Real.exp_add] congr 1 ring _ ≤ exp (123 + log d / 16) := by apply Real.exp_le_exp.mpr rw [hL] at hbound ⊢ linarith _ = exp 123 * (d : ℝ) ^ (1 / 16 : ℝ) := by rw [Real.exp_add, Real.rpow_def_of_pos hdpos] congr 1 ring_nf
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonDegree_factorial_index_exponential_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:381
theorem jacksonCoefficientBV_le_of_cube_pathSize

A uniform path-size bound for every normalized-cube evaluation of the local Jackson polynomial implies the paper's coefficient BV envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
hK :
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
B :
ℝ
hB :
0 ≤ B
hbound :
∀ x (hx : x ∈ normalizedCube 4),
pathSize (⟨fun lambda : Time => eval x (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot)), localJacksonPolynomial_eval_continuous_time epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull x hx⟩ : Path)
≤ B
jacksonCoefficientBV epsilon m d pilot ≤ exp (12 * jacksonDegree d) * B
Proof (Lean source)
-- @node: jacksonCoefficientBV_le_of_cube_pathSize lemma jacksonCoefficientBV_le_of_cube_pathSize (epsilon m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (hK : 0 < jacksonDegree d) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (B : ℝ) (hB : 0 ≤ B) (hbound : ∀ x (hx : x ∈ normalizedCube 4), pathSize (⟨fun lambda : Time => eval x (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot)), localJacksonPolynomial_eval_continuous_time epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull x hx⟩ : Path) ≤ B) : jacksonCoefficientBV epsilon m d pilot ≤ exp (12 * jacksonDegree d) * B := by let K := jacksonDegree d let center := pilotMidpoint m d pilot let radius := pilotRadius m d pilot let p : Time → MvPolynomial (Fin 4) ℝ := fun lambda => localJacksonPolynomial epsilon lambda K center radius have hdeg (lambda : Time) (i : Fin 4) : (p lambda).degreeOf i ≤ 2 * (K - 1) := localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK (hpull lambda) i have hgrid (a : Fin 4 → Fin (2 * (K - 1) + 1)) : Continuous (fun lambda : Time => eval (fun i => (a i : ℝ)) (p lambda)) := localJacksonPolynomial_fixed_eval_continuous_time epsilon K center radius hK hpull (le_refl _) (fun i => (a i : ℝ)) have hcont (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : Continuous (fun lambda : Time => eval x (p lambda)) := localJacksonPolynomial_eval_continuous_time epsilon K center radius hK hpull x hx have hBV (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : eVariationOn (⟨fun lambda : Time => eval x (p lambda), hcont x hx⟩ : Path) univ < ⊤ := by obtain ⟨C, hLip⟩ := localJacksonPolynomial_eval_lipschitz_time epsilon K center radius hK hpull x hx have hid : BoundedVariationOn (id : Time → Time) univ := by have hm : Monotone (fun t : Time => (t : ℝ)) := fun s t hst => hst exact MonotoneOn.boundedVariationOn (hm.monotoneOn _) (fun t _ => abs_le.2 ⟨by linarith [t.property.1], t.property.2⟩) apply lt_top_iff_ne_top.mpr simpa [BoundedVariationOn, Function.comp_def] using hLip.comp_boundedVariationOn hid have henv := tensorCoefficientPath_four_chebyshev_size_envelope p B hB hdeg hgrid hcont hBV (by simpa [p, K, center, radius] using hbound) have hcoeff : jacksonCoefficientBV epsilon m d pilot ≤ ∑ a, pathSize (tensorCoefficientPath p hdeg hgrid a) := by unfold jacksonCoefficientBV dsimp only apply Finset.sum_le_sum intro a ha have hzero : |jacksonCoefficient epsilon 0 K center radius (fun i => (a i : ℕ))| ≤ ‖tensorCoefficientPath p hdeg hgrid a‖ := by have hz := ContinuousMap.norm_coe_le_norm (tensorCoefficientPath p hdeg hgrid a) timeZero rw [Real.norm_eq_abs] at hz simpa [tensorCoefficientPath, p, K, center, radius, timeZero, jacksonCoefficient_eq_tensorCoeffs] using hz have htv : (eVariationOn (fun lambda : ℝ => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ))) (Icc 0 1)).toReal = pathTV (tensorCoefficientPath p hdeg hgrid a) := by unfold pathTV rw [← eVariationOn_time_eq_Icc] rfl rw [htv] unfold pathSize simpa [add_comm] using add_le_add_right hzero (pathTV (tensorCoefficientPath p hdeg hgrid a)) calc jacksonCoefficientBV epsilon m d pilot ≤ ∑ a, pathSize (tensorCoefficientPath p hdeg hgrid a) := hcoeff _ ≤ (16 : ℝ) * (↑(2 * (K - 1) + 1) : ℝ) ^ 4 * (1 + sqrt 2) ^ (4 * (2 * (K - 1))) * B := henv _ ≤ exp (12 * K) * B := mul_le_mul_of_nonneg_right (jacksonChebyshevFactor_le_exp_twelve K hK) hB
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficientBV_le_of_cube_pathSize · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:465
theorem localJacksonCoefficientPath_sq_sum_le_jacksonCoefficientBV

The squared path sizes of all local Jackson coefficient paths are bounded by four times the paper's coefficient bounded-variation envelope squared. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
hK :
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
∑ a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), pathSize (localJacksonCoefficientPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) a) ^ 2
≤ 4 * jacksonCoefficientBV epsilon m d pilot ^ 2
Proof (Lean source)
-- @node: localJacksonCoefficientPath_sq_sum_le_jacksonCoefficientBV lemma localJacksonCoefficientPath_sq_sum_le_jacksonCoefficientBV (epsilon m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (hK : 0 < jacksonDegree d) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) : ∑ a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), pathSize (localJacksonCoefficientPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) a) ^ 2 ≤ 4 * jacksonCoefficientBV epsilon m d pilot ^ 2 := by let c : (Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1)) → Path := fun a => localJacksonCoefficientPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) a have hBV (a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1)) : eVariationOn (c a) univ < ⊤ := by exact localJacksonCoefficientPath_bv epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) a calc ∑ a, pathSize (c a) ^ 2 ≤ 4 * (∑ a, (|c a timeZero| + pathTV (c a))) ^ 2 := sum_pathSize_sq_le_four_endpointVariation_sq c hBV _ = 4 * jacksonCoefficientBV epsilon m d pilot ^ 2 := by congr 2 unfold jacksonCoefficientBV dsimp only apply Finset.sum_congr rfl intro a ha change |jacksonCoefficient epsilon 0 (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) (fun i => (a i : ℕ))| + (eVariationOn (fun lambda : Time => jacksonCoefficient epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) (fun i => (a i : ℕ))) univ).toReal = _ congr 1 exact congrArg toReal (eVariationOn_time_eq_Icc (fun lambda : ℝ => jacksonCoefficient epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) (fun i => (a i : ℕ))))
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonCoefficientPath_sq_sum_le_jacksonCoefficientBV · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:551
theorem localJacksonFourPoissonFactorialPath_sq_integral_le_coefficientBV

The four-Poisson factorial path square moment is controlled directly by the paper's Jackson coefficient bounded-variation envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
epsilon m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
hK :
hpull :
∀ lambda : Time,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWmeas :
∀ i, Measurable (W i)
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
L :
ℝ
hm :
0 < m
hL :
0 < L
hR :
∀ i, 0 < pilotRadius m d pilot (CellFourEquiv.symm i)
hcenter :
∀ i,
|(rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)|
≤ pilotRadius m d pilot (CellFourEquiv.symm i)
hvariance :
∀ i, (rate i : ℝ) / (m ^ 2 * pilotRadius m d pilot (CellFourEquiv.symm i) ^ 2) ≤ 1 / L
cap :
ℝ
hcap :
0 ≤ cap
(∫ ω, pathSize (localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) W m cap ω) ^ 2 ∂μ)
≤ (4 * jacksonCoefficientBV epsilon m d pilot ^ 2) * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : ℕ) : ℝ) ^ 2 / L)
Proof (Lean source)
-- @node: localJacksonFourPoissonFactorialPath_sq_integral_le_coefficientBV lemma localJacksonFourPoissonFactorialPath_sq_integral_le_coefficientBV {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (epsilon m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (hK : 0 < jacksonDegree d) (hpull : ∀ lambda : Time, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWmeas : ∀ i, Measurable (W i)) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (L : ℝ) (hm : 0 < m) (hL : 0 < L) (hR : ∀ i, 0 < pilotRadius m d pilot (CellFourEquiv.symm i)) (hcenter : ∀ i, |(rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)| ≤ pilotRadius m d pilot (CellFourEquiv.symm i)) (hvariance : ∀ i, (rate i : ℝ) / (m ^ 2 * pilotRadius m d pilot (CellFourEquiv.symm i) ^ 2) ≤ 1 / L) (cap : ℝ) (hcap : 0 ≤ cap) : (∫ ω, pathSize (localJacksonFourPoissonFactorialPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) W m cap ω) ^ 2 ∂μ) ≤ (4 * jacksonCoefficientBV epsilon m d pilot ^ 2) * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : ℕ) : ℝ) ^ 2 / L) := by have h := localJacksonFourPoissonFactorialPath_sq_bound μ epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) W rate hWmeas hWlaw hWindep m L hm hL hR hcenter hvariance cap hcap calc _ ≤ (∑ a, pathSize (localJacksonCoefficientPath epsilon (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot) hK hpull (le_refl _) a) ^ 2) * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : ℕ) : ℝ) ^ 2 / L) := h.2.2.2.2 _ ≤ (4 * jacksonCoefficientBV epsilon m d pilot ^ 2) * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : ℕ) : ℝ) ^ 2 / L) := by apply mul_le_mul_of_nonneg_right (localJacksonCoefficientPath_sq_sum_le_jacksonCoefficientBV epsilon m d pilot hK hpull) exact Finset.sum_nonneg fun _ _ => Real.exp_nonneg _
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonFourPoissonFactorialPath_sq_integral_le_coefficientBV · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonCoefficientEnvelope.lean:601
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.JacksonPolynomial 33 declarations The polynomial is chosen from its normalized cosine representation.

Pilot-local Jackson polynomial and factorial lift

The polynomial is chosen from its normalized cosine representation. This lets the estimator use its actual monomial coefficients without choosing a minimizer.

def CellFourEquiv

the cell four equiv definition specifies the stated object.

Definition (Lean source)
CellFourEquiv :
Cell ≃ Fin 4
theorem thresholdFunReal_continuous_time Lemma thresholdFunReal_continuous_time in the paper ↗

Restricted to the unit threshold interval, the extended threshold functional is continuous in the threshold. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
u :
Cell → ℝ
Continuous (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda u)
Proof (Lean source)
-- @node: thresholdFunReal_continuous_time lemma thresholdFunReal_continuous_time (epsilon : ℝ) (u : Cell → ℝ) : Continuous (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda u) := by have heq : (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda u) = fun lambda => armValue epsilon 0 u + max 0 (armValue epsilon 1 u - armValue epsilon 0 u - lambda.1 * totalMass u) := by funext lambda simp only [thresholdFunReal, dif_pos lambda.property, thresholdFun] rw [heq] fun_prop
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFunReal_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:28
theorem thresholdFunReal_lambda_lipschitz Lemma thresholdFunReal_lambda_lipschitz in the paper ↗

At a fixed cell vector, the threshold functional is Lipschitz in the threshold with constant equal to the absolute total cell mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
u :
Cell → ℝ
lambda mu :
Icc (0 : ℝ) 1
|thresholdFunReal epsilon lambda u - thresholdFunReal epsilon mu u|
≤ |(lambda : ℝ) - mu| * |totalMass u|
Proof (Lean source)
-- @node: thresholdFunReal_lambda_lipschitz lemma thresholdFunReal_lambda_lipschitz (epsilon : ℝ) (u : Cell → ℝ) (lambda mu : Icc (0 : ℝ) 1) : |thresholdFunReal epsilon lambda u - thresholdFunReal epsilon mu u| ≤ |(lambda : ℝ) - mu| * |totalMass u| := by simp only [thresholdFunReal, dif_pos lambda.property, dif_pos mu.property, thresholdFun] have h := abs_max_sub_max_le_abs (armValue epsilon 1 u - armValue epsilon 0 u - lambda.1 * totalMass u) (armValue epsilon 1 u - armValue epsilon 0 u - mu.1 * totalMass u) 0 have heq : (armValue epsilon 1 u - armValue epsilon 0 u - lambda.1 * totalMass u) - (armValue epsilon 1 u - armValue epsilon 0 u - mu.1 * totalMass u) = -(lambda.1 - mu.1) * totalMass u := by ring rw [max_comm 0 (armValue epsilon 1 u - armValue epsilon 0 u - lambda.1 * totalMass u), max_comm 0 (armValue epsilon 1 u - armValue epsilon 0 u - mu.1 * totalMass u)] simpa only [add_sub_add_left_eq_sub, heq, abs_mul, abs_neg] using h
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFunReal_lambda_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:44
theorem thresholdFunReal_lipschitz_time Lemma thresholdFunReal_lipschitz_time in the paper ↗

The threshold functional at a fixed cell vector is a Lipschitz function of the threshold on the unit interval. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
u :
Cell → ℝ
LipschitzWith ⟨|totalMass u|, abs_nonneg _⟩ (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda u)
Proof (Lean source)
-- @node: thresholdFunReal_lipschitz_time lemma thresholdFunReal_lipschitz_time (epsilon : ℝ) (u : Cell → ℝ) : LipschitzWith ⟨|totalMass u|, abs_nonneg _⟩ (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda u) := by apply LipschitzWith.of_dist_le_mul intro lambda mu rw [Real.dist_eq] change |thresholdFunReal epsilon lambda u - thresholdFunReal epsilon mu u| ≤ |totalMass u| * |(lambda : ℝ) - mu| simpa only [mul_comm] using thresholdFunReal_lambda_lipschitz epsilon u lambda mu
CausalSmith.Stat.DiscreteBudgetvalueCurve.thresholdFunReal_lipschitz_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:66
def pilotRadiusConstant

The fixed pilot-radius multiplier.

Definition (Lean source)
pilotRadiusConstant :
ℝ
4096
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadiusConstant · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:80
def jacksonDegreeConstant

The fixed inverse degree multiplier.

Definition (Lean source)
jacksonDegreeConstant :
ℝ
1 / 512
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonDegreeConstant · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:84
def boundedAlphabetCutoff

The bounded-alphabet cutoff.

Definition (Lean source)
boundedAlphabetCutoff :
ℕ
16
CausalSmith.Stat.DiscreteBudgetvalueCurve.boundedAlphabetCutoff · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:88
def jacksonDegree

The paper's structural Jackson degree.

Definition (Lean source)
d :
ℕ
jacksonDegree d :
ℕ
max 2 ⌊jacksonDegreeConstant * logAlphabet d⌋₊
def markedCellCount

Poisson pilot or evaluation count for a permuted and marked sample.

Definition (Lean source)
n d :
ℕ
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
pilot :
j :
Fin d
zeta :
Cell
markedCellCount sample perm M marks pilot j zeta :
ℕ
∑ i : Fin n, if i.1 < M ∧
marks i = pilot ∧
(sample (perm i)).1 = j ∧
(sample (perm i)).2.1 = finTwoEquiv zeta.1 ∧
(sample (perm i)).2.2 = finTwoEquiv zeta.2 then 1 else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.markedCellCount · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:96
def pilotCenter

Coordinatewise pilot center.

Definition (Lean source)
m :
ℝ
pilot :
Cell → ℕ
zeta :
Cell
pilotCenter m pilot zeta :
ℝ
(pilot zeta : ℝ) / m
def pilotHalfWidth

Coordinatewise pilot half-width.

Definition (Lean source)
m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
zeta :
Cell
pilotHalfWidth m d pilot zeta :
ℝ
pilotRadiusConstant * (sqrt (pilotCenter m pilot zeta * logAlphabet d / m) + logAlphabet d / m)
def pilotLower

The lower endpoint, truncated at zero.

Definition (Lean source)
m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
zeta :
Cell
pilotLower m d pilot zeta :
ℝ
max 0 (pilotCenter m pilot zeta - pilotHalfWidth m d pilot zeta)
def pilotUpper

The upper endpoint.

Definition (Lean source)
m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
zeta :
Cell
pilotUpper m d pilot zeta :
ℝ
pilotCenter m pilot zeta + pilotHalfWidth m d pilot zeta
def pilotMidpoint

Midpoint of the truncated pilot interval.

Definition (Lean source)
m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
zeta :
Cell
pilotMidpoint m d pilot zeta :
ℝ
(pilotLower m d pilot zeta + pilotUpper m d pilot zeta) / 2
def pilotRadius

Radius of the truncated pilot interval.

Definition (Lean source)
m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
zeta :
Cell
pilotRadius m d pilot zeta :
ℝ
(pilotUpper m d pilot zeta - pilotLower m d pilot zeta) / 2
def localJacksonConvolution

The exact tensor convolution of the cell threshold on its pilot rectangle.

Definition (Lean source)
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
theta :
Fin 4 → ℝ
localJacksonConvolution epsilon lambda K center radius theta :
ℝ
tensorConvolution K (fun z => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) theta
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonConvolution · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:135
theorem localJacksonConvolution_lipschitz_time Lemma localJacksonConvolution_lipschitz_time in the paper ↗

If every fixed-threshold pullback is continuous on the normalized cube, the local Jackson convolution is Lipschitz, hence continuous, in the threshold. The proof uses only thresholdwise continuity in the integration coordinate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
theta :
Fin 4 → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
∃ C : NNReal,
LipschitzWith C (fun lambda : Icc (0 : ℝ) 1 => localJacksonConvolution epsilon lambda K center radius theta)
Proof (Lean source)
-- @node: localJacksonConvolution_lipschitz_time lemma localJacksonConvolution_lipschitz_time (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (theta : Fin 4 → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) : ∃ C : NNReal, LipschitzWith C (fun lambda : Icc (0 : ℝ) 1 => localJacksonConvolution epsilon lambda K center radius theta) := by let v (u : Fin 4 → ℝ) : Cell → ℝ := fun c => Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (Causalean.Mathlib.Analysis.JacksonApproximation.cosPoint (theta - u)) (CellFourEquiv c) let kernel (u : Fin 4 → ℝ) : ℝ := Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K 4 u let envelope (u : Fin 4 → ℝ) : ℝ := |totalMass (v u)| * kernel u let B : ℝ := ∫ u in periodBox 4, envelope u have hbox : IsCompact (periodBox 4) := by change IsCompact {u : Fin 4 → ℝ | ∀ i, u i ∈ Icc (-pi) pi} exact isCompact_pi_infinite fun _ => isCompact_Icc have hcos : Continuous (fun u : Fin 4 → ℝ => Causalean.Mathlib.Analysis.JacksonApproximation.cosPoint (theta - u)) := by unfold Causalean.Mathlib.Analysis.JacksonApproximation.cosPoint fun_prop have hkernel : Continuous kernel := by unfold kernel Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson fun_prop have henv : Continuous envelope := by unfold envelope v totalMass armMassFn unfold Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint fun_prop have henvInt : IntegrableOn envelope (periodBox 4) := henv.continuousOn.integrableOn_compact hbox have hB : 0 ≤ B := by apply integral_nonneg intro u exact mul_nonneg (abs_nonneg _) <| tensorJackson_nonneg hK u refine ⟨⟨B, hB⟩, LipschitzWith.of_dist_le_mul fun lambda mu => ?_⟩ have hfInt (t : Icc (0 : ℝ) 1) : IntegrableOn (fun u => thresholdFunReal epsilon t (v u) * kernel u) (periodBox 4) := by have ht : ContinuousOn (fun u => thresholdFunReal epsilon t (v u)) (periodBox 4) := by apply (hpull t).comp hcos.continuousOn intro u hu exact cosPoint_mem_normalizedCube _ exact (ht.mul hkernel.continuousOn).integrableOn_compact hbox change dist (∫ u in periodBox 4, thresholdFunReal epsilon lambda (v u) * kernel u) (∫ u in periodBox 4, thresholdFunReal epsilon mu (v u) * kernel u) ≤ B * dist lambda mu rw [Real.dist_eq, ← integral_sub (hfInt lambda) (hfInt mu)] calc |∫ u in periodBox 4, (thresholdFunReal epsilon lambda (v u) * kernel u - thresholdFunReal epsilon mu (v u) * kernel u)| ≤ ∫ u in periodBox 4, |thresholdFunReal epsilon lambda (v u) * kernel u - thresholdFunReal epsilon mu (v u) * kernel u| := abs_integral_le_integral_abs _ ≤ ∫ u in periodBox 4, (|(lambda : ℝ) - mu| * envelope u) := by apply integral_mono · exact (hfInt lambda).sub (hfInt mu) |>.abs · exact henvInt.const_mul _ · intro u have hk := tensorJackson_nonneg hK u have ht := thresholdFunReal_lambda_lipschitz epsilon (v u) lambda mu dsimp [envelope, kernel] rw [← sub_mul, abs_mul, abs_of_nonneg hk] simpa only [mul_assoc] using mul_le_mul_of_nonneg_right ht hk _ = |(lambda : ℝ) - mu| * B := by rw [integral_const_mul] _ = B * dist lambda mu := by change |(lambda : ℝ) - mu| * B = B * |(lambda : ℝ) - mu| ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonConvolution_lipschitz_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:144
theorem localJacksonConvolution_continuous_time Lemma localJacksonConvolution_continuous_time in the paper ↗

The local Jackson convolution is continuous in the threshold under the same pointwise pullback regularity used to construct its polynomial. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
theta :
Fin 4 → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
Continuous (fun lambda : Icc (0 : ℝ) 1 => localJacksonConvolution epsilon lambda K center radius theta)
Proof (Lean source)
-- @node: localJacksonConvolution_continuous_time lemma localJacksonConvolution_continuous_time (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (theta : Fin 4 → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) : Continuous (fun lambda : Icc (0 : ℝ) 1 => localJacksonConvolution epsilon lambda K center radius theta) := by obtain ⟨C, hC⟩ := localJacksonConvolution_lipschitz_time epsilon K center radius theta hK hpull exact hC.continuous
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonConvolution_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:233
theorem localJacksonPolynomial_exists Lemma localJacksonPolynomial_exists in the paper ↗

The normalized tensor convolution has a monomial polynomial representative when its pullback is continuous on the normalized cube. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hcont :
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
∃ q : MvPolynomial (Fin 4) ℝ,
conclusion 1
theta :
Fin 4 → ℝ
eval (fun i => cos (theta i)) q
= localJacksonConvolution epsilon lambda K center radius theta
- thresholdFunReal epsilon lambda center
conclusion 2
i :
q.degreeOf i ≤ 2 * (K - 1)
Proof (Lean source)
-- @node: localJacksonPolynomial_exists lemma localJacksonPolynomial_exists (epsilon lambda : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hcont : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) : ∃ q : MvPolynomial (Fin 4) ℝ, (∀ theta : Fin 4 → ℝ, eval (fun i => cos (theta i)) q = localJacksonConvolution epsilon lambda K center radius theta - thresholdFunReal epsilon lambda center) ∧ (∀ i, q.degreeOf i ≤ 2 * (K - 1)) := by let f : (Fin 4 → ℝ) → ℝ := fun z => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c)) obtain ⟨p, hp, hsupport, _⟩ := tensorConvolution_exists_mvPolynomial hK f hcont refine ⟨p - C (thresholdFunReal epsilon lambda center), ?_, ?_⟩ · intro theta simp only [MvPolynomial.eval_sub, MvPolynomial.eval_C] change eval (fun i => cos (theta i)) p - _ = tensorConvolution K f theta - _ rw [← hp theta] rfl · intro i have hdeg : p.degreeOf i ≤ 2 * (K - 1) := by apply MvPolynomial.degreeOf_le_iff.mpr intro m hm exact hsupport m hm i have hc : (C (thresholdFunReal epsilon lambda center) : MvPolynomial (Fin 4) ℝ).degreeOf i ≤ 2 * (K - 1) := by simp exact (MvPolynomial.degreeOf_sub_le i p _).trans (max_le hdeg hc)
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_exists · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:250
def localJacksonPolynomial

A canonical normalized polynomial obtained by choice from the Jackson construction. It defaults to zero outside the degree and continuity domain of that construction.

Definition (Lean source)
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
localJacksonPolynomial epsilon lambda K center radius :
letI := Classical.propDecidable if hK : 0 < K then if hcont : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4) then choose (localJacksonPolynomial_exists epsilon lambda K center radius hK hcont) else 0 else 0
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:290
theorem localJacksonPolynomial_degreeOf_le Lemma localJacksonPolynomial_degreeOf_le in the paper ↗

On the Jackson construction domain, the chosen local polynomial has the required coordinatewise degree. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hcont :
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
i :
Fin 4
(localJacksonPolynomial epsilon lambda K center radius).degreeOf i ≤ 2 * (K - 1)
Proof (Lean source)
-- @node: localJacksonPolynomial_degreeOf_le lemma localJacksonPolynomial_degreeOf_le (epsilon lambda : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hcont : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (i : Fin 4) : (localJacksonPolynomial epsilon lambda K center radius).degreeOf i ≤ 2 * (K - 1) := by unfold localJacksonPolynomial simp only [dif_pos hK, dif_pos hcont] exact (Classical.choose_spec (localJacksonPolynomial_exists epsilon lambda K center radius hK hcont)).2 i
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_degreeOf_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:306
theorem localJacksonPolynomial_eval_cos Lemma localJacksonPolynomial_eval_cos in the paper ↗

On the Jackson construction domain, evaluating the chosen polynomial on the cosine cube recovers the centered tensor convolution. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hcont :
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
theta :
Fin 4 → ℝ
eval (fun i => cos (theta i)) (localJacksonPolynomial epsilon lambda K center radius)
= localJacksonConvolution epsilon lambda K center radius theta
- thresholdFunReal epsilon lambda center
Proof (Lean source)
-- @node: localJacksonPolynomial_eval_cos lemma localJacksonPolynomial_eval_cos (epsilon lambda : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hcont : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (theta : Fin 4 → ℝ) : eval (fun i => cos (theta i)) (localJacksonPolynomial epsilon lambda K center radius) = localJacksonConvolution epsilon lambda K center radius theta - thresholdFunReal epsilon lambda center := by unfold localJacksonPolynomial simp only [dif_pos hK, dif_pos hcont] exact (Classical.choose_spec (localJacksonPolynomial_exists epsilon lambda K center radius hK hcont)).1 theta
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_eval_cos · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:325
theorem localJacksonPolynomial_eval_continuous_time Lemma localJacksonPolynomial_eval_continuous_time in the paper ↗

At each fixed point of the normalized cube, the chosen local Jackson polynomial has a continuous evaluation path in the threshold. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
x :
Fin 4 → ℝ
hx :
Continuous (fun lambda : Icc (0 : ℝ) 1 => eval x (localJacksonPolynomial epsilon lambda K center radius))
Proof (Lean source)
-- @node: localJacksonPolynomial_eval_continuous_time lemma localJacksonPolynomial_eval_continuous_time (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : Continuous (fun lambda : Icc (0 : ℝ) 1 => eval x (localJacksonPolynomial epsilon lambda K center radius)) := by let theta : Fin 4 → ℝ := fun i => arccos (x i) have hcos : (fun i => cos (theta i)) = x := by funext i exact Real.cos_arccos (hx i).1 (hx i).2 have heq : (fun lambda : Icc (0 : ℝ) 1 => eval x (localJacksonPolynomial epsilon lambda K center radius)) = fun lambda : Icc (0 : ℝ) 1 => localJacksonConvolution epsilon lambda K center radius theta - thresholdFunReal epsilon lambda center := by funext lambda rw [← hcos] exact localJacksonPolynomial_eval_cos epsilon lambda K center radius hK (hpull lambda) theta rw [heq] exact (localJacksonConvolution_continuous_time epsilon K center radius theta hK hpull).sub (thresholdFunReal_continuous_time epsilon center)
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_eval_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:346
theorem localJacksonPolynomial_eval_lipschitz_time Lemma localJacksonPolynomial_eval_lipschitz_time in the paper ↗

At every fixed point of the normalized cube, evaluation of the chosen local Jackson polynomial is Lipschitz in the threshold. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
x :
Fin 4 → ℝ
hx :
∃ C : NNReal,
LipschitzWith C (fun lambda : Icc (0 : ℝ) 1 => eval x (localJacksonPolynomial epsilon lambda K center radius))
Proof (Lean source)
-- @node: localJacksonPolynomial_eval_lipschitz_time lemma localJacksonPolynomial_eval_lipschitz_time (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (x : Fin 4 → ℝ) (hx : x ∈ normalizedCube 4) : ∃ C : NNReal, LipschitzWith C (fun lambda : Icc (0 : ℝ) 1 => eval x (localJacksonPolynomial epsilon lambda K center radius)) := by let theta : Fin 4 → ℝ := fun i => arccos (x i) have hcos : (fun i => cos (theta i)) = x := by funext i exact Real.cos_arccos (hx i).1 (hx i).2 obtain ⟨C, hC⟩ := localJacksonConvolution_lipschitz_time epsilon K center radius theta hK hpull let T : NNReal := ⟨|totalMass center|, abs_nonneg _⟩ refine ⟨C + T, ?_⟩ have heq : (fun lambda : Icc (0 : ℝ) 1 => eval x (localJacksonPolynomial epsilon lambda K center radius)) = fun lambda : Icc (0 : ℝ) 1 => localJacksonConvolution epsilon lambda K center radius theta - thresholdFunReal epsilon lambda center := by funext lambda rw [← hcos] exact localJacksonPolynomial_eval_cos epsilon lambda K center radius hK (hpull lambda) theta rw [heq] exact hC.sub (thresholdFunReal_lipschitz_time epsilon center)
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_eval_lipschitz_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:380
def jacksonCoefficient

The normalized monomial coefficient.

Definition (Lean source)
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
alpha :
Fin 4 → ℕ
jacksonCoefficient epsilon lambda K center radius alpha :
ℝ
(localJacksonPolynomial epsilon lambda K center radius).coeff (Finsupp.equivFunOnFinite.symm alpha)
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficient · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:417
theorem jacksonCoefficient_eq_tensorCoeffs Lemma jacksonCoefficient_eq_tensorCoeffs in the paper ↗

A bounded multi-index Jackson coefficient is the corresponding fixed tensor-basis coefficient of the local polynomial. With the specified inputs and conditions, the stated relationship holds.

Formal statement
D :
ℕ
epsilon lambda :
ℝ
K :
ℕ
center radius :
Cell → ℝ
a :
Fin 4 → Fin (D + 1)
jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ))
= tensorCoeffs (D := D) (localJacksonPolynomial epsilon lambda K center radius) a
Proof (Lean source)
-- @node: jacksonCoefficient_eq_tensorCoeffs lemma jacksonCoefficient_eq_tensorCoeffs {D : ℕ} (epsilon lambda : ℝ) (K : ℕ) (center radius : Cell → ℝ) (a : Fin 4 → Fin (D + 1)) : jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) = tensorCoeffs (D := D) (localJacksonPolynomial epsilon lambda K center radius) a := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficient_eq_tensorCoeffs · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:423
theorem jacksonCoefficient_continuous_time_of_grid Lemma jacksonCoefficient_continuous_time_of_grid in the paper ↗

Continuous fixed-grid evaluations remove the apparent incoherence of the pointwise chosen Jackson representatives: every bounded coefficient then varies continuously with the threshold. With the specified inputs and conditions, the stated relationship holds.

Formal statement
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
hgrid :
∀ a : Fin 4 → Fin (D + 1),
Continuous (fun lambda : Icc (0 : ℝ) 1 => eval (fun i => (a i : ℝ)) (localJacksonPolynomial epsilon lambda K center radius))
a :
Fin 4 → Fin (D + 1)
Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)))
Proof (Lean source)
-- @node: jacksonCoefficient_continuous_time_of_grid lemma jacksonCoefficient_continuous_time_of_grid {D : ℕ} (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hD : 2 * (K - 1) ≤ D) (hgrid : ∀ a : Fin 4 → Fin (D + 1), Continuous (fun lambda : Icc (0 : ℝ) 1 => eval (fun i => (a i : ℝ)) (localJacksonPolynomial epsilon lambda K center radius))) (a : Fin 4 → Fin (D + 1)) : Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ))) := by change Continuous (fun lambda : Icc (0 : ℝ) 1 => tensorCoeffs (D := D) (localJacksonPolynomial epsilon lambda K center radius) a) apply continuous_tensorCoeffs_of_grid (fun lambda : Icc (0 : ℝ) 1 => localJacksonPolynomial epsilon lambda K center radius) · intro lambda i exact (localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK (hpull lambda) i).trans hD · exact hgrid
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficient_continuous_time_of_grid · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:433
theorem jacksonCoefficient_continuous_time Lemma jacksonCoefficient_continuous_time in the paper ↗

Every bounded coefficient of the local Jackson polynomial varies continuously with the threshold. The proof recovers it from a fixed finite tensor grid lying inside the normalized cube. With the specified inputs and conditions, the stated relationship holds.

Formal statement
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
a :
Fin 4 → Fin (D + 1)
Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)))
Proof (Lean source)
-- @node: jacksonCoefficient_continuous_time lemma jacksonCoefficient_continuous_time {D : ℕ} (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hD : 2 * (K - 1) ≤ D) (a : Fin 4 → Fin (D + 1)) : Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ))) := by let p : Icc (0 : ℝ) 1 → MvPolynomial (Fin 4) ℝ := fun lambda => localJacksonPolynomial epsilon lambda K center radius have hdeg (lambda : Icc (0 : ℝ) 1) (i : Fin 4) : (p lambda).degreeOf i ≤ D := (localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK (hpull lambda) i).trans hD have heq : (fun lambda : Icc (0 : ℝ) 1 => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ))) = fun lambda => ∑ b : Fin 4 → Fin (D + 1), tensorGridWeight a b * eval (tensorGridPoint b) (p lambda) := by funext lambda rw [jacksonCoefficient_eq_tensorCoeffs] exact tensorGrid_coeff_recovery (p lambda) (hdeg lambda) a rw [heq] apply continuous_finsetSum intro b hb exact continuous_const.mul (localJacksonPolynomial_eval_continuous_time epsilon K center radius hK hpull _ (tensorGridPoint_mem_cube b))
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCoefficient_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:464
theorem localJacksonPolynomial_fixed_eval_continuous_time Lemma localJacksonPolynomial_fixed_eval_continuous_time in the paper ↗

Every fixed evaluation of the degree-bounded local Jackson polynomial is continuous in the threshold. In particular, this supplies the integer-grid premise used by the generic tensor coefficient path API. With the specified inputs and conditions, the stated relationship holds.

Formal statement
D :
ℕ
epsilon :
ℝ
K :
ℕ
center radius :
Cell → ℝ
hK :
0 < K
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
hD :
2 * (K - 1) ≤ D
y :
Fin 4 → ℝ
Continuous (fun lambda : Icc (0 : ℝ) 1 => eval y (localJacksonPolynomial epsilon lambda K center radius))
Proof (Lean source)
-- @node: localJacksonPolynomial_fixed_eval_continuous_time lemma localJacksonPolynomial_fixed_eval_continuous_time {D : ℕ} (epsilon : ℝ) (K : ℕ) (center radius : Cell → ℝ) (hK : 0 < K) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) (hD : 2 * (K - 1) ≤ D) (y : Fin 4 → ℝ) : Continuous (fun lambda : Icc (0 : ℝ) 1 => eval y (localJacksonPolynomial epsilon lambda K center radius)) := by let p : Icc (0 : ℝ) 1 → MvPolynomial (Fin 4) ℝ := fun lambda => localJacksonPolynomial epsilon lambda K center radius have hdeg (lambda : Icc (0 : ℝ) 1) (i : Fin 4) : (p lambda).degreeOf i ≤ D := (localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK (hpull lambda) i).trans hD have hformula (lambda : Icc (0 : ℝ) 1) : eval y (p lambda) = ∑ a : Fin 4 → Fin (D + 1), tensorCoeffs (D := D) (p lambda) a * ∏ i : Fin 4, y i ^ (a i : ℕ) := by calc _ = eval y (tensorPolynomial (tensorCoeffs (D := D) (p lambda))) := by rw [tensorPolynomial_tensorCoeffs (p lambda) (hdeg lambda)] _ = _ := by unfold tensorPolynomial rw [map_sum] apply Finset.sum_congr rfl intro a ha rw [MvPolynomial.eval_monomial] congr 1 rw [Finsupp.prod_fintype _ _ (by simp)] simp [tensorExponent] rw [show (fun lambda : Icc (0 : ℝ) 1 => eval y (p lambda)) = fun lambda => ∑ a : Fin 4 → Fin (D + 1), tensorCoeffs (D := D) (p lambda) a * ∏ i : Fin 4, y i ^ (a i : ℕ) by funext lambda exact hformula lambda] apply continuous_finsetSum intro a ha exact (jacksonCoefficient_continuous_time epsilon K center radius hK hpull hD a).mul continuous_const
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_fixed_eval_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:503
def centeredFactorial

Centered factorial polynomial for a single count and monomial degree.

Definition (Lean source)
m z :
ℝ
N h :
ℕ
centeredFactorial m z N h :
ℝ
∑ t ∈ range (h + 1), (h.choose t : ℝ) * (-z) ^ (h - t) * (N.descFactorial t : ℝ) / m ^ t
CausalSmith.Stat.DiscreteBudgetvalueCurve.centeredFactorial · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:558
def jacksonCellRaw

The uncapped polynomial statistic for one cell and one shadow price.

Definition (Lean source)
epsilon lambda m :
ℝ
d :
ℕ
pilot eval :
Cell → ℕ
jacksonCellRaw epsilon lambda m d pilot eval :
ℝ
center :
pilotMidpoint m d pilot
radius :
pilotRadius m d pilot
thresholdFunReal epsilon lambda center
+ ∑ alpha : Fin 4 → Fin (2 * (K - 1) + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (alpha i : ℕ)) * ∏ i : Fin 4, centeredFactorial m (center (CellFourEquiv.symm i)) (eval (CellFourEquiv.symm i)) (alpha i : ℕ) / radius (CellFourEquiv.symm i) ^ (alpha i : ℕ)
def jacksonCellStatistic

The clipped cellwise Jackson-factorial statistic.

Definition (Lean source)
epsilon lambda m :
ℝ
d :
ℕ
pilot eval :
Cell → ℕ
jacksonCellStatistic epsilon lambda m d pilot eval :
ℝ
center :
pilotMidpoint m d pilot
scale :
(d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta : Cell, pilotRadius m d pilot zeta
delta :
jacksonCellRaw epsilon lambda m d pilot eval - thresholdFunReal epsilon lambda center
thresholdFunReal epsilon lambda center + min scale (max (-scale) delta)
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellStatistic · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:577
theorem jacksonCellStatistic_continuous_time Lemma jacksonCellStatistic_continuous_time in the paper ↗

Under the same fixed-threshold cube regularity used by the Jackson construction, the complete clipped cell statistic is continuous in the threshold. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon m :
ℝ
d :
ℕ
pilot eval :
Cell → ℕ
hpull :
∀ lambda : Icc (0 : ℝ) 1,
ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)
Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCellStatistic epsilon lambda m d pilot eval)
Proof (Lean source)
-- @node: jacksonCellStatistic_continuous_time lemma jacksonCellStatistic_continuous_time (epsilon m : ℝ) (d : ℕ) (pilot eval : Cell → ℕ) (hpull : ∀ lambda : Icc (0 : ℝ) 1, ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4)) : Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCellStatistic epsilon lambda m d pilot eval) := by let K := jacksonDegree d let center := pilotMidpoint m d pilot let radius := pilotRadius m d pilot have hK : 0 < K := by unfold K jacksonDegree omega have hcoeff (a : Fin 4 → Fin (2 * (K - 1) + 1)) : Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ))) := jacksonCoefficient_continuous_time epsilon K center radius hK hpull (le_refl _) a have hraw : Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCellRaw epsilon lambda m d pilot eval) := by unfold jacksonCellRaw change Continuous (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda center + ∑ a : Fin 4 → Fin (2 * (K - 1) + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * _) apply (thresholdFunReal_continuous_time epsilon center).add apply continuous_finsetSum intro a ha exact (hcoeff a).mul continuous_const unfold jacksonCellStatistic change Continuous (fun lambda : Icc (0 : ℝ) 1 => thresholdFunReal epsilon lambda center + min _ (max (-_) (jacksonCellRaw epsilon lambda m d pilot eval - thresholdFunReal epsilon lambda center))) exact (thresholdFunReal_continuous_time epsilon center).add (continuous_const.min (continuous_const.max (hraw.sub (thresholdFunReal_continuous_time epsilon center))))
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellStatistic_continuous_time · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/JacksonPolynomial.lean:585
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.LowerSplice 1 declarations Sparse, dense, and finite-alphabet lower-bound splice.

Sparse, dense, and finite-alphabet lower-bound splice.

The matched lower-rate scale.

Definition (Lean source)
n d :
ℕ
curveRate n d :
ℝ
min 1 ((d : ℝ) / (n * logAlphabet d))
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.MomentMatchingPriors 1 declarations The local absolute-moment prior composition.

The local absolute-moment prior composition.

theorem absolute_moment_matching_priors

Source match: cite:cailow2011, Lemma 1 (p. 10) and the Bernstein-limit discussion defining δK\delta_K (p. 8). T. Tony Cai and Mark G. Low (2011), arXiv:1105.3039, DOI 10.1214/10-AOS849. The stated relationship holds.

Formal statement
∃ c : ℝ,
0 < c
conclusion 1
K :
ℕ
Even K
2 ≤ K
∃ nu0 nu1 : Measure ℝ,
m :
ℕ
m ≤ K
∫ t : ℝ, t ^ m ∂nu0 = ∫ t : ℝ, t ^ m ∂nu1
c / K ≤ |(∫ t : ℝ, |t| ∂nu1) - (∫ t : ℝ, |t| ∂nu0)|
Proof (Lean source)
-- @node: lem:absolute-moment-matching-priors lemma absolute_moment_matching_priors : ∃ c : ℝ, 0 < c ∧ ∀ K : ℕ, Even K → 2 ≤ K → ∃ nu0 nu1 : Measure ℝ, IsProbabilityMeasure nu0 ∧ IsProbabilityMeasure nu1 ∧ IsSymmetric nu0 ∧ IsSymmetric nu1 ∧ IsSupportedOnUnitInterval nu0 ∧ IsSupportedOnUnitInterval nu1 ∧ (∀ m : ℕ, m ≤ K → ∫ t : ℝ, t ^ m ∂nu0 = ∫ t : ℝ, t ^ m ∂nu1) ∧ c / K ≤ |(∫ t : ℝ, |t| ∂nu1) - (∫ t : ℝ, |t| ∂nu0)| := by let c : ℝ := 1 / 50 refine ⟨c, by norm_num [c], ?_⟩ intro K _hK_even hK let P := choice (exists_symmetric_momentMatched_absGap (K := K)) refine ⟨P.ν₀, P.ν₁, P.probability₀, P.probability₁, P.symmetric₀, P.symmetric₁, P.supported₀, P.supported₁, P.moments_eq, ?_⟩ have hK_pos : 0 < K := by omega have happrox := bestUniformApproxErrorAbs_lower K hK_pos have happrox_nonneg : 0 ≤ bestUniformApproxErrorAbs K := by exact le_trans (by positivity) happrox rw [P.abs_gap, abs_of_nonneg (mul_nonneg (by norm_num) happrox_nonneg)] calc c / (K : ℝ) = 2 * ((1 / 100 : ℝ) / (K : ℝ)) := by dsimp [c] ring _ ≤ 2 * bestUniformApproxErrorAbs K := by linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.absolute_moment_matching_priors · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/MomentMatchingPriors.lean:14
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.PairedKernel 1 declarations Fixed-sample paired-kernel reduction substrate for the lower proof.

Fixed-sample paired-kernel reduction substrate for the lower proof.

The hard capacity-active subclass, including the binding requirement.

Definition (Lean source)
d :
ℕ
epsilon :
ℝ
capacityHardClass d epsilon :
{Q | CausalModelClass epsilon Q ∧ budgetValue Q 1 = 1 / 2 ∧ (∀ j, 0 < poCellMass Q j → effect Q j ∈ Icc (1 / 8 : ℝ) (3 / 8)) ∧ BindingHalfBudget Q}
CausalSmith.Stat.DiscreteBudgetvalueCurve.capacityHardClass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedKernel.lean:10
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.PairedObservedAtom 29 declarations Real atom sums for the observed margin of the explicit paired law.

Real atom sums for the observed margin of the explicit paired law.

theorem pairedFullMass_observedSum Lemma pairedFullMass_observedSum in the paper ↗

Summing out both potential outcomes gives the paired observed atom mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
i :
Fin k
sigma a y :
(∑ y0 : Bool, ∑ y1 : Bool, pairedFullMass r theta ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)) (if sigma then 1 else 0, i), a, y, y0, y1))
= r.1 i / 4 * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i else 1 / 4) y
Proof (Lean source)
-- @node: pairedFullMass_observedSum lemma pairedFullMass_observedSum {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (i : Fin k) (sigma a y : Bool) : (∑ y0 : Bool, ∑ y1 : Bool, pairedFullMass r theta ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)) (if sigma then 1 else 0, i), a, y, y0, y1)) = r.1 i / 4 * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i else 1 / 4) y := by classical have hk : k ≠ 0 := Nat.ne_of_gt (lt_of_le_of_lt (zero_le i.val) i.isLt) cases sigma <;> cases a <;> cases y <;> simp [pairedFullMass, bernoulliMass, finProdFinEquiv, Fin.modNat, Fin.divNat, Nat.mod_eq_of_lt i.isLt, hk] <;> ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedFullMass_observedSum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:14

Every atom of the paired full-data construction has nonnegative mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
z :
FullObs (2 * k)
0 ≤ pairedFullMass r theta z
Proof (Lean source)
-- @node: pairedFullMass_nonneg lemma pairedFullMass_nonneg {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (z : FullObs (2 * k)) : 0 ≤ pairedFullMass r theta z := by let i := ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).2 have ht := theta.2 i have hr := r.2.1 i simp only [Set.mem_Icc] at ht have hmu : 0 ≤ (1 / 2 : ℝ) + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).1 = 0 then 1 else -1) * theta.1 i ∧ (1 / 2 : ℝ) + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).1 = 0 then 1 else -1) * theta.1 i ≤ 1 := by split_ifs <;> constructor <;> nlinarith [ht.1, ht.2] have h0 : 0 ≤ bernoulliMass (1 / 4) z.2.2.2.1 := by cases z.2.2.2.1 <;> norm_num [bernoulliMass] have h1 : 0 ≤ bernoulliMass ((1 / 2 : ℝ) + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1).1 = 0 then 1 else -1) * theta.1 i) z.2.2.2.2 := by cases z.2.2.2.2 <;> simp only [bernoulliMass, Bool.false_eq_true, ↓reduceIte] <;> linarith [hmu.1, hmu.2] by_cases hy : z.2.2.1 = (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) · simpa [pairedFullMass, hy, i] using (mul_nonneg (mul_nonneg (div_nonneg hr (by norm_num)) h0) h1) · simp [pairedFullMass, hy]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedFullMass_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:31

The real mass of an explicit paired-law atom is its defining mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
z :
FullObs (2 * k)
fullMass (pairedLaw r theta) z = pairedFullMass r theta z
Proof (Lean source)
-- @node: pairedLaw_fullMass lemma pairedLaw_fullMass {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (z : FullObs (2 * k)) : fullMass (pairedLaw r theta) z = pairedFullMass r theta z := by change (ofReal (pairedFullMass r theta z)).toReal = _ exact ENNReal.toReal_ofReal (pairedFullMass_nonneg r theta z)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_fullMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:60
theorem pairedLaw_observedAtom

An observed paired-law atom has the stated Bernoulli mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
i :
Fin k
sigma a y :
jointMass (observedMarginal (pairedLaw r theta)) ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)) (if sigma then 1 else 0, i)) a y
= r.1 i / 4 * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i else 1 / 4) y
Proof (Lean source)
-- @node: pairedLaw_observedAtom lemma pairedLaw_observedAtom {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (i : Fin k) (sigma a y : Bool) : jointMass (observedMarginal (pairedLaw r theta)) ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)) (if sigma then 1 else 0, i)) a y = r.1 i / 4 * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i else 1 / 4) y := by dsimp only [jointMass, observedMarginal] rw [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal_jointMass] simp only [pairedLaw_fullMass] exact pairedFullMass_observedSum r theta i sigma a y
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_observedAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:68
def pairedKernelAtom

Conditional mass of one generated record from one draw of each input law.

Definition (Lean source)
k :
ℕ
xy :
Fin k × Fin k
z :
Obs (2 * k)
pairedKernelAtom xy z :
ℝ
pair :
(finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm z.1
((if pair.2 = xy.1 then bernoulliMass (if z.2.1 then 1 / 2 + (if pair.1 = 0 then (1 : ℝ) else -1) / 8 else 1 / 4) z.2.2 else 0) + (if pair.2 = xy.2 then bernoulliMass (if z.2.1 then 1 / 2 - (if pair.1 = 0 then (1 : ℝ) else -1) / 8 else 1 / 4) z.2.2 else 0)) / 8
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedKernelAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:83
theorem pairedKernelAtom_nonneg

The one-record kernel mass is nonnegative. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
xy :
Fin k × Fin k
z :
Obs (2 * k)
0 ≤ pairedKernelAtom xy z
Proof (Lean source)
-- @node: pairedKernelAtom_nonneg lemma pairedKernelAtom_nonneg {k : ℕ} (xy : Fin k × Fin k) (z : Obs (2 * k)) : 0 ≤ pairedKernelAtom xy z := by rcases z with ⟨j, a, y⟩ by_cases hs : ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 · have hs' : j.divNat = 0 := by simpa [finProdFinEquiv] using hs cases a <;> cases y <;> simp [pairedKernelAtom, bernoulliMass, finProdFinEquiv, hs'] <;> positivity · have hs' : j.divNat ≠ 0 := by simpa [finProdFinEquiv] using hs cases a <;> cases y <;> simp [pairedKernelAtom, bernoulliMass, finProdFinEquiv, hs'] <;> positivity
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedKernelAtom_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:96
theorem pairedKernelAtom_sum

The conditional record masses sum to one. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
xy :
Fin k × Fin k
∑ z : Obs (2 * k), pairedKernelAtom xy z = 1
Proof (Lean source)
-- @node: pairedKernelAtom_sum lemma pairedKernelAtom_sum {k : ℕ} (xy : Fin k × Fin k) : ∑ z : Obs (2 * k), pairedKernelAtom xy z = 1 := by classical simp only [Fintype.sum_prod_type] rw [← Equiv.sum_comp (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k))] simp [pairedKernelAtom, bernoulliMass, Fintype.sum_prod_type] norm_num [Finset.sum_add_distrib] simp only [div_eq_mul_inv, add_mul, Finset.sum_add_distrib] simp ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedKernelAtom_sum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:109
def pairedKernelPMF

The conditional distribution of one record given a draw from each input law.

Definition (Lean source)
k :
ℕ
xy :
Fin k × Fin k
pairedKernelPMF xy :
PMF (Obs (2 * k))
PMF.ofFintype (fun z => ofReal (pairedKernelAtom xy z)) (by rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => pairedKernelAtom_nonneg xy z), pairedKernelAtom_sum] norm_num)
def pairedSampleKernel

Independent conditional randomization at each sample coordinate.

Definition (Lean source)
k :
ℕ
n :
ℕ
x :
(Fin n → Fin k) × (Fin n → Fin k)
pairedSampleKernel n x :
PMF (Fin n → Obs (2 * k))
(pi (fun t : Fin n => (pairedKernelPMF (x.1 t, x.2 t)).toMeasure)).toPMF
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleKernel · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:130
theorem pairedSampleKernel_singleton

The conditional sample law factors over record coordinates. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
n :
ℕ
x :
(Fin n → Fin k) × (Fin n → Fin k)
z :
Fin n → Obs (2 * k)
= ∏ t : Fin n, ofReal (pairedKernelAtom (x.1 t, x.2 t) (z t))
Proof (Lean source)
-- @node: pairedSampleKernel_singleton lemma pairedSampleKernel_singleton {k : ℕ} (n : ℕ) (x : (Fin n → Fin k) × (Fin n → Fin k)) (z : Fin n → Obs (2 * k)) : pairedSampleKernel n x z = ∏ t : Fin n, ofReal (pairedKernelAtom (x.1 t, x.2 t) (z t)) := by simp only [pairedSampleKernel, MeasureTheory.Measure.toPMF_apply, MeasureTheory.Measure.pi_singleton] apply Finset.prod_congr rfl intro t _ rw [PMF.toMeasure_apply_singleton _ _ (MeasurableSet.singleton _)] rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleKernel_singleton · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:137

Mixing the conditional atom over independent input labels gives the target atom. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S :
ProbabilitySimplex k
i :
Fin k
u v :
ℝ
(∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * ((if i = xy.1 then u else 0) + (if i = xy.2 then v else 0)) / 8)
= (R.1 i * u + S.1 i * v) / 8
Proof (Lean source)
-- @node: pairedKernelMix_aux lemma pairedKernelMix_aux {k : ℕ} (R S : ProbabilitySimplex k) (i : Fin k) (u v : ℝ) : (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * ((if i = xy.1 then u else 0) + (if i = xy.2 then v else 0)) / 8) = (R.1 i * u + S.1 i * v) / 8 := by classical simp only [Fintype.sum_prod_type, div_eq_mul_inv, mul_add, mul_assoc, Finset.sum_add_distrib, Finset.sum_mul] simp [Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, R.2.2, S.2.2]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedKernelMix_aux · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:150
theorem pairedKernelAtom_mixed

Mixing the conditional atom over independent input labels gives the target atom. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S :
ProbabilitySimplex k
i :
Fin k
sigma a y :
(∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)) (if sigma then 1 else 0, i), a, y))
= (R.1 i * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y + S.1 i * bernoulliMass (if a then 1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y) / 8
Proof (Lean source)
-- @node: pairedKernelAtom_mixed lemma pairedKernelAtom_mixed {k : ℕ} (R S : ProbabilitySimplex k) (i : Fin k) (sigma a y : Bool) : (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)) (if sigma then 1 else 0, i), a, y)) = (R.1 i * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y + S.1 i * bernoulliMass (if a then 1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y) / 8 := by classical have h := pairedKernelMix_aux R S i (bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y) (bernoulliMass (if a then 1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y) cases sigma <;> simpa [pairedKernelAtom, mul_div_assoc] using h
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedKernelAtom_mixed · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:163

Pairing the two input samples coordinatewise is an equivalence.

Definition (Lean source)
n k :
ℕ
pairedSampleEquiv n k :
((Fin n → Fin k) × (Fin n → Fin k)) ≃ (Fin n → Fin k × Fin k)
clause 1
toFun x t := (x.1 t, x.2 t)
clause 2
invFun w := (fun t => (w t).1, fun t => (w t).2)
clause 3
left_inv := by intro x; cases x; rfl
clause 4
right_inv := by intro w; funext t; exact Prod.eta (w t)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleEquiv · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:186
theorem pairedSample_realFactorization

Finite product sums factor coordinatewise for paired samples. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k :
ℕ
R S :
ProbabilitySimplex k
z :
Fin n → Obs (2 * k)
(∑ x : (Fin n → Fin k) × (Fin n → Fin k), (∏ t, R.1 (x.1 t)) * (∏ t, S.1 (x.2 t)) * (∏ t, pairedKernelAtom (x.1 t, x.2 t) (z t)))
= ∏ t : Fin n, (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy (z t))
Proof (Lean source)
-- @node: pairedSample_realFactorization lemma pairedSample_realFactorization {n k : ℕ} (R S : ProbabilitySimplex k) (z : Fin n → Obs (2 * k)) : (∑ x : (Fin n → Fin k) × (Fin n → Fin k), (∏ t, R.1 (x.1 t)) * (∏ t, S.1 (x.2 t)) * (∏ t, pairedKernelAtom (x.1 t, x.2 t) (z t))) = ∏ t : Fin n, (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy (z t)) := by classical rw [Fintype.prod_sum] rw [← Equiv.sum_comp (pairedSampleEquiv n k)] apply Finset.sum_congr rfl intro x _ simp only [pairedSampleEquiv, Equiv.coe_fn_mk] rw [← Finset.prod_mul_distrib, ← Finset.prod_mul_distrib]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSample_realFactorization · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:195
theorem pairedSampleKernel_mixed

The fixed-sample kernel mixture factors into its one-record marginals. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k :
ℕ
R S :
ProbabilitySimplex k
z :
Fin n → Obs (2 * k)
(∑ x : (Fin n → Fin k) × (Fin n → Fin k), (twoSampleLaw n (R, S)) {x} * pairedSampleKernel n x z)
= ∏ t : Fin n, ofReal (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy (z t))
Proof (Lean source)
-- @node: pairedSampleKernel_mixed lemma pairedSampleKernel_mixed {n k : ℕ} (R S : ProbabilitySimplex k) (z : Fin n → Obs (2 * k)) : (∑ x : (Fin n → Fin k) × (Fin n → Fin k), (twoSampleLaw n (R, S)) {x} * pairedSampleKernel n x z) = ∏ t : Fin n, ofReal (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy (z t)) := by classical have hterm_nonneg (x : (Fin n → Fin k) × (Fin n → Fin k)) : 0 ≤ (∏ t, R.1 (x.1 t)) * (∏ t, S.1 (x.2 t)) * (∏ t, pairedKernelAtom (x.1 t, x.2 t) (z t)) := by exact mul_nonneg (mul_nonneg (Finset.prod_nonneg (fun t _ => R.2.1 (x.1 t))) (Finset.prod_nonneg (fun t _ => S.2.1 (x.2 t)))) (Finset.prod_nonneg (fun t _ => pairedKernelAtom_nonneg (x.1 t, x.2 t) (z t))) have hmix_nonneg (t : Fin n) : 0 ≤ ∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy (z t) := by apply Finset.sum_nonneg intro xy _ exact mul_nonneg (mul_nonneg (R.2.1 xy.1) (S.2.1 xy.2)) (pairedKernelAtom_nonneg xy (z t)) calc _ = ∑ x : (Fin n → Fin k) × (Fin n → Fin k), ofReal ((∏ t, R.1 (x.1 t)) * (∏ t, S.1 (x.2 t)) * (∏ t, pairedKernelAtom (x.1 t, x.2 t) (z t))) := by apply Finset.sum_congr rfl intro x _ rw [twoSampleLaw_singleton, pairedSampleKernel_singleton] simp only [simplexPMF, simplexPMF, PMF.ofFintype_apply] have hR : 0 ≤ ∏ t, R.1 (x.1 t) := Finset.prod_nonneg (fun t _ => R.2.1 (x.1 t)) have hS : 0 ≤ ∏ t, S.1 (x.2 t) := Finset.prod_nonneg (fun t _ => S.2.1 (x.2 t)) rw [ENNReal.ofReal_mul (mul_nonneg hR hS), ENNReal.ofReal_mul hR, ENNReal.ofReal_prod_of_nonneg (fun t _ => R.2.1 (x.1 t)), ENNReal.ofReal_prod_of_nonneg (fun t _ => S.2.1 (x.2 t)), ENNReal.ofReal_prod_of_nonneg (fun t _ => pairedKernelAtom_nonneg (x.1 t, x.2 t) (z t))] _ = ofReal (∑ x : (Fin n → Fin k) × (Fin n → Fin k), (∏ t, R.1 (x.1 t)) * (∏ t, S.1 (x.2 t)) * (∏ t, pairedKernelAtom (x.1 t, x.2 t) (z t))) := by rw [ENNReal.ofReal_sum_of_nonneg (fun x _ => hterm_nonneg x)] _ = ofReal (∏ t : Fin n, (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy (z t))) := by rw [pairedSample_realFactorization] _ = _ := ENNReal.ofReal_prod_of_nonneg (fun t _ => hmix_nonneg t)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleKernel_mixed · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:212
theorem pairedLaw_poCellMass

The explicit paired law has the prescribed mass in each covariate cell. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
j :
Fin (2 * k)
poCellMass (pairedLaw r theta) j
= r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2
Proof (Lean source)
-- @node: pairedLaw_poCellMass lemma pairedLaw_poCellMass {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (j : Fin (2 * k)) : poCellMass (pairedLaw r theta) j = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 := by simp [poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, pairedLaw_fullMass, pairedFullMass, bernoulliMass] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_poCellMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:267
theorem pairedLaw_poTreatmentAtom Lemma pairedLaw_poTreatmentAtom in the paper ↗

Both arms of a paired cell have equal treatment mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
j :
Fin (2 * k)
a :
= r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 4
Proof (Lean source)
-- @node: pairedLaw_poTreatmentAtom lemma pairedLaw_poTreatmentAtom {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (j : Fin (2 * k)) (a : Bool) : poTreatmentAtom (pairedLaw r theta) j a = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 4 := by cases a <;> simp [poTreatmentAtom, pairedLaw_fullMass, pairedFullMass, bernoulliMass] <;> ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_poTreatmentAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:278

Joint potential-outcome and treatment atoms factor under the paired law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
j :
Fin (2 * k)
a y0 y1 :
poJointAtom (pairedLaw r theta) j a y0 y1
= r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 4 * bernoulliMass (1 / 4) y0 * bernoulliMass (1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) y1
Proof (Lean source)
-- @node: pairedLaw_poJointAtom lemma pairedLaw_poJointAtom {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (j : Fin (2 * k)) (a y0 y1 : Bool) : poJointAtom (pairedLaw r theta) j a y0 y1 = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 4 * bernoulliMass (1 / 4) y0 * bernoulliMass (1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) y1 := by cases a <;> cases y0 <;> cases y1 <;> simp [poJointAtom, pairedLaw_fullMass, pairedFullMass, bernoulliMass]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_poJointAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:287

The paired potential-outcome atom is twice either arm's joint atom. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
j :
Fin (2 * k)
y0 y1 :
poPairAtom (pairedLaw r theta) j y0 y1
= r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * bernoulliMass (1 / 4) y0 * bernoulliMass (1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) y1
Proof (Lean source)
-- @node: pairedLaw_poPairAtom lemma pairedLaw_poPairAtom {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (j : Fin (2 * k)) (y0 y1 : Bool) : poPairAtom (pairedLaw r theta) j y0 y1 = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * bernoulliMass (1 / 4) y0 * bernoulliMass (1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) y1 := by change (∑ a : Bool, poJointAtom (pairedLaw r theta) j a y0 y1) = _ simp [pairedLaw_poJointAtom] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_poPairAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:303
theorem pairedLaw_causalRestrictions

The explicit paired law obeys consistency and joint exchangeability. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
conclusion 1
Consistency (pairedLaw r theta)
Proof (Lean source)
-- @node: pairedLaw_causalRestrictions lemma pairedLaw_causalRestrictions {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) : Consistency (pairedLaw r theta) ∧ ConditionalExchangeability (pairedLaw r theta) := by constructor · intro z hz rw [pairedLaw_fullMass] simp [pairedFullMass, hz] · intro j a y0 y1 rw [pairedLaw_poJointAtom, pairedLaw_poCellMass, pairedLaw_poTreatmentAtom, pairedLaw_poPairAtom] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_causalRestrictions · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:319

The numerator of a paired cell's conditional potential-outcome mean. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
j :
Fin (2 * k)
a :
Fin 2
(∑ arm : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (if (if a = 0 then y0 else y1) then 1 else 0 : ℝ) * fullMass (pairedLaw r theta) (j, arm, y, y0, y1))
= r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * (if a = 0 then (1 / 4 : ℝ) else 1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2)
Proof (Lean source)
-- @node: pairedLaw_poNumerator lemma pairedLaw_poNumerator {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (j : Fin (2 * k)) (a : Fin 2) : (∑ arm : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (if (if a = 0 then y0 else y1) then 1 else 0 : ℝ) * fullMass (pairedLaw r theta) (j, arm, y, y0, y1)) = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * (if a = 0 then (1 / 4 : ℝ) else 1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by fin_cases a <;> simp [pairedLaw_fullMass, pairedFullMass, bernoulliMass] <;> ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_poNumerator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:334
theorem pairedLaw_poRegression_weighted

Weighted conditional means of the explicit paired law match its parameters. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
j :
Fin (2 * k)
a :
Fin 2
poCellMass (pairedLaw r theta) j * poRegression (pairedLaw r theta) a j
= poCellMass (pairedLaw r theta) j * (if a = 0 then (1 / 4 : ℝ) else 1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2)
Proof (Lean source)
-- @node: pairedLaw_poRegression_weighted lemma pairedLaw_poRegression_weighted {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) (j : Fin (2 * k)) (a : Fin 2) : poCellMass (pairedLaw r theta) j * poRegression (pairedLaw r theta) a j = poCellMass (pairedLaw r theta) j * (if a = 0 then (1 / 4 : ℝ) else 1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by let p := r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 let mu : ℝ := if a = 0 then 1 / 4 else 1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 change poCellMass (pairedLaw r theta) j * ((∑ arm : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (if (if a = 0 then y0 else y1) then 1 else 0 : ℝ) * fullMass (pairedLaw r theta) (j, arm, y, y0, y1)) / poCellMass (pairedLaw r theta) j) = _ rw [pairedLaw_poCellMass, pairedLaw_poNumerator] change p * (p * mu / p) = p * mu by_cases hp : p = 0 · simp [hp] · field_simp
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_poRegression_weighted · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:350

The explicit paired law is one of the admissible causal completions. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
r :
ProbabilitySimplex k
theta :
PairedCompletion (pairedLaw r theta) r theta
Proof (Lean source)
-- @node: pairedLaw_completion lemma pairedLaw_completion {k : ℕ} (r : ProbabilitySimplex k) (theta : PairedContrasts k) : PairedCompletion (pairedLaw r theta) r theta := by refine ⟨(pairedLaw_causalRestrictions r theta).1, (pairedLaw_causalRestrictions r theta).2, ?_⟩ intro j refine ⟨pairedLaw_poCellMass r theta j, ?_, ?_, ?_⟩ · rw [pairedLaw_poTreatmentAtom, pairedLaw_poCellMass] ring · simpa using pairedLaw_poRegression_weighted r theta j 0 · simpa using pairedLaw_poRegression_weighted r theta j 1
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedLaw_completion · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:379
theorem productLaw_singleton_budget

The fixed-sample observed law factors into its one-record atom masses. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
P :
n :
ℕ
z :
Fin n → Obs d
productLaw P n {z} = ∏ t : Fin n, P.pmf (z t)
Proof (Lean source)
-- @node: productLaw_singleton_budget lemma productLaw_singleton_budget {d : ℕ} (P : DiscreteLaw d) (n : ℕ) (z : Fin n → Obs d) : productLaw P n {z} = ∏ t : Fin n, P.pmf (z t) := by simp only [productLaw, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.productLaw, MeasureTheory.Measure.pi_singleton] apply Finset.prod_congr rfl intro t _ exact PMF.toMeasure_apply_singleton _ _ (MeasurableSet.singleton _)
CausalSmith.Stat.DiscreteBudgetvalueCurve.productLaw_singleton_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:392
theorem normalizedPairedMassContrast Lemma normalizedPairedMassContrast in the paper ↗

The normalized contrast has the exact signed mass needed by the sampling kernel. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
i :
Fin k
r.1 i * theta.1 i = (R.1 i - S.1 i) / 16
Proof (Lean source)
-- @node: normalizedPairedMassContrast lemma normalizedPairedMassContrast {k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) (i : Fin k) : r.1 i * theta.1 i = (R.1 i - S.1 i) / 16 := by rw [hr i, htheta i] by_cases h : R.1 i + S.1 i = 0 · have hR : R.1 i = 0 := by linarith [R.2.1 i, S.2.1 i] have hS : S.1 i = 0 := by linarith [R.2.1 i, S.2.1 i] simp [h, hR, hS] · simp only [h, ↓reduceIte] field_simp nlinarith [h]
CausalSmith.Stat.DiscreteBudgetvalueCurve.normalizedPairedMassContrast · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:403
theorem normalizedPairedTreatedAtom Lemma normalizedPairedTreatedAtom in the paper ↗

The treated outcome atom is a fixed mixture of the two input-label atoms. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
i :
Fin k
sigma y :
r.1 i * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i) y
= (R.1 i * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8) y + S.1 i * bernoulliMass (1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8) y) / 2
Proof (Lean source)
-- @node: normalizedPairedTreatedAtom lemma normalizedPairedTreatedAtom {k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) (i : Fin k) (sigma y : Bool) : r.1 i * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i) y = (R.1 i * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8) y + S.1 i * bernoulliMass (1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8) y) / 2 := by have hm := normalizedPairedMassContrast R S r theta hr htheta i have hr' := hr i cases sigma <;> cases y <;> simp only [Bool.false_eq_true, Bool.true_eq_false, ↓reduceIte, bernoulliMass] <;> nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.normalizedPairedTreatedAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:422
theorem normalizedPairedObservedAtom Lemma normalizedPairedObservedAtom in the paper ↗

Every observed atom of the normalized pair is an equal mixture of the corresponding atoms produced from the two input labels. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
i :
Fin k
sigma a y :
r.1 i / 4 * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i else 1 / 4) y
= (R.1 i * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y + S.1 i * bernoulliMass (if a then 1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y) / 8
Proof (Lean source)
-- @node: normalizedPairedObservedAtom lemma normalizedPairedObservedAtom {k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) (i : Fin k) (sigma a y : Bool) : r.1 i / 4 * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i else 1 / 4) y = (R.1 i * bernoulliMass (if a then 1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y + S.1 i * bernoulliMass (if a then 1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8 else 1 / 4) y) / 8 := by cases a · rw [hr i] cases y <;> simp [bernoulliMass] <;> ring · have h := normalizedPairedTreatedAtom R S r theta hr htheta i sigma y simp only [↓reduceIte] calc r.1 i / 4 * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i) y = (r.1 i * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) * theta.1 i) y) / 4 := by ring _ = ((R.1 i * bernoulliMass (1 / 2 + (if sigma then (-1 : ℝ) else 1) / 8) y + S.1 i * bernoulliMass (1 / 2 - (if sigma then (-1 : ℝ) else 1) / 8) y) / 2) / 4 := by rw [h] _ = _ := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.normalizedPairedObservedAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:442
theorem pairedKernelAtom_mixed_observed

The kernel mixture is exactly each normalized paired observed atom. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
z :
Obs (2 * k)
(∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy z)
= jointMass (observedMarginal (pairedLaw r theta)) z.1 z.2.1 z.2.2
Proof (Lean source)
-- @node: pairedKernelAtom_mixed_observed lemma pairedKernelAtom_mixed_observed {k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) (z : Obs (2 * k)) : (∑ xy : Fin k × Fin k, R.1 xy.1 * S.1 xy.2 * pairedKernelAtom xy z) = jointMass (observedMarginal (pairedLaw r theta)) z.1 z.2.1 z.2.2 := by rcases z with ⟨j, a, y⟩ obtain ⟨⟨s, i⟩, rfl⟩ := (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).surjective j fin_cases s · exact (pairedKernelAtom_mixed R S i false a y).trans ((normalizedPairedObservedAtom R S r theta hr htheta i false a y).symm.trans (pairedLaw_observedAtom r theta i false a y).symm) · exact (pairedKernelAtom_mixed R S i true a y).trans ((normalizedPairedObservedAtom R S r theta hr htheta i true a y).symm.trans (pairedLaw_observedAtom r theta i true a y).symm)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedKernelAtom_mixed_observed · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:477
theorem pairedSampleKernel_reproduces

The parameter-free fixed-sample kernel reproduces the normalized observed law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
z :
Fin n → Obs (2 * k)
(∑ x : (Fin n → Fin k) × (Fin n → Fin k), (twoSampleLaw n (R, S)) {x} * pairedSampleKernel n x z)
= (productLaw (observedMarginal (pairedLaw r theta)) n) {z}
Proof (Lean source)
-- @node: pairedSampleKernel_reproduces lemma pairedSampleKernel_reproduces {n k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) (z : Fin n → Obs (2 * k)) : (∑ x : (Fin n → Fin k) × (Fin n → Fin k), (twoSampleLaw n (R, S)) {x} * pairedSampleKernel n x z) = (productLaw (observedMarginal (pairedLaw r theta)) n) {z} := by rw [pairedSampleKernel_mixed, productLaw_singleton_budget] apply Finset.prod_congr rfl intro t _ rw [pairedKernelAtom_mixed_observed R S r theta hr htheta] change ofReal (((observedMarginal (pairedLaw r theta)).pmf (z t)).toReal) = _ exact ENNReal.ofReal_toReal (PMF.apply_ne_top _ _)
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSampleKernel_reproduces · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PairedObservedAtom.lean:500
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.PilotEvents 1 declarations Good-pilot event for each observed cell.

Good-pilot event for each observed cell.

All four pilot coordinates fall within one quarter of their local radii.

Definition (Lean source)
n d :
ℕ
P :
sample :
Fin n → Obs d
perm :
Perm (Fin n)
M :
ℕ
marks :
Fin n → Bool
j :
Fin d
zeta :
Cell
pilotGood P sample perm M marks j :
Prop
|pilotCenter ((n : ℝ) / 8) (fun z => markedCellCount sample perm M marks false j z) zeta
- cellVector P j zeta|
≤ pilotHalfWidth ((n : ℝ) / 8) d (fun z => markedCellCount sample perm M marks false j z) zeta / 4
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.PilotRadiusMoment 5 declarations Ordinary second moments of the paper's pilot rectangle radii.

Ordinary second moments of the paper's pilot rectangle radii.

theorem pilotHalfWidth_eq_empiricalRadius

The paper's pilot half-width is exactly the promoted empirical Poisson radius with multiplier 4096 and logarithmic level logAlphabet d. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m :
ℝ
hm :
0 < m
d :
ℕ
pilot :
Cell → ℕ
zeta :
Cell
pilotHalfWidth m d pilot zeta
= empiricalRadius pilotRadiusConstant (toNNReal m) (logAlphabet d / m) (pilot zeta)
Proof (Lean source)
-- @node: pilotHalfWidth_eq_empiricalRadius lemma pilotHalfWidth_eq_empiricalRadius {m : ℝ} (hm : 0 < m) (d : ℕ) (pilot : Cell → ℕ) (zeta : Cell) : pilotHalfWidth m d pilot zeta = empiricalRadius pilotRadiusConstant (toNNReal m) (logAlphabet d / m) (pilot zeta) := by unfold pilotHalfWidth empiricalRadius pilotCenter rw [Real.coe_toNNReal m hm.le] congr 3 ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotHalfWidth_eq_empiricalRadius · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PilotRadiusMoment.lean:16

The local mass scale v_j with L = log(ed) and m = n/8.

Definition (Lean source)
n d :
ℕ
P :
j :
Fin d
badPilotCellScale P j :
ℝ
m :
(n : ℝ) / 8
L :
logAlphabet d
sqrt (cellMass P j * L / m) + L / m
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilotCellScale · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PilotRadiusMoment.lean:29
theorem pilotRadius_le_pilotHalfWidth Lemma pilotRadius_le_pilotHalfWidth in the paper ↗

Truncating the lower endpoint of a nonnegative pilot interval can only decrease its radius below the untruncated half-width. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
zeta :
Cell
pilotRadius m d pilot zeta ≤ pilotHalfWidth m d pilot zeta
Proof (Lean source)
-- @node: pilotRadius_le_pilotHalfWidth lemma pilotRadius_le_pilotHalfWidth {m : ℝ} (hm : 0 < m) {d : ℕ} (hd : 1 ≤ d) (pilot : Cell → ℕ) (zeta : Cell) : pilotRadius m d pilot zeta ≤ pilotHalfWidth m d pilot zeta := by have hc : 0 ≤ pilotCenter m pilot zeta := by unfold pilotCenter positivity have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdreal] have hh : 0 ≤ pilotHalfWidth m d pilot zeta := by unfold pilotHalfWidth pilotRadiusConstant positivity unfold pilotRadius pilotUpper pilotLower have hlo := le_max_right (0 : ℝ) (pilotCenter m pilot zeta - pilotHalfWidth m d pilot zeta) linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadius_le_pilotHalfWidth · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PilotRadiusMoment.lean:36
theorem pilotRadius_sq_le_count_envelope

A single squared pilot radius is bounded by an affine function of its Poisson count. With the specified inputs and conditions, the stated relationship holds.

Formal statement
m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
zeta :
Cell
pilotRadius m d pilot zeta ^ 2
≤ 2 * pilotRadiusConstant ^ 2 * ((pilot zeta : ℝ) * logAlphabet d / m ^ 2 + (logAlphabet d / m) ^ 2)
Proof (Lean source)
-- @node: pilotRadius_sq_le_count_envelope lemma pilotRadius_sq_le_count_envelope {m : ℝ} (hm : 0 < m) {d : ℕ} (hd : 1 ≤ d) (pilot : Cell → ℕ) (zeta : Cell) : pilotRadius m d pilot zeta ^ 2 ≤ 2 * pilotRadiusConstant ^ 2 * ((pilot zeta : ℝ) * logAlphabet d / m ^ 2 + (logAlphabet d / m) ^ 2) := by have hL : 0 ≤ logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdreal : (1 : ℝ) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg hdreal] have hR0 : 0 ≤ pilotRadius m d pilot zeta := by have hc : 0 ≤ pilotCenter m pilot zeta := by unfold pilotCenter positivity have hh : 0 ≤ pilotHalfWidth m d pilot zeta := by unfold pilotHalfWidth pilotRadiusConstant positivity unfold pilotRadius pilotUpper pilotLower have hlo : max 0 (pilotCenter m pilot zeta - pilotHalfWidth m d pilot zeta) ≤ pilotCenter m pilot zeta + pilotHalfWidth m d pilot zeta := by apply max_le <;> linarith linarith have hhalf := pilotRadius_le_pilotHalfWidth hm hd pilot zeta let A := (pilot zeta : ℝ) * logAlphabet d / m ^ 2 let delta := logAlphabet d / m have hA : 0 ≤ A := by dsimp [A]; positivity have hd0 : 0 ≤ delta := by dsimp [delta]; positivity have hsqrt := Real.sq_sqrt hA have hformula : pilotHalfWidth m d pilot zeta = pilotRadiusConstant * (sqrt A + delta) := by unfold pilotHalfWidth pilotCenter dsimp [A, delta] congr 2 field_simp have hhalf0 : 0 ≤ pilotHalfWidth m d pilot zeta := by rw [hformula] unfold pilotRadiusConstant positivity have hsq : pilotRadius m d pilot zeta ^ 2 ≤ pilotHalfWidth m d pilot zeta ^ 2 := (sq_le_sq₀ hR0 hhalf0).2 hhalf rw [hformula] at hsq dsimp [A, delta] at hsqrt ⊢ nlinarith [sq_nonneg (sqrt ((pilot zeta : ℝ) * logAlphabet d / m ^ 2) - logAlphabet d / m)]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadius_sq_le_count_envelope · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PilotRadiusMoment.lean:58
theorem pilotRadius_sum_sq_integral_le_cellScale

Under the flattened pilot Poisson table law, the squared sum of the four pilot radii has the ordinary second-moment bound required in equation (21). With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
m :
(n : ℝ) / 8 (: ℝ)
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → ℝ≥0)
μ :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
Integrable (fun p => (∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta) ^ 2) μ
(∫ p, (∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta) ^ 2 ∂μ)
≤ 32 * pilotRadiusConstant ^ 2 * badPilotCellScale (n := n) P j ^ 2
Proof (Lean source)
-- @node: pilotRadius_sum_sq_integral_le_cellScale lemma pilotRadius_sum_sq_integral_le_cellScale {n d : ℕ} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : let m : ℝ := (n : ℝ) / 8 let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) Integrable (fun p => (∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta) ^ 2) μ ∧ (∫ p, (∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta) ^ 2 ∂μ) ≤ 32 * pilotRadiusConstant ^ 2 * badPilotCellScale (n := n) P j ^ 2 := by dsimp only let m : ℝ := (n : ℝ) / 8 let L : ℝ := logAlphabet d let rate : Fin d → Fin 4 → ℝ≥0 := idealFlatRate (n := n) P let μ := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let N : Cell → ((Fin d × Fin 4) → ℕ) → ℝ := fun z p => (p (j, CellFourEquiv z) : ℕ) have hm : 0 < m := by dsimp [m]; positivity letI : IsProbabilityMeasure μ := by dsimp [μ, poissonTableLaw] infer_instance have hL : 0 < L := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have : (1 : ℝ) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg this] have hNlaw (z : Cell) : HasLaw (fun p => p (j, CellFourEquiv z)) (poissonMeasure (rate j (CellFourEquiv z))) μ := by simpa [N, μ, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, CellFourEquiv z) have hNint (z : Cell) : Integrable (N z) μ := by have hi : Integrable (fun w : ℕ => (w : ℝ)) (poissonMeasure (rate j (CellFourEquiv z))) := by simpa using poisson_descFactorial_integrable (rate j (CellFourEquiv z)) 1 have hi' : Integrable (fun w : ℕ => (w : ℝ)) (Measure.map (fun p => p (j, CellFourEquiv z)) μ) := by rw [(hNlaw z).map_eq] exact hi exact hi'.comp_aemeasurable (measurable_pi_apply (j, CellFourEquiv z)).aemeasurable have hNmean (z : Cell) : (∫ p, N z p ∂μ) = (rate j (CellFourEquiv z) : ℝ) := by calc (∫ p, N z p ∂μ) = ∫ w : ℕ, (w : ℝ) ∂poissonMeasure (rate j (CellFourEquiv z)) := by simpa [N, Function.comp_def] using (hNlaw z).integral_comp (f := fun w : ℕ => (w : ℝ)) (measurable_of_countable _).aestronglyMeasurable _ = _ := by simpa using poisson_descFactorial_moment (rate j (CellFourEquiv z)) 1 let f : ((Fin d × Fin 4) → ℕ) → ℝ := fun p => (∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta) ^ 2 let g : ((Fin d × Fin 4) → ℕ) → ℝ := fun p => 8 * pilotRadiusConstant ^ 2 * (L / m ^ 2 * ∑ zeta : Cell, N zeta p + 4 * (L / m) ^ 2) have hpoint (p : (Fin d × Fin 4) → ℕ) : f p ≤ g p := by have hcs := sq_sum_le_card_mul_sum_sq (s := univ) (f := fun zeta : Cell => pilotRadius m d (curryCountTable p j) zeta) have hcoord (zeta : Cell) : pilotRadius m d (curryCountTable p j) zeta ^ 2 ≤ 2 * pilotRadiusConstant ^ 2 * (N zeta p * L / m ^ 2 + (L / m) ^ 2) := by simpa [N, m, L, curryCountTable] using pilotRadius_sq_le_count_envelope hm (show 1 ≤ d by omega) (curryCountTable p j) zeta calc f p ≤ 4 * ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta ^ 2 := by simpa [f, Fintype.card_congr CellFourEquiv] using hcs _ ≤ 4 * ∑ zeta : Cell, (2 * pilotRadiusConstant ^ 2 * (N zeta p * L / m ^ 2 + (L / m) ^ 2)) := by gcongr with zeta exact hcoord zeta _ = g p := by dsimp [g] simp_rw [Fintype.sum_prod_type, Fin.sum_univ_two] ring have hgint : Integrable g μ := by apply Integrable.const_mul apply Integrable.add · exact (integrable_finset_sum _ fun z _ => hNint z).const_mul _ · exact integrable_const _ have hfint : Integrable f μ := by apply hgint.mono' (by fun_prop) filter_upwards [] with p rw [Real.norm_eq_abs, abs_of_nonneg] · exact hpoint p · dsimp [f] positivity have hint : (∫ p, f p ∂μ) ≤ ∫ p, g p ∂μ := integral_mono hfint hgint hpoint have hrate (z : Cell) : (rate j (CellFourEquiv z) : ℝ) = m * cellVector P j z := by simp only [rate, idealFlatRate, Real.coe_toNNReal, Equiv.symm_apply_apply, m] exact max_eq_left (mul_nonneg hm.le ENNReal.toReal_nonneg) have hmass : ∑ z : Cell, cellVector P j z = cellMass P j := by rw [Fintype.sum_prod_type] simp_rw [Fin.sum_univ_two] simp [cellMass, cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring have hgmean : (∫ p, g p ∂μ) = 8 * pilotRadiusConstant ^ 2 * (cellMass P j * L / m + 4 * (L / m) ^ 2) := by change (∫ p, 8 * pilotRadiusConstant ^ 2 * (L / m ^ 2 * ∑ zeta : Cell, N zeta p + 4 * (L / m) ^ 2) ∂μ) = _ rw [integral_const_mul, integral_add] · rw [integral_const_mul, integral_finset_sum _ (fun z _ => hNint z)] simp_rw [hNmean] rw [integral_const] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] simp_rw [hrate] rw [← Finset.mul_sum, hmass] field_simp · exact (integrable_finset_sum _ fun z _ => hNint z).const_mul _ · exact integrable_const _ refine ⟨by simpa [f] using hfint, ?_⟩ rw [show (fun p => (∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta) ^ 2) = f by rfl] calc (∫ p, f p ∂μ) ≤ ∫ p, g p ∂μ := hint _ = 8 * pilotRadiusConstant ^ 2 * (cellMass P j * L / m + 4 * (L / m) ^ 2) := hgmean _ ≤ 32 * pilotRadiusConstant ^ 2 * (sqrt (cellMass P j * L / m) + L / m) ^ 2 := by have hmass0 : 0 ≤ cellMass P j := by rw [← hmass] exact Finset.sum_nonneg fun z _ => ENNReal.toReal_nonneg have hA : 0 ≤ cellMass P j * L / m := by positivity have hsqrt := Real.sq_sqrt hA have hdelta : 0 ≤ L / m := by positivity have hcross := mul_nonneg (Real.sqrt_nonneg (cellMass P j * L / m)) hdelta unfold pilotRadiusConstant norm_num nlinarith _ = _ := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadius_sum_sq_integral_le_cellScale · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PilotRadiusMoment.lean:109
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.PoissonSplit 2 declarations Exact finite auxiliary weights for the capped Poisson split.

Exact finite auxiliary weights for the capped Poisson split.

def auxiliaryWeight

The probability weight of one Poisson count, permutation, and marking.

Definition (Lean source)
n M :
ℕ
auxiliaryWeight n M :
ℝ
((poissonMeasure ((n : ℝ≥0) / 4)) {M}).toReal / ((card (Perm (Fin n)) : ℝ) * (card (Fin n → Bool) : ℝ))
CausalSmith.Stat.DiscreteBudgetvalueCurve.auxiliaryWeight · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PoissonSplit.lean:12
def auxiliaryAverage

Finite expectation over the nonzero cap-event outcomes.

Definition (Lean source)
n :
ℕ
f :
ℕ → Perm (Fin n) → (Fin n → Bool) → ℝ
auxiliaryAverage n f :
ℝ
∑ M ∈ range (n + 1), ∑ perm : Perm (Fin n), ∑ marks : Fin n → Bool, auxiliaryWeight n M * f M perm marks
CausalSmith.Stat.DiscreteBudgetvalueCurve.auxiliaryAverage · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/PoissonSplit.lean:18
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.ScalarBias 18 declarations Boundary-adaptive Jackson approximation and scalar cell bias.

Boundary-adaptive Jackson approximation and scalar cell bias.

theorem localJacksonPolynomial_boundary_adaptive Lemma localJacksonPolynomial_boundary_adaptive in the paper ↗

The paper's canonical normalized polynomial, after affine substitution, inherits the promoted physical-coordinate boundary-adaptive estimate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
K :
ℕ
hK :
0 < K
center radius y :
Cell → ℝ
hR :
∀ zeta, 0 < radius zeta
hlower :
∀ zeta, 0 ≤ center zeta - radius zeta
hy :
∀ zeta, |y zeta - center zeta| ≤ radius zeta
|thresholdFunReal epsilon lambda center
+ eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => y (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda K center radius)
- thresholdFunReal epsilon lambda y|
≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (sqrt ((y (CellFourEquiv.symm i) - (center (CellFourEquiv.symm i) - radius (CellFourEquiv.symm i))) * ((center (CellFourEquiv.symm i) + radius (CellFourEquiv.symm i)) - y (CellFourEquiv.symm i))) / (K : ℝ) + radius (CellFourEquiv.symm i) / (K : ℝ) ^ 2)
Proof (Lean source)
-- @node: localJacksonPolynomial_boundary_adaptive lemma localJacksonPolynomial_boundary_adaptive (epsilon : ℝ) (he : 0 < epsilon) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) (K : ℕ) (hK : 0 < K) (center radius y : Cell → ℝ) (hR : ∀ zeta, 0 < radius zeta) (hlower : ∀ zeta, 0 ≤ center zeta - radius zeta) (hy : ∀ zeta, |y zeta - center zeta| ≤ radius zeta) : |thresholdFunReal epsilon lambda center + eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => y (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda K center radius) - thresholdFunReal epsilon lambda y| ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (sqrt ((y (CellFourEquiv.symm i) - (center (CellFourEquiv.symm i) - radius (CellFourEquiv.symm i))) * ((center (CellFourEquiv.symm i) + radius (CellFourEquiv.symm i)) - y (CellFourEquiv.symm i))) / (K : ℝ) + radius (CellFourEquiv.symm i) / (K : ℝ) ^ 2) := by classical let c : Fin 4 → ℝ := fun i => center (CellFourEquiv.symm i) let r : Fin 4 → ℝ := fun i => radius (CellFourEquiv.symm i) let yy : Fin 4 → ℝ := fun i => y (CellFourEquiv.symm i) let f : (Fin 4 → ℝ) → ℝ := fun u => thresholdFunReal epsilon lambda (fun zeta => u (CellFourEquiv zeta)) let L : ℝ := 3 * (1 + epsilon⁻¹) + 1 let q : MvPolynomial (Fin 4) ℝ := localJacksonPolynomial epsilon lambda K center radius + C (thresholdFunReal epsilon lambda center) have hr : ∀ i, 0 < r i := fun i => hR (CellFourEquiv.symm i) have hrect_nonneg {u : Fin 4 → ℝ} (hu : u ∈ centeredRectangle c r) (i : Fin 4) : 0 ≤ u i := by have hlo := hlower (CellFourEquiv.symm i) have hui := hu i dsimp [c, r] at hlo hui have hleft := (abs_le.mp hui).1 linarith have hL : 0 ≤ L := by dsimp [L] have hie : 0 < epsilon⁻¹ := inv_pos.mpr he positivity have hlip : ∀ u ∈ centeredRectangle c r, ∀ v ∈ centeredRectangle c r, |f u - f v| ≤ L * ∑ i, |u i - v i| := by intro u hu v hv have hb := budget_thresholdFunReal_pointwise_lipschitz he lambda hlambda (fun zeta => u (CellFourEquiv zeta)) (fun zeta => v (CellFourEquiv zeta)) (fun zeta => hrect_nonneg hu (CellFourEquiv zeta)) (fun zeta => hrect_nonneg hv (CellFourEquiv zeta)) have hsum : (∑ zeta : Cell, |u (CellFourEquiv zeta) - v (CellFourEquiv zeta)|) = ∑ i : Fin 4, |u i - v i| := CellFourEquiv.sum_comp (fun i => |u i - v i|) simpa [f, L, hsum] using hb have hf : ContinuousOn f (centeredRectangle c r) := by have hLip : LipschitzOnWith ⟨4 * L, mul_nonneg (by norm_num) hL⟩ f (centeredRectangle c r) := by apply LipschitzOnWith.of_dist_le_mul intro u hu v hv rw [Real.dist_eq] have h := hlip u hu v hv apply h.trans change L * ∑ i, |u i - v i| ≤ (4 * L) * dist u v have hsum : ∑ i : Fin 4, |u i - v i| ≤ 4 * dist u v := by calc _ ≤ ∑ _i : Fin 4, dist u v := by gcongr with i simpa [Real.dist_eq] using dist_le_pi_dist u v i _ = 4 * dist u v := by simp nlinarith exact hLip.continuousOn have hpull : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun zeta => affinePoint c r z (CellFourEquiv zeta))) (normalizedCube 4) := by have haff : Continuous (affinePoint c r) := by apply continuous_pi intro i exact continuous_const.add (continuous_const.mul (continuous_apply i)) exact hf.comp haff.continuousOn (fun z hz => affinePoint_mem_centeredRectangle c r z hr hz) have hqeval (x : Fin 4 → ℝ) : eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x := by rw [show eval (cosPoint x) q = eval (cosPoint x) (localJacksonPolynomial epsilon lambda K center radius) + thresholdFunReal epsilon lambda center by simp [q]] have heval := localJacksonPolynomial_eval_cos epsilon lambda K center radius hK (by simpa [c, r, affinePoint] using hpull) x change eval (fun i => cos (x i)) (localJacksonPolynomial epsilon lambda K center radius) + thresholdFunReal epsilon lambda center = _ rw [heval] simp [localJacksonConvolution, f, c, r, affinePoint] have hqcoord : ∀ m ∈ q.support, ∀ i, m i ≤ 2 * (K - 1) := by intro m hm i apply (MvPolynomial.monomial_le_degreeOf i hm).trans refine (MvPolynomial.degreeOf_add_le i _ _).trans (max_le ?_ ?_) · exact localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK (by simpa [c, r] using hpull) i · simp obtain ⟨p, hpeval, _, _, _⟩ := mvPolynomial_affine_substitution_four q c r (2 * (K - 1)) hr hqcoord have hyy : yy ∈ centeredRectangle c r := by intro i exact hy (CellFourEquiv.symm i) have happ := affineJackson_boundary_adaptive_four hK c r hr f hf L hL hlip p q hpeval hqeval yy hyy rw [hpeval yy] at happ simpa [c, r, yy, f, q, L, add_assoc, add_comm, add_left_comm] using happ
CausalSmith.Stat.DiscreteBudgetvalueCurve.localJacksonPolynomial_boundary_adaptive · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:20
theorem goodPilot_localJacksonPolynomial_boundary_adaptive

On a good pilot cell, the promoted boundary-adaptive estimate applies at the true four-cell vector, including coordinates of zero mass. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
m :
(n : ℝ) / 8 (: ℝ)
center :
pilotMidpoint m d (counts.1 j)
radius :
pilotRadius m d (counts.1 j)
q :
|thresholdFunReal epsilon lambda center
+ eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => q (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) center radius)
- thresholdFunReal epsilon lambda q|
≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (sqrt ((q (CellFourEquiv.symm i) - (center (CellFourEquiv.symm i) - radius (CellFourEquiv.symm i))) * ((center (CellFourEquiv.symm i) + radius (CellFourEquiv.symm i)) - q (CellFourEquiv.symm i))) / (jacksonDegree d : ℝ) + radius (CellFourEquiv.symm i) / (jacksonDegree d : ℝ) ^ 2)
Proof (Lean source)
-- @node: goodPilot_localJacksonPolynomial_boundary_adaptive lemma goodPilot_localJacksonPolynomial_boundary_adaptive {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) : let m : ℝ := (n : ℝ) / 8 let center := pilotMidpoint m d (counts.1 j) let radius := pilotRadius m d (counts.1 j) let q := cellVector P j |thresholdFunReal epsilon lambda center + eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => q (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) center radius) - thresholdFunReal epsilon lambda q| ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (sqrt ((q (CellFourEquiv.symm i) - (center (CellFourEquiv.symm i) - radius (CellFourEquiv.symm i))) * ((center (CellFourEquiv.symm i) + radius (CellFourEquiv.symm i)) - q (CellFourEquiv.symm i))) / (jacksonDegree d : ℝ) + radius (CellFourEquiv.symm i) / (jacksonDegree d : ℝ) ^ 2) := by dsimp only let m : ℝ := (n : ℝ) / 8 let center := pilotMidpoint m d (counts.1 j) let radius := pilotRadius m d (counts.1 j) have hm : 0 < m := by dsimp [m]; positivity have hR : ∀ zeta, 0 < radius zeta := fun zeta => by exact pilotRadius_pos_of_pos hm hd (counts.1 j) zeta have hlower : ∀ zeta, 0 ≤ center zeta - radius zeta := fun zeta => by dsimp [center, radius] unfold pilotMidpoint pilotRadius have hlo : 0 ≤ pilotLower m d (counts.1 j) zeta := le_max_left _ _ linarith exact localJacksonPolynomial_boundary_adaptive epsilon he lambda hlambda (jacksonDegree d) (by unfold jacksonDegree; omega) center radius (cellVector P j) hR hlower (idealPilotGood_center_mem_radius hn P counts j hgood)
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_localJacksonPolynomial_boundary_adaptive · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:137
theorem goodPilot_localJacksonPolynomial_boundary_le_radiusSum

The boundary-adaptive Jackson remainder on a good pilot cell is bounded by the pilot radius sum times the usual first and second degree factors. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
epsilon :
he :
0 < epsilon
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → Nat) × (Fin d → Cell → Nat)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
m :
(n : Real) / 8 (: Real)
center :
pilotMidpoint m d (counts.1 j)
radius :
pilotRadius m d (counts.1 j)
q :
|thresholdFunReal epsilon lambda center
+ eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => q (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) center radius)
- thresholdFunReal epsilon lambda q|
≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2) * ∑ zeta : Cell, radius zeta
Proof (Lean source)
-- @node: goodPilot_localJacksonPolynomial_boundary_le_radiusSum lemma goodPilot_localJacksonPolynomial_boundary_le_radiusSum {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) : let m : Real := (n : Real) / 8 let center := pilotMidpoint m d (counts.1 j) let radius := pilotRadius m d (counts.1 j) let q := cellVector P j |thresholdFunReal epsilon lambda center + eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => q (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) center radius) - thresholdFunReal epsilon lambda q| ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2) * ∑ zeta : Cell, radius zeta := by dsimp only let m : Real := (n : Real) / 8 let center := pilotMidpoint m d (counts.1 j) let radius := pilotRadius m d (counts.1 j) let q := cellVector P j let K : Real := jacksonDegree d have hK : 0 < K := by dsimp [K] exact_mod_cast (show 0 < jacksonDegree d by unfold jacksonDegree; omega) have hr (zeta : Cell) : 0 ≤ radius zeta := by exact (pilotRadius_pos_of_pos (by dsimp [m]; positivity) hd (counts.1 j) zeta).le have hmem := idealPilotGood_center_mem_radius hn P counts j hgood have hterm (i : Fin 4) : sqrt ((q (CellFourEquiv.symm i) - (center (CellFourEquiv.symm i) - radius (CellFourEquiv.symm i))) * ((center (CellFourEquiv.symm i) + radius (CellFourEquiv.symm i)) - q (CellFourEquiv.symm i))) / K + radius (CellFourEquiv.symm i) / K ^ 2 ≤ (2 / K + 1 / K ^ 2) * radius (CellFourEquiv.symm i) := by let zeta := CellFourEquiv.symm i have habs := abs_le.mp (hmem zeta) have ha : 0 ≤ q zeta - (center zeta - radius zeta) := by linarith have hb : 0 ≤ (center zeta + radius zeta) - q zeta := by linarith have ha' : q zeta - (center zeta - radius zeta) ≤ 2 * radius zeta := by linarith have hb' : (center zeta + radius zeta) - q zeta ≤ 2 * radius zeta := by linarith have hprod : (q zeta - (center zeta - radius zeta)) * ((center zeta + radius zeta) - q zeta) ≤ (2 * radius zeta) ^ 2 := by simpa [pow_two] using mul_le_mul ha' hb' hb (mul_nonneg (by norm_num) (hr zeta)) have hsqrt : sqrt ((q zeta - (center zeta - radius zeta)) * ((center zeta + radius zeta) - q zeta)) ≤ 2 * radius zeta := by exact (Real.sqrt_le_iff).2 ⟨mul_nonneg (by norm_num) (hr zeta), by simpa using hprod⟩ dsimp only [zeta] at hsqrt ⊢ calc _ ≤ (2 * radius (CellFourEquiv.symm i)) / K + radius (CellFourEquiv.symm i) / K ^ 2 := by gcongr _ = _ := by ring have hbase := goodPilot_localJacksonPolynomial_boundary_adaptive epsilon he lambda hlambda hn hd P counts j hgood calc _ ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (sqrt ((q (CellFourEquiv.symm i) - (center (CellFourEquiv.symm i) - radius (CellFourEquiv.symm i))) * ((center (CellFourEquiv.symm i) + radius (CellFourEquiv.symm i)) - q (CellFourEquiv.symm i))) / K + radius (CellFourEquiv.symm i) / K ^ 2) := by simpa [m, center, radius, q, K] using hbase _ ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (2 / K + 1 / K ^ 2) * radius (CellFourEquiv.symm i) := by gcongr with i exact hterm i _ = _ := by rw [← Finset.mul_sum] rw [CellFourEquiv.symm.sum_comp] simp [K, radius, m] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_localJacksonPolynomial_boundary_le_radiusSum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:182
theorem scalarClip_sub_le_sq_div Lemma scalarClip_sub_le_sq_div in the paper ↗

Projection onto a symmetric interval differs from its input by at most the input square divided by the positive clipping radius. With the specified inputs and conditions, the stated relationship holds.

Formal statement
t x :
ℝ
ht :
0 < t
|scalarClip t x - x| ≤ x ^ 2 / t
Proof (Lean source)
-- @node: scalarClip_sub_le_sq_div lemma scalarClip_sub_le_sq_div (t x : ℝ) (ht : 0 < t) : |Causalean.Stat.Concentration.BoundedVariation.scalarClip t x - x| ≤ x ^ 2 / t := by unfold Causalean.Stat.Concentration.BoundedVariation.scalarClip by_cases hxlow : x < -t · rw [max_eq_left (le_of_lt hxlow), min_eq_right (by linarith), abs_of_nonneg (by linarith)] have hs := sq_nonneg (x + t) apply (le_div_iff₀ ht).2 nlinarith · have hxlow' : -t ≤ x := le_of_not_gt hxlow rw [max_eq_right hxlow'] by_cases hxhigh : x ≤ t · rw [min_eq_right hxhigh, sub_self, abs_zero] positivity · have hxhigh' : t < x := lt_of_not_ge hxhigh rw [min_eq_left (le_of_lt hxhigh'), abs_of_nonpos (by linarith)] have hs := sq_nonneg (x - t) apply (le_div_iff₀ ht).2 nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.scalarClip_sub_le_sq_div · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:269
theorem poisson_factorialLift_integrable_run Lemma poisson_factorialLift_integrable_run in the paper ↗

A centered normalized factorial lift has a finite first absolute moment under every Poisson law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
rate :
m z :
ℝ
h :
ℕ
Integrable (fun N : ℕ => factorialLift m z N h) (poissonMeasure rate)
Proof (Lean source)
-- @node: poisson_factorialLift_integrable_run lemma poisson_factorialLift_integrable_run (rate : NNReal) (m z : ℝ) (h : ℕ) : Integrable (fun N : ℕ => factorialLift m z N h) (poissonMeasure rate) := by unfold factorialLift apply integrable_finsetSum intro t ht simpa only [div_eq_mul_inv, mul_assoc, mul_comm, mul_left_comm] using (poisson_descFactorial_integrable rate t).const_mul ((h.choose t : ℝ) * (-z) ^ (h - t) * (m ^ t)⁻¹)
CausalSmith.Stat.DiscreteBudgetvalueCurve.poisson_factorialLift_integrable_run · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:295
theorem factorialProduct_integrable_run Lemma factorialProduct_integrable_run in the paper ↗

A finite product of centered factorial lifts is integrable under independent Poisson coordinates. With the specified inputs and conditions, the stated relationship holds.

Formal statement
ι Ω :
W :
ι → Ω → ℕ
rate :
ι → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
m :
ℝ
z :
ι → ℝ
h :
ι → ℕ
Proof (Lean source)
-- @node: factorialProduct_integrable_run lemma factorialProduct_integrable_run {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : ι → Ω → ℕ) (rate : ι → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m : ℝ) (z : ι → ℝ) (h : ι → ℕ) : Integrable (factorialProduct W m z h) μ := by let X : Ω → (ι → ℕ) := fun omega i => W i omega let F : (ι → ℕ) → ℝ := fun x => ∏ i, factorialLift m (z i) (x i) (h i) have hF : Integrable F (Measure.pi fun i => poissonMeasure (rate i)) := by exact Integrable.fintype_prod fun i => poisson_factorialLift_integrable_run (rate i) m (z i) (h i) have hXmeas : AEMeasurable X μ := by exact aemeasurable_pi_lambda _ fun i => (hWlaw i).aemeasurable have hmap : Measure.map X μ = Measure.pi (fun i => poissonMeasure (rate i)) := by calc Measure.map X μ = Measure.pi (fun i => Measure.map (W i) μ) := by exact hWindep.map_fun_eq_pi_map (fun i => (hWlaw i).aemeasurable) _ = Measure.pi (fun i => poissonMeasure (rate i)) := by congr 1 funext i exact (hWlaw i).map_eq have hFmeas : AEStronglyMeasurable F (Measure.map X μ) := by rw [hmap] exact hF.1 have hcomp := (integrable_map_measure hFmeas hXmeas).1 (by simpa [hmap] using hF) change Integrable (fun omega => ∏ i, factorialLift m (z i) (W i omega) (h i)) μ dsimp only [F, X, Function.comp_apply] at hcomp exact hcomp
CausalSmith.Stat.DiscreteBudgetvalueCurve.factorialProduct_integrable_run · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:307
theorem poisson_descFactorial_mul_integrable_run Lemma poisson_descFactorial_mul_integrable_run in the paper ↗

A product of two falling factorials has a finite Poisson first moment. With the specified inputs and conditions, the stated relationship holds.

Formal statement
rate :
h t :
ℕ
Integrable (fun N : ℕ => (N.descFactorial h : ℝ) * N.descFactorial t) (poissonMeasure rate)
Proof (Lean source)
-- @node: poisson_descFactorial_mul_integrable_run lemma poisson_descFactorial_mul_integrable_run (rate : NNReal) (h t : ℕ) : Integrable (fun N : ℕ => (N.descFactorial h : ℝ) * N.descFactorial t) (poissonMeasure rate) := by rw [show (fun N : ℕ => (N.descFactorial h : ℝ) * N.descFactorial t) = fun N => ∑ r ∈ range (min h t + 1), (h.choose r : ℝ) * (t.choose r : ℝ) * (Nat.factorial r : ℝ) * (N.descFactorial (h + t - r) : ℝ) by funext N exact descFactorial_mul N h t] apply integrable_finsetSum intro r hr exact (poisson_descFactorial_integrable rate (h + t - r)).const_mul _
CausalSmith.Stat.DiscreteBudgetvalueCurve.poisson_descFactorial_mul_integrable_run · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:339
theorem integrable_finsetSum_sq_of_mul Lemma integrable_finsetSum_sq_of_mul in the paper ↗

A finite sum is square integrable when every pair of summands has an integrable product. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω ι :
mu :
s :
f :
ι → Ω → ℝ
h :
∀ i ∈ s, ∀ j ∈ s, Integrable (fun omega => f i omega * f j omega) mu
Integrable (fun omega => (∑ i ∈ s, f i omega) ^ 2) mu
Proof (Lean source)
-- @node: integrable_finsetSum_sq_of_mul lemma integrable_finsetSum_sq_of_mul {Ω ι : Type*} [MeasurableSpace Ω] (mu : Measure Ω) (s : Finset ι) (f : ι → Ω → ℝ) (h : ∀ i ∈ s, ∀ j ∈ s, Integrable (fun omega => f i omega * f j omega) mu) : Integrable (fun omega => (∑ i ∈ s, f i omega) ^ 2) mu := by rw [show (fun omega => (∑ i ∈ s, f i omega) ^ 2) = fun omega => ∑ i ∈ s, ∑ j ∈ s, f i omega * f j omega by funext omega rw [pow_two, Finset.sum_mul] apply Finset.sum_congr rfl intro i hi rw [Finset.mul_sum]] apply integrable_finsetSum intro i hi apply integrable_finsetSum intro j hj exact h i hi j hj
CausalSmith.Stat.DiscreteBudgetvalueCurve.integrable_finsetSum_sq_of_mul · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:354
theorem poisson_factorialLift_sq_integrable_run Lemma poisson_factorialLift_sq_integrable_run in the paper ↗

The square of a centered normalized factorial lift is Poisson integrable. With the specified inputs and conditions, the stated relationship holds.

Formal statement
rate :
m z :
ℝ
h :
ℕ
Integrable (fun N : ℕ => factorialLift m z N h ^ 2) (poissonMeasure rate)
Proof (Lean source)
-- @node: poisson_factorialLift_sq_integrable_run lemma poisson_factorialLift_sq_integrable_run (rate : NNReal) (m z : ℝ) (h : ℕ) : Integrable (fun N : ℕ => factorialLift m z N h ^ 2) (poissonMeasure rate) := by unfold factorialLift apply integrable_finsetSum_sq_of_mul (poissonMeasure rate) (range (h + 1)) intro t ht s hs have hprod := poisson_descFactorial_mul_integrable_run rate t s convert hprod.const_mul (((h.choose t : ℝ) * (-z) ^ (h - t) / m ^ t) * ((h.choose s : ℝ) * (-z) ^ (h - s) / m ^ s)) using 1 funext N ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.poisson_factorialLift_sq_integrable_run · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:374
theorem factorialProduct_sq_integrable_run Lemma factorialProduct_sq_integrable_run in the paper ↗

A finite product of centered factorial lifts has an integrable square under independent Poisson coordinates. With the specified inputs and conditions, the stated relationship holds.

Formal statement
ι Ω :
W :
ι → Ω → ℕ
rate :
ι → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
m :
ℝ
z :
ι → ℝ
h :
ι → ℕ
Integrable (fun omega => factorialProduct W m z h omega ^ 2) μ
Proof (Lean source)
-- @node: factorialProduct_sq_integrable_run lemma factorialProduct_sq_integrable_run {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (W : ι → Ω → ℕ) (rate : ι → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) (m : ℝ) (z : ι → ℝ) (h : ι → ℕ) : Integrable (fun omega => factorialProduct W m z h omega ^ 2) μ := by let X : Ω → (ι → ℕ) := fun omega i => W i omega let F : (ι → ℕ) → ℝ := fun x => ∏ i, factorialLift m (z i) (x i) (h i) ^ 2 have hF : Integrable F (Measure.pi fun i => poissonMeasure (rate i)) := by exact Integrable.fintype_prod fun i => poisson_factorialLift_sq_integrable_run (rate i) m (z i) (h i) have hXmeas : AEMeasurable X μ := aemeasurable_pi_lambda _ fun i => (hWlaw i).aemeasurable have hmap : Measure.map X μ = Measure.pi (fun i => poissonMeasure (rate i)) := by calc Measure.map X μ = Measure.pi (fun i => Measure.map (W i) μ) := by exact hWindep.map_fun_eq_pi_map (fun i => (hWlaw i).aemeasurable) _ = Measure.pi (fun i => poissonMeasure (rate i)) := by congr 1 funext i exact (hWlaw i).map_eq have hFmeas : AEStronglyMeasurable F (Measure.map X μ) := by rw [hmap] exact hF.1 have hcomp := (integrable_map_measure hFmeas hXmeas).1 (by simpa [hmap] using hF) dsimp only [F, X, Function.comp_apply] at hcomp have hcomp' : Integrable (fun omega => ∏ i, factorialLift m (z i) (W i omega) (h i) ^ 2) μ := by exact hcomp have heq : (fun omega => factorialProduct W m z h omega ^ 2) = fun omega => ∏ i, factorialLift m (z i) (W i omega) (h i) ^ 2 := by funext omega unfold factorialProduct exact (Finset.prod_pow univ 2 (fun i => factorialLift m (z i) (W i omega) (h i))).symm rw [heq] exact hcomp'
CausalSmith.Stat.DiscreteBudgetvalueCurve.factorialProduct_sq_integrable_run · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:389
theorem jacksonCellRaw_centered_sq_integrable Lemma jacksonCellRaw_centered_sq_integrable in the paper ↗

The unprojected centered Jackson factorial polynomial has an integrable square under independent Poisson evaluation counts. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
epsilon lambda m :
ℝ
d :
ℕ
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
Integrable (fun omega => (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2) μ
Proof (Lean source)
-- @node: jacksonCellRaw_centered_sq_integrable lemma jacksonCellRaw_centered_sq_integrable {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (epsilon lambda m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) : Integrable (fun omega => (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2) μ := by classical let K := jacksonDegree d let D := 2 * (K - 1) let center := pilotMidpoint m d pilot let radius := pilotRadius m d pilot have hmono (a : Fin 4 → Fin (D + 1)) : let M := fun omega => factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ)) Integrable M μ ∧ Integrable (fun omega => M omega ^ 2) μ := by dsimp only have hfirst := (factorialProduct_integrable_run μ W rate hWlaw hWindep m (fun i => center (CellFourEquiv.symm i)) (fun i => (a i : ℕ))).div_const (∏ i, radius (CellFourEquiv.symm i) ^ (a i : ℕ)) have hsecond := (factorialProduct_sq_integrable_run μ W rate hWlaw hWindep m (fun i => center (CellFourEquiv.symm i)) (fun i => (a i : ℕ))).const_mul ((∏ i, radius (CellFourEquiv.symm i) ^ (a i : ℕ)) ^ 2)⁻¹ constructor · rw [show (fun omega => factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ))) = fun omega => factorialProduct W m (fun i => center (CellFourEquiv.symm i)) (fun i => (a i : ℕ)) omega / ∏ i, radius (CellFourEquiv.symm i) ^ (a i : ℕ) by funext omega exact factorialMonomial_eq_fourFactorialMonomial m d pilot W a omega] exact hfirst · convert hsecond using 1 funext omega rw [factorialMonomial_eq_fourFactorialMonomial] simp only [fourFactorialMonomial, div_pow] dsimp only [center, radius] rw [div_eq_mul_inv] ring have hterm (a : Fin 4 → Fin (D + 1)) : MemLp (fun omega => jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ))) 2 μ := by have hm := hmono a apply (memLp_two_iff_integrable_sq (hm.1.const_mul _).1).2 convert hm.2.const_mul (jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) ^ 2) using 1 funext omega ring have hsum : MemLp (fun omega => ∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ))) 2 μ := by simpa only [Finset.sum_attach] using memLp_finsetSum univ (fun a _ => hterm a) have hsquare := (memLp_two_iff_integrable_sq hsum.1).1 hsum simpa [jacksonCellRaw, factorialMonomial, K, D, center, radius] using hsquare
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellRaw_centered_sq_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:431
theorem jacksonCellRaw_centered_sq_integral_le Lemma jacksonCellRaw_centered_sq_integral_le in the paper ↗

On a pilot rectangle containing the true normalized rate, the conditional second moment of the raw Jackson factorial polynomial is controlled by the coefficient BV envelope and the promoted factorial-product envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Omega :
Type*
epsilon :
hepsilon :
0 < epsilon
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
m L :
hm :
0 < m
hL :
0 < L
d :
hd :
1 ≤ d
pilot :
Cell → Nat
W :
Fin 4 → Omega → Nat
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) mu
hWindep :
iIndepFun W mu
hcenter :
∀ i,
|(rate i : Real) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)|
≤ pilotRadius m d pilot (CellFourEquiv.symm i)
hvariance :
∀ i, (rate i : Real) / (m ^ 2 * pilotRadius m d pilot (CellFourEquiv.symm i) ^ 2) ≤ 1 / L
(∫ omega, (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2 ∂mu)
≤ 4 * jacksonCoefficientBV epsilon m d pilot ^ 2 * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : Nat) : Real) ^ 2 / L)
Proof (Lean source)
-- @node: jacksonCellRaw_centered_sq_integral_le lemma jacksonCellRaw_centered_sq_integral_le {Omega : Type*} [MeasurableSpace Omega] (mu : Measure Omega) [IsProbabilityMeasure mu] (epsilon : Real) (hepsilon : 0 < epsilon) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (m L : Real) (hm : 0 < m) (hL : 0 < L) (d : Nat) (hd : 1 ≤ d) (pilot : Cell → Nat) (W : Fin 4 → Omega → Nat) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) mu) (hWindep : iIndepFun W mu) (hcenter : ∀ i, |(rate i : Real) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)| ≤ pilotRadius m d pilot (CellFourEquiv.symm i)) (hvariance : ∀ i, (rate i : Real) / (m ^ 2 * pilotRadius m d pilot (CellFourEquiv.symm i) ^ 2) ≤ 1 / L) : (∫ omega, (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2 ∂mu) ≤ 4 * jacksonCoefficientBV epsilon m d pilot ^ 2 * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : Nat) : Real) ^ 2 / L) := by classical let K := jacksonDegree d let D := 2 * (K - 1) let center := pilotMidpoint m d pilot let radius := pilotRadius m d pilot let hpull := fun t : Time => pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) (d := d) (pilot := pilot) hepsilon hm hd t let c : (Fin 4 → Fin (D + 1)) → Path := fun a => localJacksonCoefficientPath epsilon K center radius (by dsimp [K]; unfold jacksonDegree; omega) hpull (le_refl D) a let X : Omega → (Fin 4 → Fin (D + 1)) → Real := fun omega a => factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : Nat)) have hR (i : Fin 4) : 0 < radius (CellFourEquiv.symm i) := by exact pilotRadius_pos_of_pos hm hd pilot _ have hXint (a : Fin 4 → Fin (D + 1)) : Integrable (fun omega => (X omega a) ^ 2) mu := by have h := (factorialProduct_sq_integrable_run mu W rate hWlaw hWindep m (fun i => center (CellFourEquiv.symm i)) (fun i => (a i : Nat))).const_mul ((∏ i, radius (CellFourEquiv.symm i) ^ (a i : Nat)) ^ 2)⁻¹ convert h using 1 funext omega dsimp only [X] rw [factorialMonomial_eq_fourFactorialMonomial] simp only [fourFactorialMonomial, div_pow] rw [div_eq_mul_inv] ring have hsumXint : Integrable (fun omega => ∑ a : Fin 4 → Fin (D + 1), (X omega a) ^ 2) mu := by apply integrable_finsetSum intro a ha exact hXint a have hrawInt : Integrable (fun omega => (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda center) ^ 2) mu := by simpa [center] using jacksonCellRaw_centered_sq_integrable mu epsilon lambda m d pilot W rate hWlaw hWindep have hcoeffpoint : (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) ^ 2) ≤ ∑ a : Fin 4 → Fin (D + 1), pathSize (c a) ^ 2 := by apply Finset.sum_le_sum intro a ha have heval : |jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat))| ≤ pathSize (c a) := by calc _ = ‖c a ⟨lambda, hlambda⟩‖ := by simp [c, localJacksonCoefficientPath] _ ≤ ‖c a‖ := ContinuousMap.norm_coe_le_norm _ _ _ ≤ pathSize (c a) := by unfold pathSize exact le_add_of_nonneg_right (pathTV_nonneg _) rw [← sq_abs] exact pow_le_pow_left₀ (abs_nonneg _) heval 2 have hcoeffBV : (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) ^ 2) ≤ 4 * jacksonCoefficientBV epsilon m d pilot ^ 2 := by exact hcoeffpoint.trans (by simpa [c, K, D, center, radius, hpull] using localJacksonCoefficientPath_sq_sum_le_jacksonCoefficientBV epsilon m d pilot (by unfold jacksonDegree; omega) hpull) have hpoint (omega : Omega) : (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda center) ^ 2 ≤ (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) ^ 2) * ∑ a : Fin 4 → Fin (D + 1), (X omega a) ^ 2 := by rw [show jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda center = ∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) * X omega a by simp [jacksonCellRaw, factorialMonomial, X, K, D, center, radius]] exact Finset.sum_mul_sq_le_sq_mul_sq Finset.univ _ _ have hfactorInt : Integrable (fun omega => (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) ^ 2) * ∑ a : Fin 4 → Fin (D + 1), (X omega a) ^ 2) mu := hsumXint.const_mul _ calc _ ≤ ∫ omega, (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) ^ 2) * ∑ a : Fin 4 → Fin (D + 1), (X omega a) ^ 2 ∂mu := integral_mono hrawInt hfactorInt hpoint _ = (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : Nat)) ^ 2) * ∑ a : Fin 4 → Fin (D + 1), ∫ omega, (X omega a) ^ 2 ∂mu := by rw [integral_const_mul, integral_finsetSum] exact fun a _ => hXint a _ ≤ (4 * jacksonCoefficientBV epsilon m d pilot ^ 2) * ∑ _a : Fin 4 → Fin (D + 1), exp (4 * (D : Real) ^ 2 / L) := by apply mul_le_mul hcoeffBV · apply Finset.sum_le_sum intro a ha exact factorialMonomial_square_envelope mu m L hm hL d pilot W rate hWlaw hWindep hR hcenter hvariance a · exact Finset.sum_nonneg fun a _ => integral_nonneg fun omega => sq_nonneg _ · positivity _ = _ := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellRaw_centered_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:498
theorem jacksonRaw_factorial_envelope_absorb

The paper's choice of Jackson degree absorbs the factorial index count, coefficient growth, and factorial square moment into d^(1/16). With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
hd :
16 ≤ d
B C S :
hC :
0 ≤ C
hS :
0 ≤ S
hB :
0 ≤ B
hcoeff :
B ≤ C * S * exp (12 * jacksonDegree d)
(4 * B ^ 2) * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : Nat) : Real) ^ 2 / logAlphabet d)
≤ 4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * S ^ 2
Proof (Lean source)
-- @node: jacksonRaw_factorial_envelope_absorb lemma jacksonRaw_factorial_envelope_absorb {d : Nat} (hd : 16 ≤ d) (B C S : Real) (hC : 0 ≤ C) (hS : 0 ≤ S) (hB : 0 ≤ B) (hcoeff : B ≤ C * S * exp (12 * jacksonDegree d)) : (4 * B ^ 2) * ∑ _a : Fin 4 → Fin (2 * (jacksonDegree d - 1) + 1), exp (4 * ((2 * (jacksonDegree d - 1) : Nat) : Real) ^ 2 / logAlphabet d) ≤ 4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * S ^ 2 := by let K := jacksonDegree d let L := logAlphabet d have hL : 0 < L := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hd1 : (1 : Real) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg hd1] have hcoeff' : B ^ 2 ≤ C ^ 2 * S ^ 2 * exp (24 * K) := by have hrhs0 : 0 ≤ C * S * exp (12 * K) := by positivity have hsquare := (sq_le_sq₀ hB hrhs0).mpr (by simpa [K] using hcoeff) calc _ ≤ (C * S * exp (12 * K)) ^ 2 := hsquare _ = C ^ 2 * S ^ 2 * exp (24 * K) := by rw [mul_pow, mul_pow, ← Real.exp_nat_mul] congr 2 ring have hsum : (∑ _a : Fin 4 → Fin (2 * (K - 1) + 1), exp (4 * ((2 * (K - 1) : Nat) : Real) ^ 2 / L)) ≤ ((2 * (K - 1) + 1 : Nat) : Real) ^ 4 * exp (16 * (K : Real) ^ 2 / L) := by rw [Finset.sum_const, nsmul_eq_mul] have hcard : ((card (Fin 4 → Fin (2 * (K - 1) + 1)) : Nat) : Real) = ((2 * (K - 1) + 1 : Nat) : Real) ^ 4 := by rw [Fintype.card_fun] simp rw [Finset.card_univ, hcard] apply mul_le_mul_of_nonneg_left _ (by positivity) apply Real.exp_le_exp.mpr have hsub : ((K - 1 : Nat) : Real) ≤ K := by exact_mod_cast sub_le K 1 have hsq : ((2 * (K - 1) : Nat) : Real) ^ 2 ≤ 4 * (K : Real) ^ 2 := by push_cast nlinarith [sq_nonneg ((K - 1 : Nat) : Real), sq_nonneg (K : Real)] apply (div_le_div_iff_of_pos_right hL).2 nlinarith have habsorb := jacksonDegree_factorial_index_exponential_budget d hd calc _ ≤ (4 * (C ^ 2 * S ^ 2 * exp (24 * K))) * (((2 * (K - 1) + 1 : Nat) : Real) ^ 4 * exp (16 * (K : Real) ^ 2 / L)) := by gcongr _ ≤ 4 * C ^ 2 * S ^ 2 * (exp 123 * (d : Real) ^ (1 / 16 : Real)) := by calc _ = 4 * C ^ 2 * S ^ 2 * (((2 * (K - 1) + 1 : Nat) : Real) ^ 4 * exp (24 * K + 16 * (K : Real) ^ 2 / L)) := by rw [Real.exp_add] ring _ ≤ _ := mul_le_mul_of_nonneg_left (by simpa [K, L] using habsorb) (mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg C)) (sq_nonneg S)) _ = _ := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonRaw_factorial_envelope_absorb · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:635
theorem goodPilot_jacksonCellRaw_centered_sq_integral_le

Equation (23)'s raw conditional second-moment input, for a fixed good pilot table and one evaluation cell. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise, the shadow-price range, the positive envelope constant, and the coefficient envelope.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → Nat
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
C :
hC :
0 ≤ C
hcoeff :
jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j)
≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)
m :
(n : Real) / 8 (: Real)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → Nat) → Nat)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
(∫ e, (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2 ∂mu)
≤ 4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2
Proof (Lean source)
-- @node: goodPilot_jacksonCellRaw_centered_sq_integral_le lemma goodPilot_jacksonCellRaw_centered_sq_integral_le {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → Nat) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (C : Real) (hC : 0 ≤ C) (hcoeff : jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j) ≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)) : let m : Real := (n : Real) / 8 let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) (∫ e, (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2 ∂mu) ≤ 4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2 := by dsimp only let m : Real := (n : Real) / 8 let L := logAlphabet d let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw] infer_instance let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate j i)) mu := by simpa [W, mu, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, i) have hWindep : iIndepFun W mu := by rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] calc Measure.map (fun e i => W i e) mu = poissonTableLaw (rate j) := by simpa [W, mu] using (poissonTable_eval_cell_law rate j).map_eq _ = Measure.infinitePi (fun i => poissonMeasure (rate j i)) := rfl _ = Measure.infinitePi (fun i => Measure.map (W i) mu) := by congr 1 funext i exact (hWlaw i).map_eq.symm have hL : 0 < L := by dsimp [L] rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hd1 : (1 : Real) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg hd1] have hraw := jacksonCellRaw_centered_sq_integral_le mu epsilon he lambda hlambda m L (by dsimp [m]; positivity) hL d (show 1 ≤ d by omega) pilot W (rate j) hWlaw hWindep (fun i => idealPilotGood_flatRate_center_mem_radius hn P (curryCountTable p, fun _ _ => 0) j hgood i) (fun i => idealPilotGood_rate_div_radius_sq hn hd P (curryCountTable p, fun _ _ => 0) j hgood i) let S := ∑ zeta : Cell, pilotRadius m d pilot zeta have hS : 0 ≤ S := Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) pilot z).le exact hraw.trans (by simpa [m, L, rate, mu, pilot, W, S] using jacksonRaw_factorial_envelope_absorb hd (jacksonCoefficientBV epsilon m d pilot) C S hC hS (by unfold jacksonCoefficientBV; positivity) (by simpa [m, pilot, S] using hcoeff))
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_jacksonCellRaw_centered_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:705
theorem jacksonCellStatistic_mean_sub_raw_mean_le Lemma jacksonCellStatistic_mean_sub_raw_mean_le in the paper ↗

Conditional clipping changes the mean of the Jackson factorial polynomial by at most its centered second moment divided by the clipping radius. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
epsilon lambda m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
cap :
(d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta : Cell, pilotRadius m d pilot zeta
|∫ omega, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ
- ∫ omega, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ|
≤ (∫ omega, (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2 ∂μ) / cap
Proof (Lean source)
-- @node: jacksonCellStatistic_mean_sub_raw_mean_le lemma jacksonCellStatistic_mean_sub_raw_mean_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (epsilon lambda m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) : let cap := (d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta : Cell, pilotRadius m d pilot zeta |∫ omega, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ - ∫ omega, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ| ≤ (∫ omega, (jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)) ^ 2 ∂μ) / cap := by dsimp only let center := thresholdFunReal epsilon lambda (pilotMidpoint m d pilot) let Y : Ω → ℝ := fun omega => jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) - center let cap := (d : ℝ) ^ (1 / 4 : ℝ) * ∑ zeta : Cell, pilotRadius m d pilot zeta have hcap : 0 < cap := by have hdpos : (0 : ℝ) < d := by exact_mod_cast (show 0 < d by omega) have hsum : 0 < ∑ zeta : Cell, pilotRadius m d pilot zeta := by exact Finset.sum_pos (fun z _ => pilotRadius_pos_of_pos hm hd pilot z) (by simp) exact mul_pos (Real.rpow_pos_of_pos hdpos _) hsum have hYsq : Integrable (fun omega => Y omega ^ 2) μ := by simpa [Y, center] using jacksonCellRaw_centered_sq_integrable μ epsilon lambda m d pilot W rate hWlaw hWindep let X : Ω → (Fin 4 → ℕ) := fun omega i => W i omega have hX : AEMeasurable X μ := aemeasurable_pi_lambda _ fun i => (hWlaw i).aemeasurable have hYmeas : AEStronglyMeasurable Y μ := by have hg : Measurable (fun x : Fin 4 → ℕ => jacksonCellRaw epsilon lambda m d pilot (fun zeta => x (CellFourEquiv zeta)) - center) := Measurable.of_discrete exact hg.comp_aemeasurable hX |>.aestronglyMeasurable have hYint : Integrable Y μ := by apply Integrable.mono' (hYsq.add (integrable_const 1)) hYmeas filter_upwards with omega change |Y omega| ≤ Y omega ^ 2 + 1 nlinarith [sq_nonneg (|Y omega| - 1 / 2), sq_abs (Y omega)] let Z : Ω → ℝ := fun omega => scalarClip cap (Y omega) - Y omega have hclipMeas : AEStronglyMeasurable (fun omega => scalarClip cap (Y omega)) μ := by exact (AEMeasurable.min aemeasurable_const (AEMeasurable.max aemeasurable_const hYmeas.aemeasurable)).aestronglyMeasurable have hclipInt : Integrable (fun omega => scalarClip cap (Y omega)) μ := by apply Integrable.mono' (integrable_const cap) hclipMeas filter_upwards with omega unfold scalarClip simp only [Real.norm_eq_abs] exact abs_le.2 ⟨le_min (by linarith) (le_max_left _ _), min_le_left _ _⟩ have hZint : Integrable Z μ := hclipInt.sub hYint have hboundInt : Integrable (fun omega => Y omega ^ 2 / cap) μ := hYsq.div_const cap have hpoint (omega : Ω) : |Z omega| ≤ Y omega ^ 2 / cap := scalarClip_sub_le_sq_div cap (Y omega) hcap have hidentity : (∫ omega, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ) - ∫ omega, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ = ∫ omega, Z omega ∂μ := by rw [← integral_sub] · apply integral_congr_ae filter_upwards with omega dsimp only [Z, Y, center, cap] unfold jacksonCellStatistic dsimp only unfold scalarClip ring · apply ((integrable_const center).add hclipInt).congr exact Filter.Eventually.of_forall fun omega => by dsimp only [Y, center, cap] unfold jacksonCellStatistic rfl · apply (hYint.add (integrable_const center)).congr exact Filter.Eventually.of_forall fun omega => by change Y omega + center = _ dsimp only [Y, center] ring rw [hidentity] calc |∫ omega, Z omega ∂μ| ≤ ∫ omega, |Z omega| ∂μ := abs_integral_le_integral_abs _ ≤ ∫ omega, Y omega ^ 2 / cap ∂μ := by apply integral_mono hZint.abs hboundInt exact hpoint _ = _ := by rw [integral_div]
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellStatistic_mean_sub_raw_mean_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:780
theorem goodPilot_jacksonCellStatistic_mean_sub_raw_mean_le

On a fixed good pilot table, clipping changes the conditional cell mean by the raw second-moment envelope divided by the paper's clipping scale. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise, the shadow-price range, the positive envelope constant, and the coefficient envelope.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → Nat
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
C :
hC :
0 ≤ C
hcoeff :
jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j)
≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)
m :
(n : Real) / 8 (: Real)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → Nat) → Nat)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
|(∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu)
- ∫ e, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu|
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta)
Proof (Lean source)
-- @node: goodPilot_jacksonCellStatistic_mean_sub_raw_mean_le lemma goodPilot_jacksonCellStatistic_mean_sub_raw_mean_le {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → Nat) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (C : Real) (hC : 0 ≤ C) (hcoeff : jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j) ≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)) : let m : Real := (n : Real) / 8 let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) |(∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - ∫ e, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta) := by dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw] infer_instance let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate j i)) mu := by simpa [W, mu, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, i) have hWindep : iIndepFun W mu := by rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] calc Measure.map (fun e i => W i e) mu = poissonTableLaw (rate j) := by simpa [W, mu] using (poissonTable_eval_cell_law rate j).map_eq _ = Measure.infinitePi (fun i => poissonMeasure (rate j i)) := rfl _ = Measure.infinitePi (fun i => Measure.map (W i) mu) := by congr 1 funext i exact (hWlaw i).map_eq.symm have hclip := jacksonCellStatistic_mean_sub_raw_mean_le mu epsilon lambda m (by dsimp [m]; positivity) d (show 1 ≤ d by omega) pilot W (rate j) hWlaw hWindep have hraw := goodPilot_jacksonCellRaw_centered_sq_integral_le epsilon he hn hd P p j hgood lambda hlambda C hC hcoeff have hcap : 0 ≤ (d : Real) ^ (1 / 4 : Real) * ∑ zeta : Cell, pilotRadius m d pilot zeta := by apply mul_nonneg (Real.rpow_nonneg (by positivity) _) exact Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) pilot z).le exact hclip.trans (by apply div_le_div_of_nonneg_right _ hcap simpa [m, rate, mu, pilot, W] using hraw)
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_jacksonCellStatistic_mean_sub_raw_mean_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:879

Independent Poisson evaluation counts make the unprojected paper factorial polynomial exactly unbiased for the canonical Jackson polynomial. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Ω :
epsilon :
ℝ
he :
0 < epsilon
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
m :
ℝ
hm :
0 < m
d :
ℕ
hd :
1 ≤ d
pilot :
Cell → ℕ
W :
Fin 4 → Ω → ℕ
rate :
Fin 4 → NNReal
hWlaw :
∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ
hWindep :
iIndepFun W μ
(∫ omega, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ)
= thresholdFunReal epsilon lambda (pilotMidpoint m d pilot)
+ eval (fun i => ((rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)) / pilotRadius m d pilot (CellFourEquiv.symm i)) (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot))
Proof (Lean source)
-- @node: jacksonCellRaw_mean lemma jacksonCellRaw_mean {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (epsilon : ℝ) (he : 0 < epsilon) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) (m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (W : Fin 4 → Ω → ℕ) (rate : Fin 4 → NNReal) (hWlaw : ∀ i, HasLaw (W i) (poissonMeasure (rate i)) μ) (hWindep : iIndepFun W μ) : (∫ omega, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) omega) ∂μ) = thresholdFunReal epsilon lambda (pilotMidpoint m d pilot) + eval (fun i => ((rate i : ℝ) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)) / pilotRadius m d pilot (CellFourEquiv.symm i)) (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot)) := by classical let K := jacksonDegree d let D := 2 * (K - 1) let center := pilotMidpoint m d pilot let radius := pilotRadius m d pilot let p := localJacksonPolynomial epsilon lambda K center radius let x : Fin 4 → ℝ := fun i => ((rate i : ℝ) / m - center (CellFourEquiv.symm i)) / radius (CellFourEquiv.symm i) have hK : 0 < K := by dsimp [K]; unfold jacksonDegree; omega have hpull : ContinuousOn (fun z : Fin 4 → ℝ => thresholdFunReal epsilon lambda (fun c => affinePoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) z (CellFourEquiv c))) (normalizedCube 4) := by exact pilotRectangle_threshold_pullback_continuousOn (epsilon := epsilon) (m := m) (d := d) (pilot := pilot) he hm hd ⟨lambda, hlambda⟩ have hdeg : ∀ i, p.degreeOf i ≤ D := fun i => localJacksonPolynomial_degreeOf_le epsilon lambda K center radius hK hpull i have hmono (a : Fin 4 → Fin (D + 1)) : Integrable (fun omega => factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ))) μ := by rw [show (fun omega => factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ))) = fun omega => factorialProduct W m (fun i => center (CellFourEquiv.symm i)) (fun i => (a i : ℕ)) omega / ∏ i, radius (CellFourEquiv.symm i) ^ (a i : ℕ) by funext omega exact factorialMonomial_eq_fourFactorialMonomial m d pilot W a omega] exact (factorialProduct_integrable_run μ W rate hWlaw hWindep m (fun i => center (CellFourEquiv.symm i)) (fun i => (a i : ℕ))).div_const _ have hsumInt : Integrable (fun omega => ∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ))) μ := by apply integrable_finsetSum intro a ha exact (hmono a).const_mul _ have hmean (a : Fin 4 → Fin (D + 1)) : (∫ omega, factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ)) ∂μ) = ∏ i, x i ^ (a i : ℕ) := by rw [factorialMonomial_mean μ m (ne_of_gt hm) d pilot W rate hWlaw hWindep a] rw [← Finset.prod_div_distrib] apply Finset.prod_congr rfl intro i hi rw [div_pow] have heval : (∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * ∏ i, x i ^ (a i : ℕ)) = eval x p := by rw [← tensorPolynomial_tensorCoeffs p hdeg] unfold tensorPolynomial rw [map_sum] apply Finset.sum_congr rfl intro a ha rw [MvPolynomial.eval_monomial, jacksonCoefficient_eq_tensorCoeffs] congr 1 rw [Finsupp.prod_fintype _ _ (by simp)] simp [tensorExponent] change (∫ omega, thresholdFunReal epsilon lambda center + ∑ a : Fin 4 → Fin (D + 1), jacksonCoefficient epsilon lambda K center radius (fun i => (a i : ℕ)) * factorialMonomial m d pilot (fun zeta => W (CellFourEquiv zeta) omega) (fun i => (a i : ℕ)) ∂μ) = _ rw [integral_add (integrable_const _) hsumInt, integral_const] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] rw [integral_finsetSum] · simp_rw [integral_const_mul, hmean] simpa [K, D, center, radius, p, x] using heval · intro a ha exact (hmono a).const_mul _
CausalSmith.Stat.DiscreteBudgetvalueCurve.jacksonCellRaw_mean · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:947
theorem goodPilot_jacksonCellStatistic_conditional_bias_le

Conditional on a fixed good pilot table, the cell mean bias is the sum of the clipping correction and the boundary-adaptive Jackson remainder. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise, the shadow-price range, the positive envelope constant, and the coefficient envelope.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → Nat
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
C :
hC :
0 ≤ C
hcoeff :
jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j)
≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)
m :
(n : Real) / 8 (: Real)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → Nat) → Nat)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
|(∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu)
- thresholdFunReal epsilon lambda (cellVector P j)|
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta)
+ 32 * (3 * (1 + epsilon⁻¹) + 1) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2) * ∑ zeta, pilotRadius m d pilot zeta
Proof (Lean source)
-- @node: goodPilot_jacksonCellStatistic_conditional_bias_le lemma goodPilot_jacksonCellStatistic_conditional_bias_le {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → Nat) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (C : Real) (hC : 0 ≤ C) (hcoeff : jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j) ≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)) : let m : Real := (n : Real) / 8 let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) |(∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta) + 32 * (3 * (1 + epsilon⁻¹) + 1) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2) * ∑ zeta, pilotRadius m d pilot zeta := by dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw] infer_instance let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate j i)) mu := by simpa [W, mu, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, i) have hWindep : iIndepFun W mu := by rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] calc Measure.map (fun e i => W i e) mu = poissonTableLaw (rate j) := by simpa [W, mu] using (poissonTable_eval_cell_law rate j).map_eq _ = Measure.infinitePi (fun i => poissonMeasure (rate j i)) := rfl _ = Measure.infinitePi (fun i => Measure.map (W i) mu) := by congr 1 funext i exact (hWlaw i).map_eq.symm have hclip := goodPilot_jacksonCellStatistic_mean_sub_raw_mean_le epsilon he hn hd P p j hgood lambda hlambda C hC hcoeff have hmean := jacksonCellRaw_mean mu epsilon he lambda hlambda m (by dsimp [m]; positivity) d (show 1 ≤ d by omega) pilot W (rate j) hWlaw hWindep have hrate (i : Fin 4) : (rate j i : Real) / m = cellVector P j (CellFourEquiv.symm i) := by have hq : 0 ≤ cellVector P j (CellFourEquiv.symm i) := ENNReal.toReal_nonneg dsimp [rate, idealFlatRate, m] rw [max_eq_left (mul_nonneg (by positivity) hq)] field_simp have hmean' : (∫ e, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu) = thresholdFunReal epsilon lambda (pilotMidpoint m d pilot) + eval (normalizedPoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) (fun i => cellVector P j (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot)) := by rw [hmean] congr 2 rw [show (fun i => ((rate j i : Real) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)) / pilotRadius m d pilot (CellFourEquiv.symm i)) = normalizedPoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) (fun i => cellVector P j (CellFourEquiv.symm i)) by funext i simp only [normalizedPoint, hrate]] have hboundary := goodPilot_localJacksonPolynomial_boundary_le_radiusSum epsilon he lambda hlambda hn (show 1 ≤ d by omega) P (curryCountTable p, fun _ _ => 0) j hgood let A : Real := ∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu let R : Real := ∫ e, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu let T : Real := thresholdFunReal epsilon lambda (cellVector P j) change |A - T| ≤ _ have hclip' : |A - R| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta) := by simpa [A, R, m, rate, mu, pilot, W] using hclip have hboundary' : |R - T| ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2) * ∑ zeta, pilotRadius m d pilot zeta := by dsimp [R, T] rw [hmean'] simpa [m, pilot] using hboundary calc |A - T| = |(A - R) + (R - T)| := by congr 1 ring _ ≤ |A - R| + |R - T| := abs_add_le _ _ _ ≤ _ := add_le_add hclip' hboundary'
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_jacksonCellStatistic_conditional_bias_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBias.lean:1044
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.ScalarBiasOuter 15 declarations Outer pilot expectation bounds for the scalar Jackson cell bias.

Outer pilot expectation bounds for the scalar Jackson cell bias.

theorem idealCountLaw_isProbabilityMeasure Lemma idealCountLaw_isProbabilityMeasure in the paper ↗

The ideal two-pool count law is a probability measure. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
P :
Proof (Lean source)
-- @node: idealCountLaw_isProbabilityMeasure lemma idealCountLaw_isProbabilityMeasure {n d : Nat} (P : DiscreteLaw d) : IsProbabilityMeasure (idealCountLaw (n := n) P) := by unfold idealCountLaw let onePool : Measure (Fin d → Cell → Nat) := Measure.pi (fun j : Fin d => Measure.pi (fun zeta : Cell => poissonMeasure ⟨max 0 (((n : Real) / 8) * cellVector P j zeta), le_max_left 0 _⟩)) letI : ∀ j : Fin d, ∀ zeta : Cell, IsProbabilityMeasure (poissonMeasure ⟨max 0 (((n : Real) / 8) * cellVector P j zeta), le_max_left 0 _⟩) := fun j zeta => instIsProbabilityMeasureNatPoissonMeasure ⟨max 0 (((n : Real) / 8) * cellVector P j zeta), le_max_left 0 _⟩ letI : ∀ j : Fin d, IsProbabilityMeasure (Measure.pi (fun zeta : Cell => poissonMeasure ⟨max 0 (((n : Real) / 8) * cellVector P j zeta), le_max_left 0 _⟩)) := fun _ => by infer_instance letI : IsProbabilityMeasure onePool := by dsimp [onePool]; infer_instance change IsProbabilityMeasure (onePool.prod onePool) infer_instance
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealCountLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:14
theorem integral_sq_le_integral_sq_of_nonneg Lemma integral_sq_le_integral_sq_of_nonneg in the paper ↗

On a probability space, the square of the mean of a nonnegative square-integrable scalar is at most its second moment. With the specified inputs and conditions, the stated relationship holds.

Formal statement
Omega :
Type*
f :
Omega → Real
hfsq :
Integrable (fun omega => f omega ^ 2) mu
(∫ omega, f omega ∂mu) ^ 2 ≤ ∫ omega, f omega ^ 2 ∂mu
Proof (Lean source)
-- @node: integral_sq_le_integral_sq_of_nonneg lemma integral_sq_le_integral_sq_of_nonneg {Omega : Type*} [MeasurableSpace Omega] (mu : Measure Omega) [IsProbabilityMeasure mu] (f : Omega → Real) (hf : AEStronglyMeasurable f mu) (hfsq : Integrable (fun omega => f omega ^ 2) mu) : (∫ omega, f omega ∂mu) ^ 2 ≤ ∫ omega, f omega ^ 2 ∂mu := by have hmem : MemLp f 2 mu := (memLp_two_iff_integrable_sq hf).2 hfsq have hfint : Integrable f mu := hmem.integrable (by norm_num) have hcenter : Integrable (fun omega => (f omega - ∫ x, f x ∂mu) ^ 2) mu := by simp_rw [sub_sq] exact (hfsq.sub ((hfint.const_mul _).mul_const _)).add (integrable_const _) have hnonneg : 0 ≤ ∫ omega, (f omega - ∫ x, f x ∂mu) ^ 2 ∂mu := integral_nonneg fun omega => sq_nonneg _ rw [show (∫ omega, (f omega - ∫ x, f x ∂mu) ^ 2 ∂mu) = (∫ omega, f omega ^ 2 ∂mu) - (∫ omega, f omega ∂mu) ^ 2 by rw [show (fun omega => (f omega - ∫ x, f x ∂mu) ^ 2) = fun omega => f omega ^ 2 - (2 * (∫ x, f x ∂mu)) * f omega + (∫ x, f x ∂mu) ^ 2 by funext omega ring] rw [integral_add, integral_sub, integral_const_mul, integral_const] · simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] ring · exact hfsq · exact hfint.const_mul _ · exact (hfsq.sub (hfint.const_mul _)) · exact integrable_const _] at hnonneg linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.integral_sq_le_integral_sq_of_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:34
theorem pilotRadius_sum_integral_sq_le_cellScale

The first moment of the sum of the four pilot radii is controlled by the square root of the equation-(21) cell scale. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
m :
(n : Real) / 8 (: Real)
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → NNReal)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
(∫ p, ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta ∂mu) ^ 2
≤ 32 * pilotRadiusConstant ^ 2 * badPilotCellScale (n := n) P j ^ 2
Proof (Lean source)
-- @node: pilotRadius_sum_integral_sq_le_cellScale lemma pilotRadius_sum_integral_sq_le_cellScale {n d : Nat} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (∫ p, ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta ∂mu) ^ 2 ≤ 32 * pilotRadiusConstant ^ 2 * badPilotCellScale (n := n) P j ^ 2 := by dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw] infer_instance let S : ((Fin d × Fin 4) → Nat) → Real := fun p => ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta have hsecond := pilotRadius_sum_sq_integral_le_cellScale hn hd P j have hmeas : AEStronglyMeasurable S mu := (measurable_of_countable _).aestronglyMeasurable calc _ ≤ ∫ p, S p ^ 2 ∂mu := integral_sq_le_integral_sq_of_nonneg mu S hmeas (by simpa [S, m, rate, mu] using hsecond.1) _ ≤ _ := by simpa [S, m, rate, mu] using hsecond.2
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadius_sum_integral_sq_le_cellScale · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:68
theorem pilotRadius_sum_integral_le_cellScale

Linear first-moment form of the pilot-radius estimate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
m :
(n : Real) / 8 (: Real)
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → NNReal)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
(∫ p, ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta ∂mu)
Proof (Lean source)
-- @node: pilotRadius_sum_integral_le_cellScale lemma pilotRadius_sum_integral_le_cellScale {n d : Nat} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (∫ p, ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta ∂mu) ≤ sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j := by dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let I : Real := ∫ p, ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta ∂mu let R : Real := sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j have hsq := pilotRadius_sum_integral_sq_le_cellScale hn hd P j have hI : 0 ≤ I := integral_nonneg fun p => Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) (curryCountTable p j) z).le have hscale : 0 ≤ badPilotCellScale (n := n) P j := by unfold badPilotCellScale have hL : 0 < logAlphabet d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have hdR : (1 : Real) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) linarith [Real.log_nonneg hdR] positivity have hR : 0 ≤ R := by dsimp [R] exact mul_nonneg (mul_nonneg (Real.sqrt_nonneg _) (by unfold pilotRadiusConstant; norm_num)) hscale have hR2 : R ^ 2 = 32 * pilotRadiusConstant ^ 2 * badPilotCellScale (n := n) P j ^ 2 := by dsimp [R] rw [mul_pow, mul_pow, Real.sq_sqrt (by norm_num : (0 : Real) ≤ 32)] apply (sq_le_sq₀ hI hR).mp rw [hR2] simpa [I, m, rate, mu] using hsq
CausalSmith.Stat.DiscreteBudgetvalueCurve.pilotRadius_sum_integral_le_cellScale · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:98
theorem flatGoodPilot_conditionalBias_integral_le

Integrating the conditional good-pilot scalar bias costs one first moment of the sum of the four pilot radii. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
∃ C : Real,
0 < C
conclusion 1
m :
(n : Real) / 8 (: Real)
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → NNReal)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → Nat) → Nat)
(∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu)
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + (32 * (3 * (1 + epsilon⁻¹) + 1)) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) * (sqrt 32 * pilotRadiusConstant) * badPilotCellScale (n := n) P j
Proof (Lean source)
-- @node: flatGoodPilot_conditionalBias_integral_le lemma flatGoodPilot_conditionalBias_integral_le {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : ∃ C : Real, 0 < C ∧ let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i (∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu) ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + (32 * (3 * (1 + epsilon⁻¹) + 1)) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) * (sqrt 32 * pilotRadiusConstant) * badPilotCellScale (n := n) P j := by classical obtain ⟨C0, hC0, hcoeff⟩ := jacksonCoefficientBV_pilot_le epsilon he he' let A : Real := 32 * (3 * (1 + epsilon⁻¹) + 1) let B : Real := 4 * C0 ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + A * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2) have hA : 0 ≤ A := by dsimp [A]; positivity have hB : 0 < B := by dsimp [B]; positivity refine ⟨C0, hC0, ?_⟩ dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw] infer_instance let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let S : ((Fin d × Fin 4) → Nat) → Real := fun p => ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta let H : ((Fin d × Fin 4) → Nat) → Real := fun p => if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 have hSpos (p : (Fin d × Fin 4) → Nat) : 0 < S p := Finset.sum_pos (fun z _ => pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) (curryCountTable p j) z) (by simp) have hpoint (p : (Fin d × Fin 4) → Nat) : H p ≤ B * S p := by by_cases hg : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j · have hc := goodPilot_jacksonCellStatistic_conditional_bias_le epsilon he hn hd P p j hg lambda hlambda C0 hC0.le (hcoeff m (by dsimp [m]; positivity) d (show 1 ≤ d by omega) (curryCountTable p j)) have hgb := (idealPilotGoodBool_eq_true P (curryCountTable p, fun _ _ => 0) j).2 hg rw [show H p = |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| by simp [H, hgb]] apply hc.trans_eq have hSne : S p ≠ 0 := (hSpos p).ne' dsimp [B, A, S, m, rate, mu, W] field_simp · have hgb : idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P (curryCountTable p, fun _ _ => 0) j).1 ht) rw [show H p = 0 by simp [H, hgb]] exact mul_nonneg hB.le (hSpos p).le have hSint : Integrable S mu := by have hsecond := pilotRadius_sum_sq_integral_le_cellScale hn hd P j have hmeas : AEStronglyMeasurable S mu := (measurable_of_countable _).aestronglyMeasurable exact ((memLp_two_iff_integrable_sq hmeas).2 (by simpa [S, m, rate, mu] using hsecond.1)).integrable (by norm_num) have hHint : Integrable H mu := by apply Integrable.mono' (hSint.const_mul B) (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with p rw [Real.norm_eq_abs, abs_of_nonneg (by dsimp [H] split <;> positivity)] exact hpoint p calc _ = ∫ p, H p ∂mu := by rfl _ ≤ ∫ p, B * S p ∂mu := integral_mono hHint (hSint.const_mul B) hpoint _ = B * ∫ p, S p ∂mu := by rw [integral_const_mul] _ ≤ B * (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) := by apply mul_le_mul_of_nonneg_left _ hB.le simpa [S, m, rate, mu] using pilotRadius_sum_integral_le_cellScale hn hd P j _ = _ := by dsimp [B, A]; ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.flatGoodPilot_conditionalBias_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:144
theorem idealClippedCell_error_integrable Lemma idealClippedCell_error_integrable in the paper ↗

At a fixed shadow price, the ideal clipped cell error is integrable. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
Integrable (fun counts => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)) (idealCountLaw (n := n) P)
Proof (Lean source)
-- @node: idealClippedCell_error_integrable lemma idealClippedCell_error_integrable {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : Integrable (fun counts => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)) (idealCountLaw (n := n) P) := by letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P let E := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) let U := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => sSup ((fun t : Real => |idealClippedCellPath (n := n) epsilon t counts j - thresholdFunReal epsilon t (cellVector P j)|) '' Icc 0 1) have hU2 := idealClippedCell_error_sSup_sq_integrable epsilon he hn hd P j have hU2' : Integrable (fun counts => U counts ^ 2) (idealCountLaw (n := n) P) := by simpa [U] using hU2 have hEmeas : AEStronglyMeasurable E (idealCountLaw (n := n) P) := (measurable_of_countable _).aestronglyMeasurable have hE2 : Integrable (fun counts => E counts ^ 2) (idealCountLaw (n := n) P) := by apply Integrable.mono' hU2' (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with counts have hEU : |E counts| ≤ U counts := by dsimp [U, E] apply le_csSup · exact ⟨_, fun y hy => by rcases hy with ⟨t, ht, rfl⟩ exact idealClippedCell_error_le_badScore he hn hd P counts j t ht⟩ · exact ⟨lambda, hlambda, rfl⟩ rw [← sq_abs] rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg |E counts|)] exact pow_le_pow_left₀ (abs_nonneg _) hEU 2 exact ((memLp_two_iff_integrable_sq hEmeas).2 hE2).integrable (by norm_num)
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealClippedCell_error_integrable · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:244
theorem expectedUncappedJacksonCell_eq_flat_iterated

The paper's ideal cell expectation is the iterated flattened pilot and evaluation Poisson expectation. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → NNReal)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
expectedUncappedJacksonCell (n := n) epsilon lambda P j
= ∫ p, ∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j) ∂mu ∂mu
Proof (Lean source)
-- @node: expectedUncappedJacksonCell_eq_flat_iterated lemma expectedUncappedJacksonCell_eq_flat_iterated {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) expectedUncappedJacksonCell (n := n) epsilon lambda P j = ∫ p, ∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j) ∂mu ∂mu := by dsimp only let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance let F := fun pe : (((Fin d × Fin 4) → Nat) × ((Fin d × Fin 4) → Nat)) => (curryCountTable pe.1, curryCountTable pe.2) let g := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (counts.1 j) (counts.2 j) letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P have herr := idealClippedCell_error_integrable epsilon he hn hd P j lambda hlambda have hg : Integrable g (idealCountLaw (n := n) P) := by apply (herr.add (integrable_const (thresholdFunReal epsilon lambda (cellVector P j)))).congr filter_upwards [] with counts dsimp [g] unfold idealClippedCellPath ring have hmap : Measure.map F (mu.prod mu) = idealCountLaw (n := n) P := by simpa [F, mu, rate] using map_flatIdealCountLaw (n := n) P have hflat : Integrable (g ∘ F) (mu.prod mu) := by have : Integrable g (Measure.map F (mu.prod mu)) := by simpa [hmap] using hg exact this.comp_aemeasurable (by fun_prop) unfold expectedUncappedJacksonCell calc _ = ∫ pe, g (F pe) ∂mu.prod mu := by rw [← hmap, integral_map (by fun_prop) (measurable_of_countable _).aestronglyMeasurable] _ = ∫ p, ∫ e, g (F (p, e)) ∂mu ∂mu := integral_prod _ hflat _ = _ := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.expectedUncappedJacksonCell_eq_flat_iterated · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:284
theorem idealBadPilot_scalarMean_le_envelope

The absolute bad-pilot contribution to a fixed scalar cell mean is bounded by the existing equation-(28) cell envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
|∫ counts, (if idealPilotGoodBool (n := n) P counts j then 0 else idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)) ∂idealCountLaw (n := n) P|
≤ badPilotCellEnvelope (n := n) epsilon P j
Proof (Lean source)
-- @node: idealBadPilot_scalarMean_le_envelope lemma idealBadPilot_scalarMean_le_envelope {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : |∫ counts, (if idealPilotGoodBool (n := n) P counts j then 0 else idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j)) ∂idealCountLaw (n := n) P| ≤ badPilotCellEnvelope (n := n) epsilon P j := by classical letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P let E := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) let B := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then 0 else E counts let G := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then 0 else sSup ((fun t : Real => |idealClippedCellPath (n := n) epsilon t counts j - thresholdFunReal epsilon t (cellVector P j)|) '' Icc 0 1) ^ 2 have hE := idealClippedCell_error_integrable epsilon he hn hd P j lambda hlambda have hB : Integrable B (idealCountLaw (n := n) P) := by let A := {counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) | idealPilotGoodBool (n := n) P counts j = false} have hA : MeasurableSet A := MeasurableSet.of_discrete apply (hE.indicator hA).congr filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [B, A, indicator, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [B, A, E, indicator, hg'] have hG : Integrable G (idealCountLaw (n := n) P) := by simpa [G] using (idealBadPilotCellEnvelope_sq_integral_le he hn hd P j).1 have hB2 : Integrable (fun counts => B counts ^ 2) (idealCountLaw (n := n) P) := by apply Integrable.mono' hG (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [B, G, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp only [B, G, hg', Bool.false_eq_true, if_false] have hEU : |E counts| ≤ sSup ((fun t : Real => |idealClippedCellPath (n := n) epsilon t counts j - thresholdFunReal epsilon t (cellVector P j)|) '' Icc 0 1) := by dsimp [E] apply le_csSup · exact ⟨_, fun y hy => by rcases hy with ⟨t, ht, rfl⟩ exact idealClippedCell_error_le_badScore he hn hd P counts j t ht⟩ · exact ⟨lambda, hlambda, rfl⟩ rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg (E counts)), ← sq_abs] exact pow_le_pow_left₀ (abs_nonneg _) hEU 2 have hmeanSq := integral_sq_le_integral_sq_of_nonneg (idealCountLaw (n := n) P) B (measurable_of_countable _).aestronglyMeasurable hB2 have hint : (∫ counts, B counts ^ 2 ∂idealCountLaw (n := n) P) ≤ ∫ counts, G counts ∂idealCountLaw (n := n) P := by exact integral_mono hB2 hG fun counts => by by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [B, G, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp only [B, G, hg', Bool.false_eq_true, if_false] have hEU : |E counts| ≤ sSup ((fun t : Real => |idealClippedCellPath (n := n) epsilon t counts j - thresholdFunReal epsilon t (cellVector P j)|) '' Icc 0 1) := by dsimp [E] apply le_csSup · exact ⟨_, fun y hy => by rcases hy with ⟨t, ht, rfl⟩ exact idealClippedCell_error_le_badScore he hn hd P counts j t ht⟩ · exact ⟨lambda, hlambda, rfl⟩ rw [← sq_abs] exact pow_le_pow_left₀ (abs_nonneg _) hEU 2 have hsquare : |∫ counts, B counts ∂idealCountLaw (n := n) P| ^ 2 ≤ ∫ counts, G counts ∂idealCountLaw (n := n) P := by rw [sq_abs] exact hmeanSq.trans hint have hGideal : (∫ counts, G counts ∂idealCountLaw (n := n) P) = ∫ counts, (if idealPilotGood (n := n) P counts j then 0 else sSup ((fun t : Real => |idealClippedCellPath (n := n) epsilon t counts j - thresholdFunReal epsilon t (cellVector P j)|) '' Icc 0 1) ^ 2) ∂idealCountLaw (n := n) P := by apply integral_congr_ae filter_upwards [] with counts by_cases hg : idealPilotGood (n := n) P counts j · have hb := (idealPilotGoodBool_eq_true P counts j).2 hg simp [G, hg, hb] · have hb : idealPilotGoodBool (n := n) P counts j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P counts j).1 ht) simp [G, hg, hb] unfold badPilotCellEnvelope dsimp [B] at hsquare ⊢ rw [hGideal] at hsquare apply (Real.le_sqrt (abs_nonneg _) (integral_nonneg fun counts => by split <;> positivity)).2 simpa [E] using hsquare
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealBadPilot_scalarMean_le_envelope · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:327
theorem idealGoodPilot_scalarMean_le

The good-pilot contribution to the ideal scalar cell mean inherits the flattened conditional bias bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
∃ C : Real,
conclusion 1
0 < C
conclusion 2
|∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P|
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + (32 * (3 * (1 + epsilon⁻¹) + 1)) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) * (sqrt 32 * pilotRadiusConstant) * badPilotCellScale (n := n) P j
Proof (Lean source)
-- @node: idealGoodPilot_scalarMean_le lemma idealGoodPilot_scalarMean_le {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : ∃ C : Real, 0 < C ∧ |∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + (32 * (3 * (1 + epsilon⁻¹) + 1)) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) * (sqrt 32 * pilotRadiusConstant) * badPilotCellScale (n := n) P j := by classical obtain ⟨C, hC, hflatBound⟩ := flatGoodPilot_conditionalBias_integral_le epsilon he he' hn hd P j lambda hlambda refine ⟨C, hC, ?_⟩ let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance let F := fun pe : (((Fin d × Fin 4) → Nat) × ((Fin d × Fin 4) → Nat)) => (curryCountTable pe.1, curryCountTable pe.2) let E := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) let H := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then E counts else 0 have hE := idealClippedCell_error_integrable epsilon he hn (show 1 ≤ d by omega) P j lambda hlambda have hH : Integrable H (idealCountLaw (n := n) P) := by let A := {counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) | idealPilotGoodBool (n := n) P counts j = true} apply (hE.indicator (MeasurableSet.of_discrete : MeasurableSet A)).congr filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [H, E, A, indicator, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [H, A, indicator, hg'] have hmap : Measure.map F (mu.prod mu) = idealCountLaw (n := n) P := by simpa [F, mu, rate] using map_flatIdealCountLaw (n := n) P have hflatInt : Integrable (H ∘ F) (mu.prod mu) := by have : Integrable H (Measure.map F (mu.prod mu)) := by simpa [hmap] using hH exact this.comp_aemeasurable (by fun_prop) have heq : (∫ counts, H counts ∂idealCountLaw (n := n) P) = ∫ p, (if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then ∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j) ∂mu - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂mu := by calc _ = ∫ pe, H (F pe) ∂mu.prod mu := by rw [← hmap, integral_map (by fun_prop) (measurable_of_countable _).aestronglyMeasurable] _ = ∫ p, ∫ e, H (F (p, e)) ∂mu ∂mu := integral_prod _ hflatInt _ = _ := by apply integral_congr_ae filter_upwards [] with p have hgoodEq (e : (Fin d × Fin 4) → Nat) : idealPilotGoodBool (n := n) P (curryCountTable p, curryCountTable e) j = idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j := by unfold idealPilotGoodBool congr 1 by_cases hg : idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j = true · simp_rw [H, F, hgoodEq, hg, if_true] have hstat : Integrable (fun e => jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j)) mu := by let c := thresholdFunReal epsilon lambda (pilotMidpoint ((n : Real) / 8) d (curryCountTable p j)) let s := (d : Real) ^ (1 / 4 : Real) * ∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta have hs : 0 ≤ s := by dsimp [s] apply mul_nonneg (Real.rpow_nonneg (by positivity) _) exact Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by positivity) (show 1 ≤ d by omega) (curryCountTable p j) z).le apply Integrable.mono' (integrable_const (|c| + s)) (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with e rw [Real.norm_eq_abs] unfold jacksonCellStatistic dsimp only calc _ ≤ |c| + |min s (max (-s) (jacksonCellRaw epsilon lambda (↑n / 8) d (curryCountTable p j) (curryCountTable e j) - c))| := abs_add_le _ _ _ ≤ |c| + s := by exact add_le_add_right (abs_le.2 ⟨le_min (neg_le_self hs) (le_max_left _ _), min_le_left _ _⟩) |c| dsimp [E] unfold idealClippedCellPath rw [integral_sub] · rw [integral_const] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] · exact hstat · exact integrable_const _ · have hg' := Bool.eq_false_of_not_eq_true hg rw [if_neg hg] apply integral_eq_zero_of_ae filter_upwards [] with e simp [H, F, hgoodEq e, hg'] rw [show (∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P) = ∫ counts, H counts ∂idealCountLaw (n := n) P by rfl, heq] calc _ ≤ ∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu := by apply (abs_integral_le_integral_abs).trans_eq apply integral_congr_ae filter_upwards [] with p split <;> simp _ ≤ _ := by change (∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (fun zeta => e (j, CellFourEquiv zeta)) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu) ≤ _ simpa only [mu, rate, poissonTableCell] using hflatBound
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilot_scalarMean_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:429
theorem uncappedJacksonCellBias_le_good_add_badEnvelope

The scalar cell bias is the sum of its good-pilot conditional clipping contribution and the bad-pilot envelope contribution. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
∃ C : Real,
conclusion 1
0 < C
conclusion 2
uncappedJacksonCellBias (n := n) epsilon lambda P j
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + (32 * (3 * (1 + epsilon⁻¹) + 1)) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) * (sqrt 32 * pilotRadiusConstant) * badPilotCellScale (n := n) P j
+ badPilotCellEnvelope (n := n) epsilon P j
Proof (Lean source)
-- @node: uncappedJacksonCellBias_le_good_add_badEnvelope lemma uncappedJacksonCellBias_le_good_add_badEnvelope {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : ∃ C : Real, 0 < C ∧ uncappedJacksonCellBias (n := n) epsilon lambda P j ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + (32 * (3 * (1 + epsilon⁻¹) + 1)) * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) * (sqrt 32 * pilotRadiusConstant) * badPilotCellScale (n := n) P j + badPilotCellEnvelope (n := n) epsilon P j := by classical obtain ⟨C, hC, hgood⟩ := idealGoodPilot_scalarMean_le epsilon he he' hn hd P j lambda hlambda refine ⟨C, hC, ?_⟩ let E := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) let G := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then E counts else 0 let B := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then 0 else E counts letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P have hE := idealClippedCell_error_integrable epsilon he hn (show 1 ≤ d by omega) P j lambda hlambda have hG : Integrable G (idealCountLaw (n := n) P) := by let A := {counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) | idealPilotGoodBool (n := n) P counts j = true} have hA : MeasurableSet A := MeasurableSet.of_discrete apply (hE.indicator hA).congr filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [G, E, A, indicator, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [G, E, A, indicator, hg'] have hB : Integrable B (idealCountLaw (n := n) P) := by exact (hE.sub hG).congr (Filter.Eventually.of_forall fun counts => by by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [E, G, B, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [E, G, B, hg']) have hstat : Integrable (fun counts => idealClippedCellPath (n := n) epsilon lambda counts j) (idealCountLaw (n := n) P) := by apply (hE.add (integrable_const (thresholdFunReal epsilon lambda (cellVector P j)))).congr filter_upwards [] with counts dsimp [E] ring have hbias : uncappedJacksonCellBias (n := n) epsilon lambda P j = |∫ counts, E counts ∂idealCountLaw (n := n) P| := by unfold uncappedJacksonCellBias expectedUncappedJacksonCell rw [integral_sub] · rw [integral_const] simp [idealClippedCellPath] · simpa [idealClippedCellPath] using hstat · exact integrable_const _ rw [hbias] have hsplit : (∫ counts, E counts ∂idealCountLaw (n := n) P) = (∫ counts, G counts ∂idealCountLaw (n := n) P) + ∫ counts, B counts ∂idealCountLaw (n := n) P := by rw [← integral_add hG hB] apply integral_congr_ae filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [E, G, B, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [E, G, B, hg'] rw [hsplit] refine (abs_add_le _ _).trans ?_ exact add_le_add hgood (idealBadPilot_scalarMean_le_envelope epsilon he hn (show 1 ≤ d by omega) P j lambda hlambda)
CausalSmith.Stat.DiscreteBudgetvalueCurve.uncappedJacksonCellBias_le_good_add_badEnvelope · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:564
theorem logAlphabet_mul_rpow_neg_three_sixteenths_le

The logarithmic factor times the negative three-sixteenths power is uniformly bounded on the paper's large-alphabet branch. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
hd :
16 ≤ d
logAlphabet d * (d : Real) ^ (-(3 / 16 : Real)) ≤ 19 / 3
Proof (Lean source)
-- @node: logAlphabet_mul_rpow_neg_three_sixteenths_le lemma logAlphabet_mul_rpow_neg_three_sixteenths_le {d : Nat} (hd : 16 ≤ d) : logAlphabet d * (d : Real) ^ (-(3 / 16 : Real)) ≤ 19 / 3 := by have hD : (1 : Real) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) have hD0 : (0 : Real) ≤ d := le_trans (by norm_num) hD have hDpos : (0 : Real) < d := lt_of_lt_of_le (by norm_num) hD have hpow0 : 0 ≤ (d : Real) ^ (-(3 / 16 : Real)) := Real.rpow_nonneg hD0 _ have hpowa : (d : Real) ^ (-(3 / 16 : Real)) ≤ 1 := by simpa using Real.rpow_le_rpow_of_exponent_le hD (by norm_num : (-(3 / 16 : Real)) ≤ 0) have hlog := Real.log_le_rpow_div hD0 (show 0 < (3 / 16 : Real) by norm_num) have hmul : log d * (d : Real) ^ (-(3 / 16 : Real)) ≤ 16 / 3 := by calc _ ≤ ((d : Real) ^ (3 / 16 : Real) / (3 / 16 : Real)) * (d : Real) ^ (-(3 / 16 : Real)) := mul_le_mul_of_nonneg_right hlog hpow0 _ = 16 / 3 := by rw [div_mul_eq_mul_div, ← Real.rpow_add hDpos] norm_num rw [show logAlphabet d = 1 + log d by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt (lt_of_lt_of_le (by norm_num) hD)), Real.log_exp]] nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.logAlphabet_mul_rpow_neg_three_sixteenths_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:645
theorem logAlphabet_div_jacksonDegree_le

The logarithm divided by the paper's Jackson degree is uniformly bounded. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
logAlphabet d / (jacksonDegree d : Real) ≤ 768
Proof (Lean source)
-- @node: logAlphabet_div_jacksonDegree_le lemma logAlphabet_div_jacksonDegree_le {d : Nat} : logAlphabet d / (jacksonDegree d : Real) ≤ 768 := by let L := logAlphabet d let q := ⌊jacksonDegreeConstant * L⌋₊ let K := jacksonDegree d have hK2 : (2 : Real) ≤ K := by exact_mod_cast (show 2 ≤ K by simp [K, jacksonDegree]) have hqK : (q : Real) ≤ K := by exact_mod_cast (show q ≤ K by dsimp [q, K, L] exact le_max_right _ _) have hfloor := Nat.lt_floor_add_one (jacksonDegreeConstant * L) have hscale : L < 512 * ((q : Real) + 1) := by change L < 512 * (((⌊jacksonDegreeConstant * L⌋₊ : Nat) : Real) + 1) norm_num [jacksonDegreeConstant] at hfloor ⊢ nlinarith have hq1 : (q : Real) + 1 ≤ (3 / 2 : Real) * K := by nlinarith have hLK : L ≤ 768 * K := by nlinarith exact (div_le_iff₀ (lt_of_lt_of_le (by norm_num) hK2)).2 (by nlinarith)
CausalSmith.Stat.DiscreteBudgetvalueCurve.logAlphabet_div_jacksonDegree_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:673
theorem goodPilot_clippingCoefficient_mul_log_le

The complete good-pilot clipping coefficient loses one logarithmic factor uniformly in the alphabet size. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
hd :
16 ≤ d
C A :
hC :
0 ≤ C
hA :
0 ≤ A
logAlphabet d * (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + A * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2))
≤ 4 * C ^ 2 * exp 123 * (19 / 3) + A * 1920
Proof (Lean source)
-- @node: goodPilot_clippingCoefficient_mul_log_le lemma goodPilot_clippingCoefficient_mul_log_le {d : Nat} (hd : 16 ≤ d) (C A : Real) (hC : 0 ≤ C) (hA : 0 ≤ A) : logAlphabet d * (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) + A * (2 / (jacksonDegree d : Real) + 1 / (jacksonDegree d : Real) ^ 2)) ≤ 4 * C ^ 2 * exp 123 * (19 / 3) + A * 1920 := by have hDpos : (0 : Real) < d := by positivity have hratio : (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) = (d : Real) ^ (-(3 / 16 : Real)) := by rw [← Real.rpow_sub hDpos] norm_num have hLK := logAlphabet_div_jacksonDegree_le (d := d) have hK2 : (2 : Real) ≤ jacksonDegree d := by exact_mod_cast (show 2 ≤ jacksonDegree d by simp [jacksonDegree]) have hL0 : 0 ≤ logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) hDpos.ne', Real.log_exp] exact add_nonneg (by norm_num) (Real.log_nonneg (by exact_mod_cast (show 1 ≤ d by omega))) have hKpos : (0 : Real) < jacksonDegree d := lt_of_lt_of_le (by norm_num) hK2 have hLK2 : logAlphabet d / (jacksonDegree d : Real) ^ 2 ≤ 384 := by calc _ = (logAlphabet d / (jacksonDegree d : Real)) / (jacksonDegree d : Real) := by field_simp _ ≤ 768 / (jacksonDegree d : Real) := div_le_div_of_nonneg_right hLK hKpos.le _ ≤ 384 := (div_le_iff₀ hKpos).2 (by nlinarith) rw [show 4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) = 4 * C ^ 2 * exp 123 * ((d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) by ring, hratio] have hp := logAlphabet_mul_rpow_neg_three_sixteenths_le hd calc _ = 4 * C ^ 2 * exp 123 * (logAlphabet d * (d : Real) ^ (-(3 / 16 : Real))) + A * (2 * (logAlphabet d / (jacksonDegree d : Real)) + logAlphabet d / (jacksonDegree d : Real) ^ 2) := by ring _ ≤ _ := by gcongr <;> nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_clippingCoefficient_mul_log_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:696
theorem truncatedEmpiricalInterval_boundaryProduct_le Lemma truncatedEmpiricalInterval_boundaryProduct_le in the paper ↗

Boundary adaptivity removes the additive empirical-radius floor: inside the truncated nonnegative confidence interval, the product of the distances to its endpoints is controlled by the true intensity times the radius level. With the specified inputs and conditions, the stated relationship holds.

Formal statement
H delta x q :
hH :
1 ≤ H
hdelta :
0 < delta
hx0 :
0 ≤ x
hqmem :
q ∈ Icc (max 0 (x - H * (sqrt (x * delta) + delta))) (x + H * (sqrt (x * delta) + delta))
(q - max 0 (x - H * (sqrt (x * delta) + delta))) * ((x + H * (sqrt (x * delta) + delta)) - q)
≤ 8 * H ^ 2 * q * delta
Proof (Lean source)
-- @node: truncatedEmpiricalInterval_boundaryProduct_le lemma truncatedEmpiricalInterval_boundaryProduct_le (H delta x q : Real) (hH : 1 ≤ H) (hdelta : 0 < delta) (hx0 : 0 ≤ x) (hqmem : q ∈ Icc (max 0 (x - H * (sqrt (x * delta) + delta))) (x + H * (sqrt (x * delta) + delta))) : (q - max 0 (x - H * (sqrt (x * delta) + delta))) * ((x + H * (sqrt (x * delta) + delta)) - q) ≤ 8 * H ^ 2 * q * delta := by let s := sqrt (x * delta) let h := H * (s + delta) have hH0 : 0 ≤ H := le_trans (by norm_num) hH have hs0 : 0 ≤ s := Real.sqrt_nonneg _ have hs2 : s ^ 2 = x * delta := by dsimp [s] exact Real.sq_sqrt (mul_nonneg hx0 hdelta.le) have hh0 : 0 ≤ h := by dsimp [h]; positivity have hq0 : 0 ≤ q := le_trans (le_max_left _ _) hqmem.1 change (q - max 0 (x - h)) * ((x + h) - q) ≤ 8 * H ^ 2 * q * delta by_cases hsmall : x ≤ 2 * h · have hsdelta : s ≤ (2 * H + 1) * delta := by by_contra hnot have hlt : (2 * H + 1) * delta < s := lt_of_not_ge hnot have hpos : 0 < (2 * H + 1) * delta := by positivity have hsquare : ((2 * H + 1) * delta) ^ 2 < s ^ 2 := (sq_lt_sq₀ hpos.le hs0).2 hlt dsimp [h] at hsmall rw [hs2] at hsquare nlinarith have hh : h ≤ 2 * H * (H + 1) * delta := by dsimp [h] have := mul_le_mul_of_nonneg_left hsdelta hH0 nlinarith have hleft : q - max 0 (x - h) ≤ q := by linarith [le_max_left (0 : Real) (x - h)] have hright : x + h - q ≤ 2 * h := by have hlo := hqmem.1 change max 0 (x - h) ≤ q at hlo have hxmh : x - h ≤ q := le_trans (le_max_right _ _) hlo linarith have hleft0 : 0 ≤ q - max 0 (x - h) := by simpa using hqmem.1 have hright0 : 0 ≤ x + h - q := by simpa using hqmem.2 calc _ ≤ q * (2 * h) := mul_le_mul hleft hright hright0 hq0 _ ≤ 8 * H ^ 2 * q * delta := by have hqh := mul_le_mul_of_nonneg_left hh hq0 have hcoef : 4 * H * (H + 1) ≤ 8 * H ^ 2 := by nlinarith [mul_nonneg hH0 (sub_nonneg.mpr hH)] have hc := mul_le_mul_of_nonneg_right hcoef (mul_nonneg hq0 hdelta.le) nlinarith · have hlarge : 2 * h < x := lt_of_not_ge hsmall have hxmh : 0 < x - h := by linarith rw [max_eq_right hxmh.le] have hqlo : x - h ≤ q := by simpa [h, s, max_eq_right hxmh.le] using hqmem.1 have hxq : x < 2 * q := by linarith have hHdelta_q : H * delta < q := by have hhdelta : H * delta ≤ h := by dsimp [h]; nlinarith nlinarith have hdeltaq : delta ≤ q := by nlinarith have hxd : x * delta ≤ 2 * q * delta := mul_le_mul_of_nonneg_right (le_of_lt hxq) hdelta.le have hdd : delta ^ 2 ≤ q * delta := by nlinarith have hh2 : h ^ 2 ≤ 6 * H ^ 2 * q * delta := by dsimp [h] rw [mul_pow] have hsplus : (s + delta) ^ 2 ≤ 2 * s ^ 2 + 2 * delta ^ 2 := by nlinarith [sq_nonneg (s - delta)] rw [hs2] at hsplus have hmul := mul_le_mul_of_nonneg_left hsplus (sq_nonneg H) have hxd' := mul_le_mul_of_nonneg_left hxd (sq_nonneg H) have hdd' := mul_le_mul_of_nonneg_left hdd (sq_nonneg H) nlinarith calc (q - (x - h)) * (x + h - q) ≤ h ^ 2 := by nlinarith [sq_nonneg (q - x)] _ ≤ 8 * H ^ 2 * q * delta := by have : 0 ≤ H ^ 2 * q * delta := by positivity nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.truncatedEmpiricalInterval_boundaryProduct_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:740
theorem idealPilotGood_boundaryProduct_le

On a paper good-pilot draw, each physical Jackson boundary product has the sharp true-rate scale, including at a null coordinate. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → Nat) × (Fin d → Cell → Nat)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
zeta :
Cell
m :
(n : Real) / 8 (: Real)
q :
cellVector P j zeta
c :
pilotMidpoint m d (counts.1 j) zeta
r :
pilotRadius m d (counts.1 j) zeta
(q - (c - r)) * ((c + r) - q) ≤ 8 * pilotRadiusConstant ^ 2 * q * (logAlphabet d / m)
Proof (Lean source)
-- @node: idealPilotGood_boundaryProduct_le lemma idealPilotGood_boundaryProduct_le {n d : Nat} (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) (zeta : Cell) : let m : Real := (n : Real) / 8 let q := cellVector P j zeta let c := pilotMidpoint m d (counts.1 j) zeta let r := pilotRadius m d (counts.1 j) zeta (q - (c - r)) * ((c + r) - q) ≤ 8 * pilotRadiusConstant ^ 2 * q * (logAlphabet d / m) := by dsimp only let m : Real := (n : Real) / 8 let x := pilotCenter m (counts.1 j) zeta let q := cellVector P j zeta let delta := logAlphabet d / m have hm : 0 < m := by dsimp [m]; positivity have hL : 0 < logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have : (1 : Real) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg this] have hdelta : 0 < delta := div_pos hL hm have hx0 : 0 ≤ x := by dsimp [x, pilotCenter]; positivity have hmem : q ∈ Icc (max 0 (x - pilotRadiusConstant * (sqrt (x * delta) + delta))) (x + pilotRadiusConstant * (sqrt (x * delta) + delta)) := by have hg := idealPilotGood_center_mem_radius hn P counts j hgood zeta rw [abs_le] at hg constructor · change max 0 (x - pilotRadiusConstant * (sqrt (x * delta) + delta)) ≤ q have hc : pilotMidpoint m d (counts.1 j) zeta - pilotRadius m d (counts.1 j) zeta = max 0 (x - pilotRadiusConstant * (sqrt (x * delta) + delta)) := by dsimp [x, delta] unfold pilotMidpoint pilotRadius pilotLower pilotUpper pilotHalfWidth ring rw [← hc] linarith · change q ≤ x + pilotRadiusConstant * (sqrt (x * delta) + delta) have hc : pilotMidpoint m d (counts.1 j) zeta + pilotRadius m d (counts.1 j) zeta = x + pilotRadiusConstant * (sqrt (x * delta) + delta) := by dsimp [x, delta] unfold pilotMidpoint pilotRadius pilotLower pilotUpper pilotHalfWidth ring rw [← hc] linarith have hp := truncatedEmpiricalInterval_boundaryProduct_le pilotRadiusConstant delta x q (by unfold pilotRadiusConstant; norm_num) hdelta hx0 hmem have hlower : pilotMidpoint m d (counts.1 j) zeta - pilotRadius m d (counts.1 j) zeta = max 0 (x - pilotRadiusConstant * (sqrt (x * delta) + delta)) := by dsimp [x, delta] unfold pilotMidpoint pilotRadius pilotLower pilotUpper pilotHalfWidth ring have hupper : pilotMidpoint m d (counts.1 j) zeta + pilotRadius m d (counts.1 j) zeta = x + pilotRadiusConstant * (sqrt (x * delta) + delta) := by dsimp [x, delta] unfold pilotMidpoint pilotRadius pilotLower pilotUpper pilotHalfWidth ring simpa [m, q, delta, hlower, hupper] using hp
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood_boundaryProduct_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasOuter.lean:822
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.ScalarBiasSharp 14 declarations Sharp boundary-product bounds for the scalar Jackson bias.

Sharp boundary-product bounds for the scalar Jackson bias.

Each coordinate of a cell vector is bounded by the total cell mass. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
P :
j :
Fin d
zeta :
Cell
cellVector P j zeta ≤ cellMass P j
Proof (Lean source)
-- @node: cellVector_le_cellMass lemma cellVector_le_cellMass {d : Nat} (P : DiscreteLaw d) (j : Fin d) (zeta : Cell) : cellVector P j zeta ≤ cellMass P j := by have hsum : ∑ z : Cell, cellVector P j z = cellMass P j := by rw [Fintype.sum_prod_type] simp_rw [Fin.sum_univ_two] simp [cellMass, cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring rw [← hsum] exact Finset.single_le_sum (fun z _ => by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity) (Finset.mem_univ zeta)
CausalSmith.Stat.DiscreteBudgetvalueCurve.cellVector_le_cellMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:15
theorem idealPilotGood_boundarySqrt_sum_le

The sum of the four good-pilot physical boundary products has the sharp true cell-mass scale. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
hn :
1 ≤ n
hd :
1 ≤ d
P :
counts :
(Fin d → Cell → Nat) × (Fin d → Cell → Nat)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
m :
(n : Real) / 8 (: Real)
c :
pilotMidpoint m d (counts.1 j)
r :
pilotRadius m d (counts.1 j)
q :
∑ i : Fin 4, sqrt ((q (CellFourEquiv.symm i) - (c (CellFourEquiv.symm i) - r (CellFourEquiv.symm i))) * ((c (CellFourEquiv.symm i) + r (CellFourEquiv.symm i)) - q (CellFourEquiv.symm i)))
≤ 4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m))
Proof (Lean source)
-- @node: idealPilotGood_boundarySqrt_sum_le lemma idealPilotGood_boundarySqrt_sum_le {n d : Nat} (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) : let m : Real := (n : Real) / 8 let c := pilotMidpoint m d (counts.1 j) let r := pilotRadius m d (counts.1 j) let q := cellVector P j ∑ i : Fin 4, sqrt ((q (CellFourEquiv.symm i) - (c (CellFourEquiv.symm i) - r (CellFourEquiv.symm i))) * ((c (CellFourEquiv.symm i) + r (CellFourEquiv.symm i)) - q (CellFourEquiv.symm i))) ≤ 4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) := by dsimp only have hL : 0 ≤ logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] have : (1 : Real) ≤ d := by exact_mod_cast hd linarith [Real.log_nonneg this] have hdelta0 : 0 ≤ logAlphabet d / ((n : Real) / 8) := by positivity calc _ ≤ ∑ _i : Fin 4, sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8))) := by apply Finset.sum_le_sum intro i hi apply Real.sqrt_le_sqrt exact (idealPilotGood_boundaryProduct_le hn hd P counts j hgood (CellFourEquiv.symm i)).trans (by apply mul_le_mul_of_nonneg_right · exact mul_le_mul_of_nonneg_left (cellVector_le_cellMass P j (CellFourEquiv.symm i)) (by positivity) · exact hdelta0) _ = _ := by rw [Finset.sum_const, nsmul_eq_mul]; simp
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealPilotGood_boundarySqrt_sum_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:33
theorem goodPilot_localJacksonPolynomial_boundary_sharp

The good-pilot Jackson approximation keeps the boundary-adaptive term separate from the second-order radius term. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise.

Formal statement
n d :
epsilon :
he :
0 < epsilon
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
hn :
1 ≤ n
hd :
16 ≤ d
P :
counts :
(Fin d → Cell → Nat) × (Fin d → Cell → Nat)
j :
Fin d
hgood :
idealPilotGood (n := n) P counts j
m :
(n : Real) / 8 (: Real)
center :
pilotMidpoint m d (counts.1 j)
radius :
pilotRadius m d (counts.1 j)
q :
|thresholdFunReal epsilon lambda center
+ eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => q (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) center radius)
- thresholdFunReal epsilon lambda q|
≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + (∑ zeta : Cell, radius zeta) / (jacksonDegree d : Real) ^ 2)
Proof (Lean source)
-- @node: goodPilot_localJacksonPolynomial_boundary_sharp lemma goodPilot_localJacksonPolynomial_boundary_sharp {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat)) (j : Fin d) (hgood : idealPilotGood (n := n) P counts j) : let m : Real := (n : Real) / 8 let center := pilotMidpoint m d (counts.1 j) let radius := pilotRadius m d (counts.1 j) let q := cellVector P j |thresholdFunReal epsilon lambda center + eval (normalizedPoint (fun i => center (CellFourEquiv.symm i)) (fun i => radius (CellFourEquiv.symm i)) (fun i => q (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) center radius) - thresholdFunReal epsilon lambda q| ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + (∑ zeta : Cell, radius zeta) / (jacksonDegree d : Real) ^ 2) := by dsimp only have hbase := goodPilot_localJacksonPolynomial_boundary_adaptive epsilon he lambda hlambda hn (show 1 ≤ d by omega) P counts j hgood have hsqrt := idealPilotGood_boundarySqrt_sum_le hn (show 1 ≤ d by omega) P counts j hgood let K : Real := jacksonDegree d have hK : 0 < K := by dsimp [K] exact_mod_cast (show 0 < jacksonDegree d by simp [jacksonDegree]) have hradius : (∑ i : Fin 4, pilotRadius ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i)) = ∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (counts.1 j) zeta := Equiv.sum_comp CellFourEquiv.symm _ calc _ ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * ∑ i : Fin 4, (sqrt ((cellVector P j (CellFourEquiv.symm i) - (pilotMidpoint ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i) - pilotRadius ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i))) * ((pilotMidpoint ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i) + pilotRadius ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i)) - cellVector P j (CellFourEquiv.symm i))) / K + pilotRadius ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i) / K ^ 2) := by simpa [K] using hbase _ = 32 * (3 * (1 + epsilon⁻¹) + 1) * ((∑ i : Fin 4, sqrt ((cellVector P j (CellFourEquiv.symm i) - (pilotMidpoint ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i) - pilotRadius ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i))) * ((pilotMidpoint ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i) + pilotRadius ((n : Real) / 8) d (counts.1 j) (CellFourEquiv.symm i)) - cellVector P j (CellFourEquiv.symm i)))) / K + (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (counts.1 j) zeta) / K ^ 2) := by rw [Finset.sum_add_distrib, ← Finset.sum_div, ← Finset.sum_div, hradius] _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (by positivity) simpa [K] using add_le_add_left (div_le_div_of_nonneg_right hsqrt hK.le) ((∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (counts.1 j) zeta) / K ^ 2)
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_localJacksonPolynomial_boundary_sharp · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:73
theorem goodPilot_jacksonCellStatistic_conditional_bias_sharp

Conditional good-pilot scalar bias with the physical boundary term kept separate from the second-order radius term. With the specified inputs and conditions, the stated relationship holds. The argument assumes the good-pilot premise, the shadow-price range, the positive envelope constant, and the coefficient envelope.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
16 ≤ d
P :
p :
(Fin d × Fin 4) → Nat
j :
Fin d
hgood :
idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
C :
hC :
0 ≤ C
hcoeff :
jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j)
≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)
m :
(n : Real) / 8 (: Real)
pilot :
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → Nat) → Nat)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2)
|(∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu)
- thresholdFunReal epsilon lambda (cellVector P j)|
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta)
+ 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + (∑ zeta, pilotRadius m d pilot zeta) / (jacksonDegree d : Real) ^ 2)
Proof (Lean source)
-- @node: goodPilot_jacksonCellStatistic_conditional_bias_sharp lemma goodPilot_jacksonCellStatistic_conditional_bias_sharp {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (p : (Fin d × Fin 4) → Nat) (j : Fin d) (hgood : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (C : Real) (hC : 0 ≤ C) (hcoeff : jacksonCoefficientBV epsilon ((n : Real) / 8) d (curryCountTable p j) ≤ C * (∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta) * exp (12 * jacksonDegree d)) : let m : Real := (n : Real) / 8 let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => idealFlatRate (n := n) P iz.1 iz.2) |(∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta) + 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + (∑ zeta, pilotRadius m d pilot zeta) / (jacksonDegree d : Real) ^ 2) := by dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance let pilot := curryCountTable p j let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i have hWlaw (i : Fin 4) : HasLaw (W i) (poissonMeasure (rate j i)) mu := by simpa [W, mu, rate, poissonTableCell] using poissonTable_eval_coordinate_law (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) (j, i) have hWindep : iIndepFun W mu := by rw [iIndepFun_iff_map_fun_eq_infinitePi_map (by fun_prop)] calc Measure.map (fun e i => W i e) mu = poissonTableLaw (rate j) := by simpa [W, mu] using (poissonTable_eval_cell_law rate j).map_eq _ = Measure.infinitePi (fun i => poissonMeasure (rate j i)) := rfl _ = Measure.infinitePi (fun i => Measure.map (W i) mu) := by congr 1 funext i exact (hWlaw i).map_eq.symm have hclip := goodPilot_jacksonCellStatistic_mean_sub_raw_mean_le epsilon he hn hd P p j hgood lambda hlambda C hC hcoeff have hmean := jacksonCellRaw_mean mu epsilon he lambda hlambda m (by dsimp [m]; positivity) d (show 1 ≤ d by omega) pilot W (rate j) hWlaw hWindep have hrate (i : Fin 4) : (rate j i : Real) / m = cellVector P j (CellFourEquiv.symm i) := by have hq : 0 ≤ cellVector P j (CellFourEquiv.symm i) := ENNReal.toReal_nonneg dsimp [rate, idealFlatRate, m] rw [max_eq_left (mul_nonneg (by positivity) hq)] field_simp have hmean' : (∫ e, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu) = thresholdFunReal epsilon lambda (pilotMidpoint m d pilot) + eval (normalizedPoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) (fun i => cellVector P j (CellFourEquiv.symm i))) (localJacksonPolynomial epsilon lambda (jacksonDegree d) (pilotMidpoint m d pilot) (pilotRadius m d pilot)) := by rw [hmean] congr 2 rw [show (fun i => ((rate j i : Real) / m - pilotMidpoint m d pilot (CellFourEquiv.symm i)) / pilotRadius m d pilot (CellFourEquiv.symm i)) = normalizedPoint (fun i => pilotMidpoint m d pilot (CellFourEquiv.symm i)) (fun i => pilotRadius m d pilot (CellFourEquiv.symm i)) (fun i => cellVector P j (CellFourEquiv.symm i)) by funext i simp only [normalizedPoint, hrate]] have hboundary := goodPilot_localJacksonPolynomial_boundary_sharp epsilon he lambda hlambda hn hd P (curryCountTable p, fun _ _ => 0) j hgood let A : Real := ∫ e, jacksonCellStatistic epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu let R : Real := ∫ e, jacksonCellRaw epsilon lambda m d pilot (fun zeta => W (CellFourEquiv zeta) e) ∂mu let T : Real := thresholdFunReal epsilon lambda (cellVector P j) change |A - T| ≤ _ have hclip' : |A - R| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) * (∑ zeta, pilotRadius m d pilot zeta) ^ 2) / ((d : Real) ^ (1 / 4 : Real) * ∑ zeta, pilotRadius m d pilot zeta) := by simpa [A, R, m, rate, mu, pilot, W] using hclip have hboundary' : |R - T| ≤ 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + (∑ zeta, pilotRadius m d pilot zeta) / (jacksonDegree d : Real) ^ 2) := by dsimp [R, T] rw [hmean'] simpa [m, pilot] using hboundary calc |A - T| = |(A - R) + (R - T)| := by congr 1 <;> ring _ ≤ |A - R| + |R - T| := abs_add_le _ _ _ ≤ _ := add_le_add hclip' hboundary'
CausalSmith.Stat.DiscreteBudgetvalueCurve.goodPilot_jacksonCellStatistic_conditional_bias_sharp · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:150
theorem flatGoodPilot_conditionalBias_integral_sharp

Integrating the sharp conditional bias over the pilot table costs only the first moment of the radius sum; the boundary product is deterministic. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
C :
hC :
0 < C
hcoeff :
∀ (m : Real),
0 < m → ∀ (d : Nat), 1
≤ d → ∀ pilot, jacksonCoefficientBV epsilon m d pilot ≤ C * (∑ zeta : Cell, pilotRadius m d pilot zeta) * exp (12 * jacksonDegree d)
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
m :
(n : Real) / 8 (: Real)
rate :
idealFlatRate (n := n) P (: Fin d → Fin 4 → NNReal)
mu :
poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2)
W :
fun i e => poissonTableCell j e i (: Fin 4 → ((Fin d × Fin 4) → Nat) → Nat)
R :
(∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu)
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) * R
+ 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + R / (jacksonDegree d : Real) ^ 2)
Proof (Lean source)
-- @node: flatGoodPilot_conditionalBias_integral_sharp lemma flatGoodPilot_conditionalBias_integral_sharp {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (C : Real) (hC : 0 < C) (hcoeff : ∀ (m : Real), 0 < m → ∀ (d : Nat), 1 ≤ d → ∀ pilot, jacksonCoefficientBV epsilon m d pilot ≤ C * (∑ zeta : Cell, pilotRadius m d pilot zeta) * exp (12 * jacksonDegree d)) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let R := sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j (∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu) ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) * R + 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + R / (jacksonDegree d : Real) ^ 2) := by classical dsimp only let m : Real := (n : Real) / 8 let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i let S : ((Fin d × Fin 4) → Nat) → Real := fun p => ∑ zeta : Cell, pilotRadius m d (curryCountTable p j) zeta let R : Real := sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j let B : Real := 4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) let A : Real := 32 * (3 * (1 + epsilon⁻¹) + 1) let D : Real := 4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) let H : ((Fin d × Fin 4) → Nat) → Real := fun p => if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 have hSpos (p : (Fin d × Fin 4) → Nat) : 0 ≤ S p := Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) (curryCountTable p j) z).le have hSstrict (p : (Fin d × Fin 4) → Nat) : 0 < S p := Finset.sum_pos (fun z _ => pilotRadius_pos_of_pos (by dsimp [m]; positivity) (show 1 ≤ d by omega) (curryCountTable p j) z) (by simp) have hB0 : 0 ≤ B := by dsimp [B]; positivity have hA0 : 0 ≤ A := by dsimp [A]; positivity have hD0 : 0 ≤ D := by dsimp [D]; positivity have hpoint (p : (Fin d × Fin 4) → Nat) : H p ≤ B * S p + A * (D + S p / (jacksonDegree d : Real) ^ 2) := by by_cases hg : idealPilotGood (n := n) P (curryCountTable p, fun _ _ => 0) j · have hc := goodPilot_jacksonCellStatistic_conditional_bias_sharp epsilon he hn hd P p j hg lambda hlambda C hC.le (hcoeff m (by dsimp [m]; positivity) d (show 1 ≤ d by omega) (curryCountTable p j)) have hgb := (idealPilotGoodBool_eq_true P (curryCountTable p, fun _ _ => 0) j).2 hg rw [show H p = |(∫ e, jacksonCellStatistic epsilon lambda m d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| by simp [H, hgb]] apply hc.trans_eq dsimp [B, A, D, S, m, rate, mu, W] field_simp [(hSstrict p).ne'] · have hgb : idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j = false := by apply Bool.eq_false_of_not_eq_true exact fun ht => hg ((idealPilotGoodBool_eq_true P (curryCountTable p, fun _ _ => 0) j).1 ht) rw [show H p = 0 by simp [H, hgb]] exact add_nonneg (mul_nonneg hB0 (hSpos p)) (mul_nonneg hA0 (add_nonneg hD0 (div_nonneg (hSpos p) (sq_nonneg _)))) have hSint : Integrable S mu := by have hsecond := pilotRadius_sum_sq_integral_le_cellScale hn hd P j exact ((memLp_two_iff_integrable_sq (measurable_of_countable _).aestronglyMeasurable).2 (by simpa [S, m, rate, mu] using hsecond.1)).integrable (by norm_num) have hmajor : Integrable (fun p => B * S p + A * (D + S p / (jacksonDegree d : Real) ^ 2)) mu := by fun_prop have hpart : Integrable (fun p => D + S p / (jacksonDegree d : Real) ^ 2) mu := (integrable_const D).add (hSint.div_const _) have hHint : Integrable H mu := by apply Integrable.mono' hmajor (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with p rw [Real.norm_eq_abs, abs_of_nonneg (by dsimp [H]; split <;> positivity)] exact hpoint p calc _ = ∫ p, H p ∂mu := by rfl _ ≤ ∫ p, (B * S p + A * (D + S p / (jacksonDegree d : Real) ^ 2)) ∂mu := integral_mono hHint hmajor hpoint _ = B * (∫ p, S p ∂mu) + A * (D + (∫ p, S p ∂mu) / (jacksonDegree d : Real) ^ 2) := by rw [integral_add (hSint.const_mul B) (hpart.const_mul A), integral_const_mul, integral_const_mul, integral_add (integrable_const D) (hSint.div_const _), integral_const, integral_div] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] _ ≤ B * R + A * (D + R / (jacksonDegree d : Real) ^ 2) := by have hSR : (∫ p, S p ∂mu) ≤ R := by simpa [S, R, m, rate, mu] using pilotRadius_sum_integral_le_cellScale hn hd P j gcongr _ = _ := by rfl
CausalSmith.Stat.DiscreteBudgetvalueCurve.flatGoodPilot_conditionalBias_integral_sharp · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:267
theorem idealGoodPilot_scalarMean_le_of_flat

Any flattened good-pilot scalar bound transports unchanged to the paper's curried ideal count law. With the specified inputs and conditions, the stated relationship holds. The argument assumes the flattened-law bound.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
R :
hflatBound :
let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e
=> poissonTableCell j e i (∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu) ≤ R
|∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P|
≤ R
Proof (Lean source)
-- @node: idealGoodPilot_scalarMean_le_of_flat lemma idealGoodPilot_scalarMean_le_of_flat {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) (R : Real) (hflatBound : let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) let W : Fin 4 → ((Fin d × Fin 4) → Nat) → Nat := fun i e => poissonTableCell j e i (∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (fun zeta => W (CellFourEquiv zeta) e) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu) ≤ R) : |∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P| ≤ R := by classical let rate : Fin d → Fin 4 → NNReal := idealFlatRate (n := n) P let mu := poissonTableLaw (fun iz : Fin d × Fin 4 => rate iz.1 iz.2) letI : IsProbabilityMeasure mu := by dsimp [mu, poissonTableLaw]; infer_instance let F := fun pe : (((Fin d × Fin 4) → Nat) × ((Fin d × Fin 4) → Nat)) => (curryCountTable pe.1, curryCountTable pe.2) let E := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) let H := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then E counts else 0 have hE := idealClippedCell_error_integrable epsilon he hn (show 1 ≤ d by omega) P j lambda hlambda have hH : Integrable H (idealCountLaw (n := n) P) := by let A := {counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) | idealPilotGoodBool (n := n) P counts j = true} apply (hE.indicator (MeasurableSet.of_discrete : MeasurableSet A)).congr filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [H, E, A, indicator, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [H, A, indicator, hg'] have hmap : Measure.map F (mu.prod mu) = idealCountLaw (n := n) P := by simpa [F, mu, rate] using map_flatIdealCountLaw (n := n) P have hflatInt : Integrable (H ∘ F) (mu.prod mu) := by have : Integrable H (Measure.map F (mu.prod mu)) := by simpa [hmap] using hH exact this.comp_aemeasurable (by fun_prop) have heq : (∫ counts, H counts ∂idealCountLaw (n := n) P) = ∫ p, (if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then ∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j) ∂mu - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂mu := by calc _ = ∫ pe, H (F pe) ∂mu.prod mu := by rw [← hmap, integral_map (by fun_prop) (measurable_of_countable _).aestronglyMeasurable] _ = ∫ p, ∫ e, H (F (p, e)) ∂mu ∂mu := integral_prod _ hflatInt _ = _ := by apply integral_congr_ae filter_upwards [] with p have hgoodEq (e : (Fin d × Fin 4) → Nat) : idealPilotGoodBool (n := n) P (curryCountTable p, curryCountTable e) j = idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j := by unfold idealPilotGoodBool congr 1 by_cases hg : idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j = true · simp_rw [H, F, hgoodEq, hg, if_true] have hstat : Integrable (fun e => jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j)) mu := by let c := thresholdFunReal epsilon lambda (pilotMidpoint ((n : Real) / 8) d (curryCountTable p j)) let s := (d : Real) ^ (1 / 4 : Real) * ∑ zeta : Cell, pilotRadius ((n : Real) / 8) d (curryCountTable p j) zeta have hs : 0 ≤ s := by dsimp [s] apply mul_nonneg (Real.rpow_nonneg (by positivity) _) exact Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by positivity) (show 1 ≤ d by omega) (curryCountTable p j) z).le apply Integrable.mono' (integrable_const (|c| + s)) (measurable_of_countable _).aestronglyMeasurable filter_upwards [] with e rw [Real.norm_eq_abs] unfold jacksonCellStatistic dsimp only calc _ ≤ |c| + |min s (max (-s) (jacksonCellRaw epsilon lambda (↑n / 8) d (curryCountTable p j) (curryCountTable e j) - c))| := abs_add_le _ _ _ ≤ |c| + s := by exact add_le_add_right (abs_le.2 ⟨le_min (neg_le_self hs) (le_max_left _ _), min_le_left _ _⟩) |c| dsimp [E] unfold idealClippedCellPath rw [integral_sub] · rw [integral_const] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] · exact hstat · exact integrable_const _ · have hg' := Bool.eq_false_of_not_eq_true hg rw [if_neg hg] apply integral_eq_zero_of_ae filter_upwards [] with e simp [H, F, hgoodEq e, hg'] rw [show (∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P) = ∫ counts, H counts ∂idealCountLaw (n := n) P by rfl, heq] calc _ ≤ ∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (curryCountTable e j) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu := by apply (abs_integral_le_integral_abs).trans_eq apply integral_congr_ae filter_upwards [] with p split <;> simp _ ≤ _ := by change (∫ p, if idealPilotGoodBool (n := n) P (curryCountTable p, fun _ _ => 0) j then |(∫ e, jacksonCellStatistic epsilon lambda ((n : Real) / 8) d (curryCountTable p j) (fun zeta => e (j, CellFourEquiv zeta)) ∂mu) - thresholdFunReal epsilon lambda (cellVector P j)| else 0 ∂mu) ≤ _ simpa only [mu, rate, poissonTableCell] using hflatBound
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilot_scalarMean_le_of_flat · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:385
theorem idealGoodPilot_scalarMean_sharp

The sharp flattened good-pilot bias bound under the ideal count law. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
P :
C :
hC :
0 < C
hcoeff :
∀ (m : Real),
0 < m → ∀ (d : Nat), 1
≤ d → ∀ pilot, jacksonCoefficientBV epsilon m d pilot ≤ C * (∑ zeta : Cell, pilotRadius m d pilot zeta) * exp (12 * jacksonDegree d)
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
m :
(n : Real) / 8 (: Real)
R :
|∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P|
≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) * R
+ 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + R / (jacksonDegree d : Real) ^ 2)
Proof (Lean source)
-- @node: idealGoodPilot_scalarMean_sharp lemma idealGoodPilot_scalarMean_sharp {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (C : Real) (hC : 0 < C) (hcoeff : ∀ (m : Real), 0 < m → ∀ (d : Nat), 1 ≤ d → ∀ pilot, jacksonCoefficientBV epsilon m d pilot ≤ C * (∑ zeta : Cell, pilotRadius m d pilot zeta) * exp (12 * jacksonDegree d)) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : let m : Real := (n : Real) / 8 let R := sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j |∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P| ≤ (4 * C ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) * R + 32 * (3 * (1 + epsilon⁻¹) + 1) * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / m)) / (jacksonDegree d : Real) + R / (jacksonDegree d : Real) ^ 2) := by have hflat := flatGoodPilot_conditionalBias_integral_sharp epsilon he he' hn hd P C hC hcoeff j lambda hlambda exact idealGoodPilot_scalarMean_le_of_flat epsilon he hn (show 1 ≤ d by omega) P j lambda hlambda _ hflat
CausalSmith.Stat.DiscreteBudgetvalueCurve.idealGoodPilot_scalarMean_sharp · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:518
theorem logAlphabet_sq_mul_rpow_neg_three_sixteenths_le

Two logarithmic factors are absorbed by the negative power supplied by the factorial clipping term. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
hd :
16 ≤ d
logAlphabet d ^ 2 * (d : Real) ^ (-(3 / 16 : Real)) ≤ (35 / 3 : Real) ^ 2
Proof (Lean source)
-- @node: logAlphabet_sq_mul_rpow_neg_three_sixteenths_le lemma logAlphabet_sq_mul_rpow_neg_three_sixteenths_le {d : Nat} (hd : 16 ≤ d) : logAlphabet d ^ 2 * (d : Real) ^ (-(3 / 16 : Real)) ≤ (35 / 3 : Real) ^ 2 := by have hD : (1 : Real) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) have hD0 : (0 : Real) ≤ d := le_trans (by norm_num) hD have hDpos : (0 : Real) < d := lt_of_lt_of_le (by norm_num) hD let a : Real := 3 / 32 have ha : 0 < a := by dsimp [a]; norm_num have hp0 : 0 ≤ (d : Real) ^ (-a) := Real.rpow_nonneg hD0 _ have hp1 : (d : Real) ^ (-a) ≤ 1 := by simpa using Real.rpow_le_rpow_of_exponent_le hD (show -a ≤ 0 by dsimp [a]; norm_num) have hlog := Real.log_le_rpow_div hD0 ha have hmul : log d * (d : Real) ^ (-a) ≤ 32 / 3 := by calc _ ≤ ((d : Real) ^ a / a) * (d : Real) ^ (-a) := mul_le_mul_of_nonneg_right hlog hp0 _ = 32 / 3 := by rw [div_mul_eq_mul_div, ← Real.rpow_add hDpos] dsimp [a] norm_num have hsingle : logAlphabet d * (d : Real) ^ (-a) ≤ 35 / 3 := by rw [show logAlphabet d = 1 + log d by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) hDpos.ne', Real.log_exp]] nlinarith have hsingle0 : 0 ≤ logAlphabet d * (d : Real) ^ (-a) := by have hL : 0 ≤ logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) hDpos.ne', Real.log_exp] positivity positivity have hsq := (sq_le_sq₀ hsingle0 (by norm_num : (0 : Real) ≤ 35 / 3)).2 hsingle have hpEq : (d : Real) ^ (-(3 / 16 : Real)) = ((d : Real) ^ (-a)) ^ 2 := by rw [← Real.rpow_natCast, ← Real.rpow_mul hD0] dsimp [a] norm_num calc _ = (logAlphabet d * (d : Real) ^ (-a)) ^ 2 := by rw [hpEq, mul_pow] _ ≤ _ := hsq
CausalSmith.Stat.DiscreteBudgetvalueCurve.logAlphabet_sq_mul_rpow_neg_three_sixteenths_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:547
theorem badPilotCellScale_le_log_sq_mul_scalarRate

The cell scale is at most two logarithmic factors times the scalar target rate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
badPilotCellScale (n := n) P j
≤ logAlphabet d ^ 2 * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d))
Proof (Lean source)
-- @node: badPilotCellScale_le_log_sq_mul_scalarRate lemma badPilotCellScale_le_log_sq_mul_scalarRate {n d : Nat} (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) : badPilotCellScale (n := n) P j ≤ logAlphabet d ^ 2 * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d)) := by let m : Real := (n : Real) / 8 let L := logAlphabet d let q := cellMass P j have hm : 0 < m := by dsimp [m]; positivity have hL : 1 ≤ L := by dsimp [L] unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] exact le_add_of_nonneg_right (Real.log_nonneg (by exact_mod_cast hd)) have hq : 0 ≤ q := by dsimp [q] have hsum : ∑ z : Cell, cellVector P j z = cellMass P j := by rw [Fintype.sum_prod_type] simp_rw [Fin.sum_univ_two] simp [cellMass, cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring rw [← hsum] exact Finset.sum_nonneg fun z _ => by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have ha : 0 ≤ q * L / m := by positivity have hb : 0 ≤ q / (m * L) := by positivity have hsqa := Real.sq_sqrt ha have hsqb := Real.sq_sqrt hb have hsqrt : sqrt (q * L / m) ≤ L ^ 2 * sqrt (q / (m * L)) := by apply (sq_le_sq₀ (Real.sqrt_nonneg _) (by positivity)).mp rw [hsqa, mul_pow, hsqb] field_simp have hLsq : 1 ≤ L ^ 2 := by nlinarith [sq_nonneg (L - 1)] nlinarith [mul_nonneg hq (sub_nonneg.mpr hLsq)] unfold badPilotCellScale change sqrt (q * L / m) + L / m ≤ L ^ 2 * (sqrt (q / (m * L)) + 1 / (m * L)) calc _ ≤ L ^ 2 * sqrt (q / (m * L)) + L ^ 2 * (1 / (m * L)) := by apply add_le_add hsqrt field_simp exact le_rfl _ = _ := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilotCellScale_le_log_sq_mul_scalarRate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:592
theorem badPilot_exponential_mul_log_sq_le

The bad-pilot exponential envelope absorbs the two logarithmic factors needed to convert the cell scale to the scalar target rate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
hd :
16 ≤ d
(d : Real) ^ (1 / 4 : Real) * exp (-10 * logAlphabet d) * logAlphabet d ^ 2
≤ (35 / 3 : Real) ^ 2
Proof (Lean source)
-- @node: badPilot_exponential_mul_log_sq_le lemma badPilot_exponential_mul_log_sq_le {d : Nat} (hd : 16 ≤ d) : (d : Real) ^ (1 / 4 : Real) * exp (-10 * logAlphabet d) * logAlphabet d ^ 2 ≤ (35 / 3 : Real) ^ 2 := by have hD : (1 : Real) ≤ d := by exact_mod_cast (show 1 ≤ d by omega) have hDpos : (0 : Real) < d := lt_of_lt_of_le (by norm_num) hD have hL : logAlphabet d = 1 + log d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) hDpos.ne', Real.log_exp] have hexp : exp (-10 * logAlphabet d) ≤ (d : Real) ^ (-1 : Real) := by rw [Real.rpow_neg_one, ← Real.exp_log hDpos, ← Real.exp_neg] apply Real.exp_le_exp.mpr rw [hL] linarith [Real.log_nonneg hD] have hcoef0 : 0 ≤ (d : Real) ^ (1 / 4 : Real) * logAlphabet d ^ 2 := by positivity have hpow : (d : Real) ^ (1 / 4 : Real) * (d : Real) ^ (-1 : Real) = (d : Real) ^ (-(3 / 4 : Real)) := by rw [← Real.rpow_add hDpos] norm_num calc _ = ((d : Real) ^ (1 / 4 : Real) * logAlphabet d ^ 2) * exp (-10 * logAlphabet d) := by ring _ ≤ ((d : Real) ^ (1 / 4 : Real) * logAlphabet d ^ 2) * (d : Real) ^ (-1 : Real) := mul_le_mul_of_nonneg_left hexp hcoef0 _ = logAlphabet d ^ 2 * ((d : Real) ^ (1 / 4 : Real) * (d : Real) ^ (-1 : Real)) := by ring _ = logAlphabet d ^ 2 * (d : Real) ^ (-(3 / 4 : Real)) := by rw [hpow] _ ≤ logAlphabet d ^ 2 * (d : Real) ^ (-(3 / 16 : Real)) := by apply mul_le_mul_of_nonneg_left · exact Real.rpow_le_rpow_of_exponent_le hD (by norm_num) · positivity _ ≤ _ := logAlphabet_sq_mul_rpow_neg_three_sixteenths_le hd
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilot_exponential_mul_log_sq_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:643
theorem uncappedJacksonCellBias_le_goodMean_add_badEnvelope

Splitting the ideal scalar error by the pilot event bounds its bias by the absolute good mean plus the existing bad-pilot envelope. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
epsilon :
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
P :
j :
Fin d
lambda :
hlambda :
lambda ∈ Icc (0 : Real) 1
uncappedJacksonCellBias (n := n) epsilon lambda P j
≤ |∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P|
+ badPilotCellEnvelope (n := n) epsilon P j
Proof (Lean source)
-- @node: uncappedJacksonCellBias_le_goodMean_add_badEnvelope lemma uncappedJacksonCellBias_le_goodMean_add_badEnvelope {n d : Nat} (epsilon : Real) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (P : DiscreteLaw d) (j : Fin d) (lambda : Real) (hlambda : lambda ∈ Icc (0 : Real) 1) : uncappedJacksonCellBias (n := n) epsilon lambda P j ≤ |∫ counts, (if idealPilotGoodBool (n := n) P counts j then idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) else 0) ∂idealCountLaw (n := n) P| + badPilotCellEnvelope (n := n) epsilon P j := by classical let E := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => idealClippedCellPath (n := n) epsilon lambda counts j - thresholdFunReal epsilon lambda (cellVector P j) let G := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then E counts else 0 let B := fun counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) => if idealPilotGoodBool (n := n) P counts j then 0 else E counts letI : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P have hE := idealClippedCell_error_integrable epsilon he hn hd P j lambda hlambda have hG : Integrable G (idealCountLaw (n := n) P) := by let A := {counts : (Fin d → Cell → Nat) × (Fin d → Cell → Nat) | idealPilotGoodBool (n := n) P counts j = true} have hA : MeasurableSet A := MeasurableSet.of_discrete apply (hE.indicator hA).congr filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [G, E, A, indicator, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [G, E, A, indicator, hg'] have hB : Integrable B (idealCountLaw (n := n) P) := by exact (hE.sub hG).congr (Filter.Eventually.of_forall fun counts => by by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [E, G, B, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [E, G, B, hg']) have hstat : Integrable (fun counts => idealClippedCellPath (n := n) epsilon lambda counts j) (idealCountLaw (n := n) P) := by apply (hE.add (integrable_const (thresholdFunReal epsilon lambda (cellVector P j)))).congr filter_upwards [] with counts dsimp [E] ring have hbias : uncappedJacksonCellBias (n := n) epsilon lambda P j = |∫ counts, E counts ∂idealCountLaw (n := n) P| := by unfold uncappedJacksonCellBias expectedUncappedJacksonCell rw [integral_sub] · rw [integral_const] simp [idealClippedCellPath] · simpa [idealClippedCellPath] using hstat · exact integrable_const _ rw [hbias] have hsplit : (∫ counts, E counts ∂idealCountLaw (n := n) P) = (∫ counts, G counts ∂idealCountLaw (n := n) P) + ∫ counts, B counts ∂idealCountLaw (n := n) P := by rw [← integral_add hG hB] apply integral_congr_ae filter_upwards [] with counts by_cases hg : idealPilotGoodBool (n := n) P counts j = true · simp [E, G, B, hg] · have hg' := Bool.eq_false_of_not_eq_true hg simp [E, G, B, hg'] rw [hsplit] refine (abs_add_le _ _).trans ?_ exact add_le_add_right (idealBadPilot_scalarMean_le_envelope epsilon he hn hd P j lambda hlambda) _
CausalSmith.Stat.DiscreteBudgetvalueCurve.uncappedJacksonCellBias_le_goodMean_add_badEnvelope · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:678
theorem sharpBoundary_div_degree_le_scalarRate

The boundary square-root term divided by the Jackson degree has the frozen scalar rate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8))) / (jacksonDegree d : Real)
≤ (sqrt (8 * pilotRadiusConstant ^ 2) * 768) * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d))
Proof (Lean source)
-- @node: sharpBoundary_div_degree_le_scalarRate lemma sharpBoundary_div_degree_le_scalarRate {n d : Nat} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8))) / (jacksonDegree d : Real) ≤ (sqrt (8 * pilotRadiusConstant ^ 2) * 768) * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d)) := by let m : Real := (n : Real) / 8 let L := logAlphabet d let q := cellMass P j have hm : 0 < m := by dsimp [m]; positivity have hL : 0 < L := by dsimp [L] unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] positivity have hq : 0 ≤ q := by dsimp [q] exact le_trans ENNReal.toReal_nonneg (cellVector_le_cellMass P j ((0 : Fin 2), (0 : Fin 2))) have hA : 0 ≤ 8 * pilotRadiusConstant ^ 2 := by positivity have hqL : 0 ≤ q * L / m := by positivity have hqdiv : 0 ≤ q / (m * L) := by positivity have hsqrtq : sqrt (q * L / m) = L * sqrt (q / (m * L)) := by have ha := Real.sq_sqrt hqL have hb := Real.sq_sqrt hqdiv have hr : (L * sqrt (q / (m * L))) ^ 2 = q * L / m := by rw [mul_pow, hb] field_simp exact (sq_eq_sq₀ (Real.sqrt_nonneg _) (by positivity)).mp (ha.trans hr.symm) have hsqrtA : sqrt ((8 * pilotRadiusConstant ^ 2) * (q * L / m)) = sqrt (8 * pilotRadiusConstant ^ 2) * sqrt (q * L / m) := by rw [Real.sqrt_mul hA] have hK : (0 : Real) < jacksonDegree d := by exact_mod_cast (show 0 < jacksonDegree d by simp [jacksonDegree]) have hLK := logAlphabet_div_jacksonDegree_le (d := d) dsimp [m, L, q] at hsqrtA hsqrtq ⊢ rw [show 8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8)) = (8 * pilotRadiusConstant ^ 2) * (cellMass P j * logAlphabet d / ((n : Real) / 8)) by ring] rw [hsqrtA, hsqrtq] have hmain : L / (jacksonDegree d : Real) * sqrt (q / (m * L)) ≤ 768 * sqrt (q / (m * L)) := mul_le_mul_of_nonneg_right hLK (Real.sqrt_nonneg _) have htarget0 : 0 ≤ 1 / (m * L) := by positivity have hmain' := mul_le_mul_of_nonneg_left hmain (Real.sqrt_nonneg (8 * pilotRadiusConstant ^ 2)) calc sqrt (8 * pilotRadiusConstant ^ 2) * (L * sqrt (q / (m * L))) / (jacksonDegree d : Real) = sqrt (8 * pilotRadiusConstant ^ 2) * ((L / (jacksonDegree d : Real)) * sqrt (q / (m * L))) := by ring _ ≤ sqrt (8 * pilotRadiusConstant ^ 2) * (768 * sqrt (q / (m * L))) := hmain' _ ≤ _ := by have hs : sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) ≤ sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d) := by dsimp [m, L] at htarget0 exact le_add_of_nonneg_right htarget0 simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hs (mul_nonneg (Real.sqrt_nonneg _) (by norm_num : (0 : Real) ≤ 768))
CausalSmith.Stat.DiscreteBudgetvalueCurve.sharpBoundary_div_degree_le_scalarRate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:750
theorem badPilotCellScale_div_degree_sq_le_scalarRate

The second-order radius term divided by the squared Jackson degree also has the frozen scalar rate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
hn :
1 ≤ n
hd :
16 ≤ d
P :
j :
Fin d
badPilotCellScale (n := n) P j / (jacksonDegree d : Real) ^ 2
≤ 768 ^ 2 * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d))
Proof (Lean source)
-- @node: badPilotCellScale_div_degree_sq_le_scalarRate lemma badPilotCellScale_div_degree_sq_le_scalarRate {n d : Nat} (hn : 1 ≤ n) (hd : 16 ≤ d) (P : DiscreteLaw d) (j : Fin d) : badPilotCellScale (n := n) P j / (jacksonDegree d : Real) ^ 2 ≤ 768 ^ 2 * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d)) := by have hs := badPilotCellScale_le_log_sq_mul_scalarRate hn (show 1 ≤ d by omega) P j have hLK := logAlphabet_div_jacksonDegree_le (d := d) have hK : (0 : Real) < jacksonDegree d := by exact_mod_cast (show 0 < jacksonDegree d by simp [jacksonDegree]) have hL : 0 ≤ logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] positivity have hsq : logAlphabet d ^ 2 / (jacksonDegree d : Real) ^ 2 ≤ 768 ^ 2 := by rw [show logAlphabet d ^ 2 / (jacksonDegree d : Real) ^ 2 = (logAlphabet d / (jacksonDegree d : Real)) ^ 2 by ring] exact (sq_le_sq₀ (div_nonneg hL hK.le) (by norm_num)).2 hLK have hT : 0 ≤ sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d) := by positivity calc _ ≤ (logAlphabet d ^ 2 * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d))) / (jacksonDegree d : Real) ^ 2 := div_le_div_of_nonneg_right hs (sq_nonneg _) _ = (logAlphabet d ^ 2 / (jacksonDegree d : Real) ^ 2) * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d)) := by ring _ ≤ _ := mul_le_mul_of_nonneg_right hsq hT
CausalSmith.Stat.DiscreteBudgetvalueCurve.badPilotCellScale_div_degree_sq_le_scalarRate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:822
theorem uncappedJacksonCellBias_le_rate

A single epsilon-dependent constant controls the uncapped scalar cell bias at the paper's square-root rate. With the specified inputs and conditions, the stated relationship holds.

Formal statement
epsilon :
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : Real,
0 < C
conclusion 1
n d :
1 ≤ n
16 ≤ d
P :
j :
Fin d
lambda :
lambda ∈ Icc (0 : Real) 1
uncappedJacksonCellBias (n := n) epsilon lambda P j
≤ C * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d))
Proof (Lean source)
-- @node: uncappedJacksonCellBias_le_rate lemma uncappedJacksonCellBias_le_rate (epsilon : Real) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : Real, 0 < C ∧ ∀ {n d : Nat}, 1 ≤ n → 16 ≤ d → ∀ (P : DiscreteLaw d) (j : Fin d) (lambda : Real), lambda ∈ Icc (0 : Real) 1 → uncappedJacksonCellBias (n := n) epsilon lambda P j ≤ C * (sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d)) := by obtain ⟨C₀, hC₀, hcoeff⟩ := jacksonCoefficientBV_pilot_le epsilon he he' obtain ⟨Cb, hCb, hbad⟩ := badPilotCellEnvelope_le epsilon he let A : Real := 32 * (3 * (1 + epsilon⁻¹) + 1) let R₀ : Real := sqrt 32 * pilotRadiusConstant let M : Real := (35 / 3 : Real) ^ 2 let C : Real := 4 * C₀ ^ 2 * exp 123 * R₀ * M + A * (4 * (sqrt (8 * pilotRadiusConstant ^ 2) * 768) + R₀ * 768 ^ 2) + Cb * M + 1 have hA : 0 ≤ A := by dsimp [A]; positivity have hR₀ : 0 ≤ R₀ := by dsimp [R₀] unfold pilotRadiusConstant positivity have hM : 0 ≤ M := by dsimp [M]; positivity have hC : 0 < C := by dsimp [C, A, R₀, M]; positivity refine ⟨C, hC, ?_⟩ intro n d hn hd P j lambda hlambda let T : Real := sqrt (cellMass P j / (((n : Real) / 8) * logAlphabet d)) + 1 / (((n : Real) / 8) * logAlphabet d) have hL : 0 < logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] positivity have hT : 0 ≤ T := by dsimp [T] exact add_nonneg (Real.sqrt_nonneg _) (by positivity) have hsplit := uncappedJacksonCellBias_le_goodMean_add_badEnvelope epsilon he hn (show 1 ≤ d by omega) P j lambda hlambda have hgood := idealGoodPilot_scalarMean_sharp epsilon he he' hn hd P C₀ hC₀ hcoeff j lambda hlambda have hs := badPilotCellScale_le_log_sq_mul_scalarRate hn (show 1 ≤ d by omega) P j have hp := logAlphabet_sq_mul_rpow_neg_three_sixteenths_le hd have hpow : (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) = (d : Real) ^ (-(3 / 16 : Real)) := by rw [div_eq_mul_inv, ← Real.rpow_neg (by positivity : (0 : Real) ≤ d), ← Real.rpow_add (by positivity : (0 : Real) < d)] norm_num have hfirst : (4 * C₀ ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) * (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) ≤ (4 * C₀ ^ 2 * exp 123 * R₀ * M) * T := by rw [show 4 * C₀ ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real) = 4 * C₀ ^ 2 * exp 123 * ((d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) by ring, hpow] have hx : logAlphabet d ^ 2 * (d : Real) ^ (-(3 / 16 : Real)) ≤ M := by simpa [M] using hp have hscaled : (d : Real) ^ (-(3 / 16 : Real)) * badPilotCellScale (n := n) P j ≤ M * T := by calc _ ≤ (d : Real) ^ (-(3 / 16 : Real)) * (logAlphabet d ^ 2 * T) := mul_le_mul_of_nonneg_left hs (Real.rpow_nonneg (by positivity) _) _ = (logAlphabet d ^ 2 * (d : Real) ^ (-(3 / 16 : Real))) * T := by ring _ ≤ M * T := mul_le_mul_of_nonneg_right hx hT have hQ : 0 ≤ 4 * C₀ ^ 2 * exp 123 * R₀ := by positivity calc _ = (4 * C₀ ^ 2 * exp 123 * R₀) * ((d : Real) ^ (-(3 / 16 : Real)) * badPilotCellScale (n := n) P j) := by simp [R₀]; ring _ ≤ (4 * C₀ ^ 2 * exp 123 * R₀) * (M * T) := mul_le_mul_of_nonneg_left hscaled hQ _ = _ := by ring have hsqrt := sharpBoundary_div_degree_le_scalarRate hn hd P j have hradius := badPilotCellScale_div_degree_sq_le_scalarRate hn hd P j have hboundary : A * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8))) / (jacksonDegree d : Real) + (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) / (jacksonDegree d : Real) ^ 2) ≤ A * (4 * (sqrt (8 * pilotRadiusConstant ^ 2) * 768) + R₀ * 768 ^ 2) * T := by have hrad : (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) / (jacksonDegree d : Real) ^ 2 ≤ (R₀ * 768 ^ 2) * T := by calc _ = R₀ * (badPilotCellScale (n := n) P j / (jacksonDegree d : Real) ^ 2) := by simp [R₀]; ring _ ≤ R₀ * (768 ^ 2 * T) := by gcongr _ = _ := by ring calc _ ≤ A * ((4 * (sqrt (8 * pilotRadiusConstant ^ 2) * 768) + R₀ * 768 ^ 2) * T) := by apply mul_le_mul_of_nonneg_left _ hA have hsqrt4 := mul_le_mul_of_nonneg_left hsqrt (by norm_num : (0 : Real) ≤ 4) calc _ = 4 * (sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8))) / (jacksonDegree d : Real)) + (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) / (jacksonDegree d : Real) ^ 2 := by ring _ ≤ 4 * ((sqrt (8 * pilotRadiusConstant ^ 2) * 768) * T) + (R₀ * 768 ^ 2) * T := add_le_add hsqrt4 hrad _ = (4 * (sqrt (8 * pilotRadiusConstant ^ 2) * 768) + R₀ * 768 ^ 2) * T := by ring _ = _ := by ring have hbad0 := hbad hn (show 1 ≤ d by omega) P j have hbadRate : badPilotCellEnvelope (n := n) epsilon P j ≤ Cb * M * T := by calc _ ≤ Cb * (d : Real) ^ (1 / 4 : Real) * exp (-10 * logAlphabet d) * badPilotCellScale (n := n) P j := hbad0 _ ≤ Cb * (d : Real) ^ (1 / 4 : Real) * exp (-10 * logAlphabet d) * (logAlphabet d ^ 2 * T) := by gcongr _ = Cb * ((d : Real) ^ (1 / 4 : Real) * exp (-10 * logAlphabet d) * logAlphabet d ^ 2) * T := by ring _ ≤ Cb * M * T := by gcongr simpa [M] using badPilot_exponential_mul_log_sq_le hd dsimp only at hgood calc _ ≤ _ := hsplit _ ≤ ((4 * C₀ ^ 2 * exp 123 * (d : Real) ^ (1 / 16 : Real) / (d : Real) ^ (1 / 4 : Real)) * (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) + A * (4 * sqrt (8 * pilotRadiusConstant ^ 2 * cellMass P j * (logAlphabet d / ((n : Real) / 8))) / (jacksonDegree d : Real) + (sqrt 32 * pilotRadiusConstant * badPilotCellScale (n := n) P j) / (jacksonDegree d : Real) ^ 2)) + badPilotCellEnvelope (n := n) epsilon P j := by simpa [A] using add_le_add hgood (le_refl (badPilotCellEnvelope (n := n) epsilon P j)) _ ≤ (4 * C₀ ^ 2 * exp 123 * R₀ * M) * T + A * (4 * (sqrt (8 * pilotRadiusConstant ^ 2) * 768) + R₀ * 768 ^ 2) * T + Cb * M * T := by gcongr _ ≤ C * T := by dsimp [C]; nlinarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.uncappedJacksonCellBias_le_rate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/ScalarBiasSharp.lean:856
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.SmallCapacityLower 1 declarations A two-cell parametric lower bound inside the capacity-active paired family.

A two-cell parametric lower bound inside the capacity-active paired family.

theorem small_capacity_lower_padded

On every alphabet containing two cells, a binary paired submodel gives a uniform parametric capacity-active lower bound. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
2 ≤ d
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
mu :
PotentialLaw d → Measure (Fin n → Obs d)
hmu :
∀ Q, IidSampling (observedMarginal Q) (mu Q)
T :
{f : (Fin n → Obs d) → ℝ // Measurable f}
∃ Q : PotentialLaw d,
conclusion 1
Q ∈ capacityHardClass d epsilon
conclusion 2
1 / (4096 * (n : ℝ)) ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2))
Proof (Lean source)
-- @node: small_capacity_lower_padded lemma small_capacity_lower_padded {n d : ℕ} (hn : 1 ≤ n) (hd : 2 ≤ d) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (mu : PotentialLaw d → Measure (Fin n → Obs d)) (hmu : ∀ Q, IidSampling (observedMarginal Q) (mu Q)) (T : {f : (Fin n → Obs d) → ℝ // Measurable f}) : ∃ Q : PotentialLaw d, Q ∈ capacityHardClass d epsilon ∧ 1 / (4096 * (n : ℝ)) ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2)) := by let t : ℝ := 1 / (8 * sqrt n) have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hsqrt : 1 ≤ sqrt (n : ℝ) := Real.one_le_sqrt.mpr (by exact_mod_cast hn) have ht0 : 0 ≤ t := by dsimp [t]; positivity have ht8 : t ≤ 1 / 8 := by dsimp [t] apply (div_le_iff₀ (by positivity : 0 < 8 * sqrt (n : ℝ))).2 nlinarith have ht : t ∈ Icc (-1/8 : ℝ) (1/8) := ⟨by linarith, ht8⟩ have htsq : t ^ 2 = 1 / (64 * (n : ℝ)) := by dsimp [t] rw [div_pow, mul_pow, Real.sq_sqrt hnR.le] ring let Q0 : PotentialLaw 2 := pairedLaw singletonSimplex (singletonContrast 0 (by norm_num)) let Qt : PotentialLaw 2 := pairedLaw singletonSimplex (singletonContrast t ht) have hQ0 : Q0 ∈ capacityHardClass 2 epsilon := by have hc := pairedLaw_completion singletonSimplex (singletonContrast 0 (by norm_num)) obtain ⟨hm, heff, hbind, _, hvone, _⟩ := (paired_capacity_identity 1 (by omega) epsilon he he').1 Q0 ⟨singletonSimplex, singletonContrast 0 (by norm_num), hc⟩ singletonSimplex (singletonContrast 0 (by norm_num)) hc exact ⟨hm, hvone, heff, hbind⟩ have hQt : Qt ∈ capacityHardClass 2 epsilon := by have hc := pairedLaw_completion singletonSimplex (singletonContrast t ht) obtain ⟨hm, heff, hbind, _, hvone, _⟩ := (paired_capacity_identity 1 (by omega) epsilon he he').1 Qt ⟨singletonSimplex, singletonContrast t ht, hc⟩ singletonSimplex (singletonContrast t ht) hc exact ⟨hm, hvone, heff, hbind⟩ have hv0 : budgetValue Q0 (1 / 2) = 3 / 8 := by have hb := (pairedCompletion_bindingValue Q0 singletonSimplex (singletonContrast 0 (by norm_num)) (pairedLaw_completion _ _) epsilon he he' (by omega)).2.1 simpa [singletonSimplex, singletonContrast] using hb have hvt : budgetValue Qt (1 / 2) = 3 / 8 + t / 2 := by have hb := (pairedCompletion_bindingValue Qt singletonSimplex (singletonContrast t ht) (pairedLaw_completion _ _) epsilon he he' (by omega)).2.1 convert hb using 1 <;> simp [singletonSimplex, singletonContrast, abs_of_nonneg ht0] <;> ring let Q0d := padPotentialLaw hd Q0 let Qtd := padPotentialLaw hd Qt let Td : (Fin n → Obs 2) → ℝ := fun z => T.1 (fun i => padCausalObs hd (z i)) have htv : tvDist (productLaw (observedMarginal Q0) n) (productLaw (observedMarginal Qt) n) ≤ 1 / 2 := by apply pairedOne_product_tv_le_half hn t ht rw [htsq] have hlog : (1 / 32 : ℝ) ≤ log 2 := le_trans (by norm_num) (le_of_lt Real.log_two_gt_d9) convert hlog using 1 <;> field_simp <;> ring have hsep : 2 * (t / 4) ≤ |budgetValue Q0 (1 / 2) - budgetValue Qt (1 / 2)| := by rw [hv0, hvt] rw [show (3 / 8 : ℝ) - (3 / 8 + t / 2) = -(t / 2) by ring, abs_neg, abs_of_nonneg (div_nonneg ht0 (by norm_num))] ring_nf exact le_rfl have hprob := two_point_lower_bound_of_tvDist_le (P₀ := productLaw (observedMarginal Q0) n) (P₁ := productLaw (observedMarginal Qt) n) (est := Td) (θ₀ := budgetValue Q0 (1 / 2)) (θ₁ := budgetValue Qt (1 / 2)) (s := t / 4) (c := (1 / 2 : ℝ)) (measurable_of_finite _) hsep htv have hrisk (Q : PotentialLaw 2) : (t / 4) ^ 2 * (productLaw (observedMarginal Q) n).real {z | t / 4 ≤ |Td z - budgetValue Q (1 / 2)|} ≤ sqRisk (productLaw (observedMarginal Q) n) Td (budgetValue Q (1 / 2)) := by unfold sqRisk have hm := mul_meas_ge_le_integral_of_nonneg (μ := productLaw (observedMarginal Q) n) (f := fun z => (Td z - budgetValue Q (1 / 2)) ^ 2) (ae_of_all _ (fun z => sq_nonneg _)) Integrable.of_finite ((t / 4) ^ 2) have hevent : {z | t / 4 ≤ |Td z - budgetValue Q (1 / 2)|} = {z | (t / 4) ^ 2 ≤ (Td z - budgetValue Q (1 / 2)) ^ 2} := by ext z simpa [sq_abs] using (sq_le_sq₀ (by positivity : 0 ≤ t / 4) (abs_nonneg (Td z - budgetValue Q (1 / 2)))).symm rw [hevent] exact hm have hmax : 1 / (4096 * (n : ℝ)) ≤ max (sqRisk (productLaw (observedMarginal Q0) n) Td (budgetValue Q0 (1/2))) (sqRisk (productLaw (observedMarginal Qt) n) Td (budgetValue Qt (1/2))) := by have hp : (1 / 4 : ℝ) ≤ max ((productLaw (observedMarginal Q0) n).real {z | t / 4 ≤ |Td z - budgetValue Q0 (1/2)|}) ((productLaw (observedMarginal Qt) n).real {z | t / 4 ≤ |Td z - budgetValue Qt (1/2)|}) := by norm_num at hprob ⊢ exact hprob calc 1 / (4096 * (n : ℝ)) = (t / 4) ^ 2 * (1 / 4) := by rw [show (t / 4) ^ 2 * (1 / 4) = t ^ 2 / 64 by ring, htsq] field_simp norm_num _ ≤ (t / 4) ^ 2 * max _ _ := by gcongr _ = max ((t / 4) ^ 2 * _) ((t / 4) ^ 2 * _) := by rw [mul_max_of_nonneg _ _ (sq_nonneg (t / 4))] _ ≤ _ := max_le_max (hrisk Q0) (hrisk Qt) rcases le_max_iff.mp hmax with hcase | hcase · refine ⟨Q0d, padPotentialLaw_capacityHardClass (by omega) hd hQ0, ?_⟩ rw [hmu Q0d] exact hcase.trans_eq (sqRisk_padPotentialLaw hd Q0 T.1 T.2) · refine ⟨Qtd, padPotentialLaw_capacityHardClass (by omega) hd hQt, ?_⟩ rw [hmu Qtd] exact hcase.trans_eq (sqRisk_padPotentialLaw hd Qt T.1 T.2)
CausalSmith.Stat.DiscreteBudgetvalueCurve.small_capacity_lower_padded · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/SmallCapacityLower.lean:141
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.TwoSampleL1 23 declarations The fixed two-sample L1 reduction conditional on the cited known-reference gate.

The fixed two-sample L1 reduction conditional on the cited known-reference gate.

def twoSampleLaw

Product law of two independent fixed samples.

Definition (Lean source)
k :
ℕ
n :
ℕ
RS :
ProbabilitySimplex k × ProbabilitySimplex k
twoSampleLaw n RS :
Measure ((Fin n → Fin k) × (Fin n → Fin k))
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleLaw · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:18
def TwoSampleEstimator

Every measurable real-valued statistic of the paired samples.

Definition (Lean source)
n k :
ℕ
TwoSampleEstimator n k :
Type
CausalSmith.Stat.DiscreteBudgetvalueCurve.TwoSampleEstimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:24
def twoSampleL1Risk

Squared risk in the normalized two-sample L1 experiment.

Definition (Lean source)
k :
ℕ
n :
ℕ
est :
TwoSampleEstimator n k
RS :
ProbabilitySimplex k × ProbabilitySimplex k
twoSampleL1Risk n est RS :
ℝ
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1Risk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:28
def twoSampleL1MinimaxRisk

The exact fixed two-sample minimax risk.

Definition (Lean source)
n k :
ℕ
twoSampleL1MinimaxRisk n k :
ℝ
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1MinimaxRisk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:34

Atom probabilities of the two independent fixed samples factor coordinatewise. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
n :
ℕ
R S :
ProbabilitySimplex k
x :
(Fin n → Fin k) × (Fin n → Fin k)
twoSampleLaw n (R, S) {x}
= (∏ t : Fin n, (simplexPMF R) (x.1 t)) * (∏ t : Fin n, (simplexPMF S) (x.2 t))
Proof (Lean source)
-- @node: twoSampleLaw_singleton lemma twoSampleLaw_singleton {k : ℕ} (n : ℕ) (R S : ProbabilitySimplex k) (x : (Fin n → Fin k) × (Fin n → Fin k)) : twoSampleLaw n (R, S) {x} = (∏ t : Fin n, (simplexPMF R) (x.1 t)) * (∏ t : Fin n, (simplexPMF S) (x.2 t)) := twoSampleLaw_singleton n R S x
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleLaw_singleton · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:38
theorem twoSampleL1_conditional_jensen Lemma twoSampleL1_conditional_jensen in the paper ↗

Conditional Jensen for the known-reference reduction: averaging over the second sample cannot increase squared loss at a fixed first sample. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n :
ℕ
S :
ProbabilitySimplex k
est :
TwoSampleEstimator n k
x :
Fin n → Fin k
target :
ℝ
(∫ y, est.1 (x, y) ∂simplexSampleLaw S n - target) ^ 2
≤ ∫ y, (est.1 (x, y) - target) ^ 2 ∂simplexSampleLaw S n
Proof (Lean source)
-- @node: twoSampleL1_conditional_jensen lemma twoSampleL1_conditional_jensen {k n : ℕ} (S : ProbabilitySimplex k) (est : TwoSampleEstimator n k) (x : Fin n → Fin k) (target : ℝ) : (∫ y, est.1 (x, y) ∂simplexSampleLaw S n - target) ^ 2 ≤ ∫ y, (est.1 (x, y) - target) ^ 2 ∂simplexSampleLaw S n := by let μ := simplexSampleLaw S n have hprob : IsProbabilityMeasure μ := by dsimp [μ, simplexSampleLaw] infer_instance let : IsProbabilityMeasure μ := hprob have hfun : Integrable (fun y => est.1 (x, y) - target) μ := Integrable.of_finite have hsq : Integrable (fun y => (est.1 (x, y) - target) ^ 2) μ := Integrable.of_finite have h := (Even.convexOn_pow (show Even (2 : ℕ) by decide) : ConvexOn ℝ univ (fun t : ℝ => t ^ 2)).map_integral_le (by fun_prop) isClosed_univ (by simp) hfun hsq have hshift : (∫ y, est.1 (x, y) - target ∂μ) = (∫ y, est.1 (x, y) ∂μ) - target := by rw [integral_sub Integrable.of_finite Integrable.of_finite] simp rw [hshift] at h exact h
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_conditional_jensen · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:48
theorem twoSampleL1_conditional_risk_le Lemma twoSampleL1_conditional_risk_le in the paper ↗

Integrating conditional Jensen gives the risk comparison used when the reference distribution is revealed to the estimator. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n :
ℕ
R S :
ProbabilitySimplex k
est :
TwoSampleEstimator n k
knownL1Risk n S ⟨fun x
=> ∫ y, est.1 (x, y) ∂simplexSampleLaw S n, measurable_of_finite _⟩ R ≤ twoSampleL1Risk n est (R, S)
Proof (Lean source)
-- @node: twoSampleL1_conditional_risk_le lemma twoSampleL1_conditional_risk_le {k n : ℕ} (R S : ProbabilitySimplex k) (est : TwoSampleEstimator n k) : knownL1Risk n S ⟨fun x => ∫ y, est.1 (x, y) ∂simplexSampleLaw S n, measurable_of_finite _⟩ R ≤ twoSampleL1Risk n est (R, S) := by let μ := simplexSampleLaw R n let ν := simplexSampleLaw S n let : IsProbabilityMeasure μ := by dsimp [μ, simplexSampleLaw] infer_instance let : IsProbabilityMeasure ν := by dsimp [ν, simplexSampleLaw] infer_instance have hleft : Integrable (fun x => (∫ y, est.1 (x, y) ∂ν - simplexL1 R S) ^ 2) μ := Integrable.of_finite have hright : Integrable (fun x => ∫ y, (est.1 (x, y) - simplexL1 R S) ^ 2 ∂ν) μ := Integrable.of_finite have hmono : (∫ x, (∫ y, est.1 (x, y) ∂ν - simplexL1 R S) ^ 2 ∂μ) ≤ ∫ x, ∫ y, (est.1 (x, y) - simplexL1 R S) ^ 2 ∂ν ∂μ := by exact integral_mono hleft hright (fun x => twoSampleL1_conditional_jensen S est x (simplexL1 R S)) change (∫ x, (∫ y, est.1 (x, y) ∂ν - simplexL1 R S) ^ 2 ∂μ) ≤ ∫ z, (est.1 z - simplexL1 R S) ^ 2 ∂μ.prod ν rw [integral_prod _ (Integrable.of_finite : Integrable (fun z : (Fin n → Fin k) × (Fin n → Fin k) => (est.1 z - simplexL1 R S) ^ 2) (μ.prod ν))] exact hmono
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_conditional_risk_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:74

At each fixed reference distribution, the two-sample worst-case risk dominates the known-reference minimax risk. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n :
ℕ
S :
ProbabilitySimplex k
Proof (Lean source)
-- @node: knownL1_worst_bddBelow lemma knownL1_worst_bddBelow {k n : ℕ} (S : ProbabilitySimplex k) : BddBelow (range (fun e : KnownL1Estimator n k => worstCaseRiskReal (knownL1Risk n S) e)) := by refine ⟨0, ?_⟩ rintro _ ⟨e, rfl⟩ apply Real.iSup_nonneg intro R exact integral_nonneg (fun z => sq_nonneg _)
CausalSmith.Stat.DiscreteBudgetvalueCurve.knownL1_worst_bddBelow · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:108
theorem twoSampleL1Risk_bddAbove_all Lemma twoSampleL1Risk_bddAbove_all in the paper ↗

The two sample l1 risk bdd above all result. It proves the stated conclusion.

Formal statement
k n :
ℕ
est :
TwoSampleEstimator n k
BddAbove (range (twoSampleL1Risk n est))
Proof (Lean source)
lemma twoSampleL1Risk_bddAbove_all {k n : ℕ} [NeZero k] (est : TwoSampleEstimator n k) : BddAbove (range (twoSampleL1Risk n est)) := by obtain ⟨M, hM⟩ := Finite.bddAbove_range (fun z : (Fin n → Fin k) × (Fin n → Fin k) => |est.1 z|) have hM0 : 0 ≤ M := by let z : (Fin n → Fin k) × (Fin n → Fin k) := (fun _ => 0, fun _ => 0) exact (abs_nonneg (est.1 z)).trans (hM ⟨z, rfl⟩) refine ⟨(M + 2) ^ 2, ?_⟩ rintro _ ⟨⟨R, S⟩, rfl⟩ let : IsProbabilityMeasure (twoSampleLaw n (R, S)) := by infer_instance have hpoint (z : (Fin n → Fin k) × (Fin n → Fin k)) : (est.1 z - simplexL1 R S) ^ 2 ≤ (M + 2) ^ 2 := by have ht := simplexL1_nonneg_le_two R S have he : |est.1 z| ≤ M := hM ⟨z, rfl⟩ have habs : |est.1 z - simplexL1 R S| ≤ M + 2 := by calc _ ≤ |est.1 z| + |simplexL1 R S| := by simpa using abs_sub_le (est.1 z) 0 (simplexL1 R S) _ ≤ M + 2 := by rw [abs_of_nonneg ht.1]; linarith have hs : |est.1 z - simplexL1 R S| ^ 2 ≤ (M + 2) ^ 2 := (sq_le_sq₀ (abs_nonneg _) (by linarith)).mpr habs simpa only [sq_abs] using hs have hi := integral_mono (Integrable.of_finite : Integrable (fun z : (Fin n → Fin k) × (Fin n → Fin k) => (est.1 z - simplexL1 R S) ^ 2) (twoSampleLaw n (R, S))) (integrable_const ((M + 2) ^ 2)) hpoint simpa [twoSampleL1Risk] using hi
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1Risk_bddAbove_all · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:121
theorem twoSampleL1Risk_bddAbove_fixed Lemma twoSampleL1Risk_bddAbove_fixed in the paper ↗

The two sample l1 risk bdd above fixed result. It proves the stated conclusion.

Formal statement
k n :
ℕ
S :
ProbabilitySimplex k
est :
TwoSampleEstimator n k
BddAbove (range (fun R : ProbabilitySimplex k => twoSampleL1Risk n est (R, S)))
Proof (Lean source)
lemma twoSampleL1Risk_bddAbove_fixed {k n : ℕ} [NeZero k] (S : ProbabilitySimplex k) (est : TwoSampleEstimator n k) : BddAbove (range (fun R : ProbabilitySimplex k => twoSampleL1Risk n est (R, S))) := by obtain ⟨M, hM⟩ := twoSampleL1Risk_bddAbove_all est refine ⟨M, ?_⟩ rintro _ ⟨R, rfl⟩ exact hM ⟨(R, S), rfl⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1Risk_bddAbove_fixed · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:155
theorem twoSampleL1_known_reference_le Lemma twoSampleL1_known_reference_le in the paper ↗

The two sample l1 known reference le result. It proves the stated conclusion.

Formal statement
k n :
ℕ
Nonempty (ProbabilitySimplex k)
S :
ProbabilitySimplex k
est :
TwoSampleEstimator n k
≤ ⨆ R : ProbabilitySimplex k, twoSampleL1Risk n est (R, S)
Proof (Lean source)
lemma twoSampleL1_known_reference_le {k n : ℕ} [Nonempty (ProbabilitySimplex k)] [NeZero k] (S : ProbabilitySimplex k) (est : TwoSampleEstimator n k) : minimaxValueReal (knownL1Risk n S) ≤ ⨆ R : ProbabilitySimplex k, twoSampleL1Risk n est (R, S) := by let e : KnownL1Estimator n k := ⟨fun x => ∫ y, est.1 (x, y) ∂simplexSampleLaw S n, measurable_of_finite _⟩ have hmin : minimaxValueReal (knownL1Risk n S) ≤ worstCaseRiskReal (knownL1Risk n S) e := by exact ciInf_le (knownL1_worst_bddBelow S) e have hmax : worstCaseRiskReal (knownL1Risk n S) e ≤ ⨆ R : ProbabilitySimplex k, twoSampleL1Risk n est (R, S) := by apply ciSup_le intro R exact (twoSampleL1_conditional_risk_le R S est).trans (le_ciSup (twoSampleL1Risk_bddAbove_fixed S est) R) exact hmin.trans hmax
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_known_reference_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:166
theorem twoSampleL1_known_minimax_le Lemma twoSampleL1_known_minimax_le in the paper ↗

The fixed-reference minimax lower bound transfers to the experiment where both distributions are sampled and unknown. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n :
ℕ
Nonempty (ProbabilitySimplex k)
sSup (range (fun S : ProbabilitySimplex k => minimaxValueReal (knownL1Risk n S)))
≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_known_minimax_le lemma twoSampleL1_known_minimax_le {k n : ℕ} [Nonempty (ProbabilitySimplex k)] [NeZero k] : sSup (range (fun S : ProbabilitySimplex k => minimaxValueReal (knownL1Risk n S))) ≤ twoSampleL1MinimaxRisk n k := by let : Nonempty (TwoSampleEstimator n k) := ⟨⟨fun _ => 0, measurable_const⟩⟩ unfold twoSampleL1MinimaxRisk unfold twoSampleL1MinimaxRisk minimaxValueReal apply le_ciInf intro est change sSup (range (fun S : ProbabilitySimplex k => minimaxValueReal (knownL1Risk n S))) ≤ ⨆ RS, twoSampleL1Risk n est RS apply csSup_le (Set.range_nonempty _) rintro _ ⟨S, rfl⟩ calc minimaxValueReal (knownL1Risk n S) ≤ ⨆ R : ProbabilitySimplex k, twoSampleL1Risk n est (R, S) := twoSampleL1_known_reference_le S est _ ≤ ⨆ RS : ProbabilitySimplex k × ProbabilitySimplex k, twoSampleL1Risk n est RS := by apply ciSup_le intro R exact le_ciSup (twoSampleL1Risk_bddAbove_all est) (R, S)
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_known_minimax_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:186
theorem twoSampleL1_lower_in_cited_regime

The known-reference cited bound applies unchanged to two fixed samples through conditional averaging over the reference sample. With the specified inputs and conditions, the stated relationship holds.

Formal statement
a0 C0 :
ℝ
ha0 :
0 < a0
∃ c : ℝ,
conclusion 1
0 < c
conclusion 2
∃ k0 : ℕ,
∀ k n : ℕ,
k0
≤ k → a0 * k / log k ≤ n → log n ≤ C0 * log k → c * k / (n * log n) ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_lower_in_cited_regime lemma twoSampleL1_lower_in_cited_regime (of_gate : JHWKnownQL1LowerRegime) (a0 C0 : ℝ) (ha0 : 0 < a0) : ∃ c : ℝ, 0 < c ∧ ∃ k0 : ℕ, ∀ k n : ℕ, k0 ≤ k → a0 * k / log k ≤ n → log n ≤ C0 * log k → c * k / (n * log n) ≤ twoSampleL1MinimaxRisk n k := by obtain ⟨c, hc, k0, hk0⟩ := of_gate a0 C0 ha0 refine ⟨c, hc, max k0 2, ?_⟩ intro k n hk hsample hlog have hk0' : k0 ≤ k := le_trans (le_max_left _ _) hk have hk2 : 2 ≤ k := le_trans (le_max_right _ _) hk haveI : NeZero k := ⟨by omega⟩ haveI : Nonempty (ProbabilitySimplex k) := by let R : ProbabilitySimplex k := ⟨fun i => if i = 0 then 1 else 0, by constructor · intro i change 0 ≤ (if i = 0 then (1 : ℝ) else 0) split_ifs <;> norm_num · simp⟩ exact ⟨R⟩ exact (hk0 k n hk0' hsample hlog).trans twoSampleL1_known_minimax_le
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_lower_in_cited_regime · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:216
theorem twoSampleL1_lower_dense_logAlphabet

The cited dense-regime bound with the alphabet logarithm used by the two-sample theorem. With the specified inputs and conditions, the stated relationship holds.

Formal statement
∃ c : ℝ,
conclusion 1
0 < c
conclusion 2
∃ k0 : ℕ,
∀ k n : ℕ,
k0
≤ k → 2 ≤ k → 2 ≤ n → (k : ℝ) / log k ≤ n → log n ≤ 2 * log k → c * k / (n * logAlphabet k) ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_lower_dense_logAlphabet lemma twoSampleL1_lower_dense_logAlphabet (of_gate : JHWKnownQL1LowerRegime) : ∃ c : ℝ, 0 < c ∧ ∃ k0 : ℕ, ∀ k n : ℕ, k0 ≤ k → 2 ≤ k → 2 ≤ n → (k : ℝ) / log k ≤ n → log n ≤ 2 * log k → c * k / (n * logAlphabet k) ≤ twoSampleL1MinimaxRisk n k := by obtain ⟨c, hc, k0, hbound⟩ := twoSampleL1_lower_in_cited_regime of_gate 1 2 (by norm_num) refine ⟨c / 2, by positivity, k0, ?_⟩ intro k n hk hk2 hn hsample hlog have hbase := hbound k n hk (by simpa using hsample) hlog have hnreal : (0 : ℝ) < n := by exact_mod_cast (by omega : 0 < n) have hlogn : 0 < log n := Real.log_pos (by exact_mod_cast (by omega : 1 < n)) have hkreal : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hlogk : 0 ≤ log k := by have : (1 : ℝ) ≤ k := by exact_mod_cast (by omega : 1 ≤ k) exact Real.log_nonneg this have hL : log k ≤ logAlphabet k := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkreal)] simp have hlogkpos : 0 < log k := Real.log_pos (by exact_mod_cast (by omega : 1 < k)) have hLpos : 0 < logAlphabet k := lt_of_lt_of_le hlogkpos hL have hden : (n : ℝ) * log n ≤ 2 * ((n : ℝ) * logAlphabet k) := by nlinarith have hcomp : (c / 2) * k / (n * logAlphabet k) ≤ c * k / (n * log n) := by apply (div_le_div_iff₀ (by positivity) (by positivity)).mpr nlinarith [mul_le_mul_of_nonneg_left hden (le_of_lt (mul_pos hc hkreal))] exact hcomp.trans hbase
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_lower_dense_logAlphabet · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:242
theorem twoSampleL1_prefix_risk Lemma twoSampleL1_prefix_risk in the paper ↗

A finite sample can be read as the initial coordinates of a longer sample. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n m :
ℕ
hnm :
n ≤ m
est :
TwoSampleEstimator n k
R S :
ProbabilitySimplex k
twoSampleL1Risk m ⟨fun z
=> est.1 (fun i => z.1 (castLE hnm i), fun i => z.2 (castLE hnm i)), measurable_of_finite _⟩ (R, S) = twoSampleL1Risk n est (R, S)
Proof (Lean source)
-- @node: twoSampleL1_prefix_risk lemma twoSampleL1_prefix_risk {k n m : ℕ} (hnm : n ≤ m) (est : TwoSampleEstimator n k) (R S : ProbabilitySimplex k) : twoSampleL1Risk m ⟨fun z => est.1 (fun i => z.1 (castLE hnm i), fun i => z.2 (castLE hnm i)), measurable_of_finite _⟩ (R, S) = twoSampleL1Risk n est (R, S) := by let pref : (Fin m → Fin k) → (Fin n → Fin k) := fun z i => z (castLE hnm i) have hp : Measurable pref := by fun_prop have hmap (T : ProbabilitySimplex k) : Measure.map pref (simplexSampleLaw T m) = simplexSampleLaw T n := by let μ := (simplexPMF T).toMeasure haveI : IsProbabilityMeasure μ := by dsimp [μ]; infer_instance have hm : Measurable (fun z : ℕ → Fin k => fun i : Fin m => z i) := measurable_pi_lambda _ fun i => measurable_pi_apply (i : ℕ) change Measure.map pref (Measure.pi (fun _ : Fin m => μ)) = Measure.pi (fun _ : Fin n => μ) rw [← Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.iidStreamLaw_map_finPrefix μ m, Measure.map_map hp hm] change Measure.map (fun z : ℕ → Fin k => fun i : Fin n => z i) (iidStreamLaw μ) = _ exact Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.iidStreamLaw_map_finPrefix μ n have hprod : Measure.map (map pref pref) (twoSampleLaw m (R, S)) = twoSampleLaw n (R, S) := by unfold twoSampleLaw unfold twoSampleLaw rw [← Measure.map_prod_map _ _ hp hp, hmap R, hmap S] have hf : Measurable (fun z : (Fin n → Fin k) × (Fin n → Fin k) => (est.1 z - simplexL1 R S) ^ 2) := measurable_of_finite _ change (∫ z, (est.1 (map pref pref z) - simplexL1 R S) ^ 2 ∂twoSampleLaw m (R, S)) = ∫ z, (est.1 z - simplexL1 R S) ^ 2 ∂twoSampleLaw n (R, S) rw [← hprod] exact (integral_map (hp.prodMap hp).aemeasurable hf.aestronglyMeasurable).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_prefix_risk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:276
theorem twoSampleL1_minimax_antitone Lemma twoSampleL1_minimax_antitone in the paper ↗

Discarding observations shows that the two-sample minimax risk decreases with the sample size. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n m :
ℕ
hnm :
n ≤ m
twoSampleL1MinimaxRisk m k ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_minimax_antitone lemma twoSampleL1_minimax_antitone {k n m : ℕ} [NeZero k] (hnm : n ≤ m) : twoSampleL1MinimaxRisk m k ≤ twoSampleL1MinimaxRisk n k := by letI : Nonempty (TwoSampleEstimator m k) := ⟨⟨fun _ => 0, measurable_const⟩⟩ letI : Nonempty (TwoSampleEstimator n k) := ⟨⟨fun _ => 0, measurable_const⟩⟩ letI : Nonempty (ProbabilitySimplex k) := by let R : ProbabilitySimplex k := ⟨fun i => if i = 0 then 1 else 0, by constructor · intro i change 0 ≤ (if i = 0 then (1 : ℝ) else 0) split_ifs <;> norm_num · simp⟩ exact ⟨R⟩ unfold twoSampleL1MinimaxRisk unfold Causalean.Stat.Minimax.Multinomial.TwoSampleL1.twoSampleL1MinimaxRisk Causalean.Stat.minimaxValueReal apply le_ciInf intro est let est' : TwoSampleEstimator m k := ⟨fun z => est.1 (fun i => z.1 (castLE hnm i), fun i => z.2 (castLE hnm i)), measurable_of_finite _⟩ have hbelow : BddBelow (range (fun e : TwoSampleEstimator m k => worstCaseRiskReal (twoSampleL1Risk m) e)) := by refine ⟨0, ?_⟩ rintro _ ⟨e, rfl⟩ apply Real.iSup_nonneg intro RS exact integral_nonneg (fun z => sq_nonneg _) have hmin := ciInf_le hbelow est' change (⨅ e : TwoSampleEstimator m k, ⨆ RS, twoSampleL1Risk m e RS) ≤ ⨆ RS, twoSampleL1Risk n est RS apply hmin.trans apply ciSup_le rintro ⟨R, S⟩ rw [show twoSampleL1Risk m est' (R, S) = twoSampleL1Risk n est (R, S) from twoSampleL1_prefix_risk hnm est R S] exact le_ciSup (twoSampleL1Risk_bddAbove_all est) (R, S)
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_minimax_antitone · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:314
theorem twoSampleL1_lower_large_dense

The known-reference gate supplies the claimed two-sample rate throughout the dense range of large alphabets. With the specified inputs and conditions, the stated relationship holds.

Formal statement
∃ c : ℝ,
conclusion 1
0 < c
conclusion 2
∃ k0 : ℕ,
∀ k n : ℕ,
k0
≤ k → 2 ≤ k → 2 ≤ n → n ≤ k ^ 2 → (k : ℝ) / log k ≤ n → c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_lower_large_dense lemma twoSampleL1_lower_large_dense (of_gate : JHWKnownQL1LowerRegime) : ∃ c : ℝ, 0 < c ∧ ∃ k0 : ℕ, ∀ k n : ℕ, k0 ≤ k → 2 ≤ k → 2 ≤ n → n ≤ k ^ 2 → (k : ℝ) / log k ≤ n → c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ twoSampleL1MinimaxRisk n k := by obtain ⟨c, hc, k0, hbound⟩ := twoSampleL1_lower_dense_logAlphabet of_gate refine ⟨c, hc, k0, ?_⟩ intro k n hk hk2 hn hnk hsample have hlog : log n ≤ 2 * log k := by have hkn : (0 : ℝ) < n := by exact_mod_cast (by omega : 0 < n) have hsq : (n : ℝ) ≤ (k : ℝ) ^ 2 := by exact_mod_cast hnk calc log n ≤ log ((k : ℝ) ^ 2) := Real.log_le_log hkn hsq _ = 2 * log k := by rw [Real.log_pow]; ring have hbase := hbound k n hk hk2 hn hsample hlog calc c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ c * ((k : ℝ) / (n * logAlphabet k)) := mul_le_mul_of_nonneg_left (min_le_right _ _) (le_of_lt hc) _ = c * k / (n * logAlphabet k) := by ring _ ≤ twoSampleL1MinimaxRisk n k := hbase
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_lower_large_dense · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:356

The two fixed hypotheses used to handle finitely many small alphabets.

Definition (Lean source)
k :
ℕ
twoSampleL1_pointMass k :
ProbabilitySimplex k
⟨fun i
=> if i = 0 then 1 else 0, by constructor · intro i change 0 ≤ (if i = 0 then (1 : ℝ) else 0) split_ifs <;> norm_num · simp⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_pointMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:382

For k, hk, the two sample l1 half mass definition specifies the stated object.

Definition (Lean source)
k :
ℕ
hk :
2 ≤ k
twoSampleL1_halfMass k hk :
ProbabilitySimplex k
by letI : NeZero k := ⟨by omega⟩ let i₁ : Fin k := ⟨1, by omega⟩ refine ⟨fun i
=> if i = 0 then (1 / 2 : ℝ) else if i = i₁ then 1 / 2 else 0, ?_⟩ constructor · intro i change 0 ≤ (if i = 0 then (1 / 2 : ℝ) else if i = i₁ then 1 / 2 else 0) split_ifs <;> norm_num · have h10 : i₁ ≠ (0 : Fin k) := by simp [i₁] simp only [Finset.sum_ite, Finset.sum_singleton] have hA : ({x : Fin k | x = 0} : Finset (Fin k)) = {0} := by ext i; simp have hB : ({x : Fin k | x ≠ 0 ∧ x = i₁} : Finset (Fin k)) = {i₁} := by ext i simp only [mem_filter, Finset.mem_univ, true_and, Finset.mem_singleton] constructor · exact right · intro hi subst i exact ⟨h10, rfl⟩ simp only [Finset.filter_filter] rw [hA, hB] norm_num
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_halfMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:393
theorem twoSampleL1_fixedTargets

The two sample l1 fixed targets result. Under the hk premise, It proves the stated conclusion.

Formal statement
k :
ℕ
hk :
2 ≤ k
conclusion 1
conclusion 2
Proof (Lean source)
lemma twoSampleL1_fixedTargets (k : ℕ) [NeZero k] (hk : 2 ≤ k) : simplexL1 (twoSampleL1_pointMass k) (twoSampleL1_pointMass k) = 0 ∧ simplexL1 (twoSampleL1_halfMass k hk) (twoSampleL1_pointMass k) = 1 := by constructor · exact simplexL1_self _ · calc simplexL1 (twoSampleL1_halfMass k hk) (twoSampleL1_pointMass k) = ∑ i : Fin k, (twoSampleL1_halfMass k hk).1 i := by unfold simplexL1 apply Finset.sum_congr rfl intro i _ by_cases h0 : i = 0 · subst i norm_num [twoSampleL1_halfMass, twoSampleL1_pointMass] · by_cases h1 : i = (⟨1, by omega⟩ : Fin k) · simp [twoSampleL1_halfMass, twoSampleL1_pointMass, h0, h1] · simp [twoSampleL1_halfMass, twoSampleL1_pointMass, h0, h1] _ = 1 := (twoSampleL1_halfMass k hk).2.2
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_fixedTargets · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:418
theorem twoSampleL1_commonAtom

The two sample l1 common atom result. Under the hk premise, It proves the stated conclusion.

Formal statement
k n :
ℕ
hk :
2 ≤ k
z₀ :
(fun _ => 0, fun _ => 0) (: (Fin n → Fin k) × (Fin n → Fin k))
(twoSampleLaw n (twoSampleL1_pointMass k, twoSampleL1_pointMass k) {z₀}).toReal = 1
(twoSampleLaw n (twoSampleL1_halfMass k hk, twoSampleL1_pointMass k) {z₀}).toReal
= (1 / 2 : ℝ) ^ n
Proof (Lean source)
lemma twoSampleL1_commonAtom (k n : ℕ) [NeZero k] (hk : 2 ≤ k) : let z₀ : (Fin n → Fin k) × (Fin n → Fin k) := (fun _ => 0, fun _ => 0) (twoSampleLaw n (twoSampleL1_pointMass k, twoSampleL1_pointMass k) {z₀}).toReal = 1 ∧ (twoSampleLaw n (twoSampleL1_halfMass k hk, twoSampleL1_pointMass k) {z₀}).toReal = (1 / 2 : ℝ) ^ n := by dsimp constructor · rw [twoSampleLaw_singleton] simp [simplexPMF, simplexPMF, twoSampleL1_pointMass] · rw [twoSampleLaw_singleton] simp [simplexPMF, simplexPMF, twoSampleL1_halfMass, twoSampleL1_pointMass]
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_commonAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:439
theorem twoSampleL1_atomRisk_le Lemma twoSampleL1_atomRisk_le in the paper ↗

The two sample l1 atom risk le result. It proves the stated conclusion.

Formal statement
k n :
ℕ
est :
TwoSampleEstimator n k
R S :
ProbabilitySimplex k
z :
(Fin n → Fin k) × (Fin n → Fin k)
(twoSampleLaw n (R, S)).real {z} * (est.1 z - simplexL1 R S) ^ 2
≤ twoSampleL1Risk n est (R, S)
Proof (Lean source)
lemma twoSampleL1_atomRisk_le {k n : ℕ} (est : TwoSampleEstimator n k) (R S : ProbabilitySimplex k) (z : (Fin n → Fin k) × (Fin n → Fin k)) : (twoSampleLaw n (R, S)).real {z} * (est.1 z - simplexL1 R S) ^ 2 ≤ twoSampleL1Risk n est (R, S) := by letI : IsProbabilityMeasure (twoSampleLaw n (R, S)) := by infer_instance unfold twoSampleL1Risk unfold twoSampleL1Risk rw [integral_fintype (Integrable.of_finite : Integrable (fun x => (est.1 x - simplexL1 R S) ^ 2) (twoSampleLaw n (R, S)))] simp only [smul_eq_mul] refine Finset.single_le_sum (f := fun x => (twoSampleLaw n (R, S)).real {x} * (est.1 x - simplexL1 R S) ^ 2) ?_ (Finset.mem_univ z) intro x _ exact mul_nonneg (by positivity) (sq_nonneg _)
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_atomRisk_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:457
theorem twoSampleL1_finiteAlphabetLower Lemma twoSampleL1_finiteAlphabetLower in the paper ↗

A common observation atom gives a positive two-point squared-risk bound at every finite sample size, uniformly over alphabets with two labels. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k n :
ℕ
hk :
2 ≤ k
(1 / 2 : ℝ) ^ n / 4 ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_finiteAlphabetLower lemma twoSampleL1_finiteAlphabetLower (k n : ℕ) (hk : 2 ≤ k) : (1 / 2 : ℝ) ^ n / 4 ≤ twoSampleL1MinimaxRisk n k := by letI : NeZero k := ⟨by omega⟩ let R₀ := twoSampleL1_pointMass k let R₁ := twoSampleL1_halfMass k hk let z₀ : (Fin n → Fin k) × (Fin n → Fin k) := (fun _ => 0, fun _ => 0) let p : ℝ := (1 / 2 : ℝ) ^ n have hp : 0 < p := by dsimp [p]; positivity have hp1 : p ≤ 1 := by dsimp [p]; exact pow_le_one₀ (by norm_num) (by norm_num) have htargets := twoSampleL1_fixedTargets k hk have hatom := twoSampleL1_commonAtom k n hk letI : Nonempty (TwoSampleEstimator n k) := ⟨⟨fun _ => 0, measurable_const⟩⟩ unfold twoSampleL1MinimaxRisk unfold twoSampleL1MinimaxRisk minimaxValueReal apply le_ciInf intro est have hr0 := twoSampleL1_atomRisk_le est R₀ R₀ z₀ have hr1 := twoSampleL1_atomRisk_le est R₁ R₀ z₀ change (twoSampleLaw n (R₀, R₀) {z₀}).toReal * (est.1 z₀ - simplexL1 R₀ R₀) ^ 2 ≤ twoSampleL1Risk n est (R₀, R₀) at hr0 change (twoSampleLaw n (R₁, R₀) {z₀}).toReal * (est.1 z₀ - simplexL1 R₁ R₀) ^ 2 ≤ twoSampleL1Risk n est (R₁, R₀) at hr1 rw [hatom.1, htargets.1] at hr0 rw [hatom.2, htargets.2] at hr1 have hq : p / 2 ≤ p * (est.1 z₀) ^ 2 + p * (est.1 z₀ - 1) ^ 2 := by nlinarith [mul_nonneg hp.le (sq_nonneg (2 * est.1 z₀ - 1))] have h0' : p * (est.1 z₀) ^ 2 ≤ twoSampleL1Risk n est (R₀, R₀) := by nlinarith [mul_nonneg (sub_nonneg.mpr hp1) (sq_nonneg (est.1 z₀))] have hmax : p / 4 ≤ max (twoSampleL1Risk n est (R₀, R₀)) (twoSampleL1Risk n est (R₁, R₀)) := by nlinarith [le_max_left (twoSampleL1Risk n est (R₀, R₀)) (twoSampleL1Risk n est (R₁, R₀)), le_max_right (twoSampleL1Risk n est (R₀, R₀)) (twoSampleL1Risk n est (R₁, R₀))] have hB := twoSampleL1Risk_bddAbove_all est exact hmax.trans (max_le (le_ciSup hB (R₀, R₀)) (le_ciSup hB (R₁, R₀)))
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_finiteAlphabetLower · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1.lean:476
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.Helpers.TwoSampleL1Splice 3 declarations Sparse and finite-alphabet completion of the two-sample L1 lower bound.

Sparse and finite-alphabet completion of the two-sample L1 lower bound.

theorem twoSampleL1_lower_large_sparse

At large alphabets the cited dense result also controls samples below k / log k, by comparing with the first dense sample size. With the specified inputs and conditions, the stated relationship holds.

Formal statement
∃ c : ℝ,
conclusion 1
0 < c
conclusion 2
∃ k0 : ℕ,
∀ k n : ℕ,
max k0 3 ≤ k → 1 ≤ n → (n : ℝ) < (k : ℝ) / log k → c ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: twoSampleL1_lower_large_sparse lemma twoSampleL1_lower_large_sparse (of_gate : JHWKnownQL1LowerRegime) : ∃ c : ℝ, 0 < c ∧ ∃ k0 : ℕ, ∀ k n : ℕ, max k0 3 ≤ k → 1 ≤ n → (n : ℝ) < (k : ℝ) / Real.log k → c ≤ twoSampleL1MinimaxRisk n k := by obtain ⟨c, hc, k0, hbound⟩ := twoSampleL1_lower_dense_logAlphabet of_gate refine ⟨c / 4, by positivity, k0, ?_⟩ intro k n hk hn hsparse have hk3 : 3 ≤ k := le_trans (le_max_right _ _) hk have hk0 : k0 ≤ k := le_trans (le_max_left _ _) hk have hkpos : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hlogpos : 0 < Real.log k := Real.log_pos (by exact_mod_cast (by omega : 1 < k)) have hlogone : (1 : ℝ) ≤ Real.log k := by apply (Real.le_log_iff_exp_le hkpos).2 have hk3r : (3 : ℝ) ≤ k := by exact_mod_cast hk3 exact (le_of_lt Real.exp_one_lt_three).trans hk3r have hlogle : Real.log k ≤ (k : ℝ) - 1 := Real.log_le_sub_one_of_pos hkpos let x : ℝ := (k : ℝ) / Real.log k let m : ℕ := Nat.ceil x have hxpos : 0 < x := div_pos hkpos hlogpos have hxone : 1 < x := by dsimp [x] apply (lt_div_iff₀ hlogpos).2 linarith have hxm : x ≤ m := Nat.le_ceil x have hmlt : (m : ℝ) < x + 1 := Nat.ceil_lt_add_one hxpos.le have hm2 : 2 ≤ m := by have : (1 : ℝ) < m := lt_of_lt_of_le hxone hxm exact_mod_cast this have hmx : (m : ℝ) ≤ 2 * x := by linarith have hxk : x ≤ k := by dsimp [x] apply (div_le_iff₀ hlogpos).2 nlinarith [mul_nonneg hkpos.le (sub_nonneg.mpr hlogone)] have hmksq : m ≤ k ^ 2 := by have hmr : (m : ℝ) ≤ (k : ℝ) ^ 2 := by nlinarith [show (3 : ℝ) ≤ k by exact_mod_cast hk3] exact_mod_cast hmr have hmpos : (0 : ℝ) < m := by exact_mod_cast (by omega : 0 < m) have hLpos : 0 < logAlphabet k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkpos)] simp linarith have hL : logAlphabet k ≤ 2 * Real.log k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkpos)] simp linarith have hmlog : (m : ℝ) * Real.log k ≤ 2 * k := by have h := mul_le_mul_of_nonneg_right hmx hlogpos.le dsimp [x] at h field_simp at h nlinarith have hden : (m : ℝ) * logAlphabet k ≤ 4 * k := by nlinarith [mul_nonneg (by exact_mod_cast (by omega : 0 ≤ m) : (0 : ℝ) ≤ m) (sub_nonneg.mpr hL)] have hlogm : Real.log m ≤ 2 * Real.log k := by have hmr : (m : ℝ) ≤ (k : ℝ) ^ 2 := by exact_mod_cast hmksq calc Real.log m ≤ Real.log ((k : ℝ) ^ 2) := Real.log_le_log hmpos hmr _ = 2 * Real.log k := by rw [Real.log_pow]; ring have hbase := hbound k m hk0 (by omega) hm2 hxm hlogm have hcomp : c / 4 ≤ c * k / (m * logAlphabet k) := by apply (le_div_iff₀ (mul_pos hmpos hLpos)).2 nlinarith [mul_le_mul_of_nonneg_left hden (le_of_lt hc)] have hnm : n ≤ m := by have hnr : (n : ℝ) ≤ m := (le_of_lt hsparse).trans hxm exact_mod_cast hnr haveI : NeZero k := ⟨by omega⟩ exact (hcomp.trans hbase).trans (twoSampleL1_minimax_antitone hnm)
CausalSmith.Stat.DiscreteBudgetvalueCurve.twoSampleL1_lower_large_sparse · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1Splice.lean:11
theorem two_sample_l1_lower

The two sample l1 lower result. It proves the stated conclusion.

Formal statement
∃ c : ℝ,
0 < c
conclusion 1
k n :
ℕ
2 ≤ k
1 ≤ n
n ≤ k ^ 2
c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
lemma two_sample_l1_lower (_of_gate : JHWKnownQL1LowerRegime) : ∃ c : ℝ, 0 < c ∧ ∀ k n : ℕ, 2 ≤ k → 1 ≤ n → n ≤ k ^ 2 → c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ twoSampleL1MinimaxRisk n k := by obtain ⟨cD, hcD, kD, hD⟩ := twoSampleL1_lower_large_dense _of_gate obtain ⟨cS, hcS, kS, hS⟩ := twoSampleL1_lower_large_sparse _of_gate let K := max (max kD kS) 3 let p : ℝ := (1 / 2 : ℝ) ^ (K ^ 2) / 4 have hp : 0 < p := by dsimp [p]; positivity let c := min cD (min cS p) have hc : 0 < c := by dsimp [c]; positivity refine ⟨c, hc, ?_⟩ intro k n hk hn hnk have hrate : min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ 1 := min_le_left _ _ have hcD' : c ≤ cD := by dsimp [c]; exact min_le_left _ _ have hcS' : c ≤ cS := by dsimp [c]; exact (min_le_right _ _).trans (min_le_left _ _) have hcp : c ≤ p := by dsimp [c]; exact (min_le_right _ _).trans (min_le_right _ _) by_cases hlarge : K ≤ k · have hkD : kD ≤ k := le_trans (le_max_left _ _) (le_trans (le_max_left _ _) hlarge) have hkS : max kS 3 ≤ k := by exact max_le (le_trans (le_max_right _ _) (le_trans (le_max_left _ _) hlarge)) (le_trans (le_max_right _ _) hlarge) have hk3 : 3 ≤ k := le_trans (le_max_right _ _) hlarge have hkpos : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hlogpos : 0 < log k := Real.log_pos (by exact_mod_cast (by omega : 1 < k)) have hratio : 1 < (k : ℝ) / log k := by apply (lt_div_iff₀ hlogpos).2 linarith [Real.log_le_sub_one_of_pos hkpos] by_cases hsparse : (n : ℝ) < (k : ℝ) / log k · have hbase := hS k n hkS hn hsparse calc c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ c := by nlinarith [hrate] _ ≤ cS := hcS' _ ≤ twoSampleL1MinimaxRisk n k := hbase · have hsample : (k : ℝ) / log k ≤ n := le_of_not_gt hsparse have hn2 : 2 ≤ n := by have : (1 : ℝ) < n := lt_of_lt_of_le hratio hsample exact_mod_cast this have hbase := hD k n hkD hk hn2 hnk hsample have hrate0 : 0 ≤ min 1 ((k : ℝ) / (n * logAlphabet k)) := by apply le_min (by norm_num) have hLpos : 0 < logAlphabet k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkpos)] simp linarith positivity exact (mul_le_mul_of_nonneg_right hcD' hrate0).trans hbase · have hkK : k ≤ K := le_of_lt (Nat.lt_of_not_ge hlarge) have hnK : n ≤ K ^ 2 := le_trans hnk (Nat.pow_le_pow_left hkK 2) haveI : NeZero k := ⟨by omega⟩ have hbase := twoSampleL1_finiteAlphabetLower k (K ^ 2) hk have hrisk := twoSampleL1_minimax_antitone (k := k) hnK calc c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ c := by nlinarith [hrate] _ ≤ p := hcp _ ≤ twoSampleL1MinimaxRisk (K ^ 2) k := hbase _ ≤ twoSampleL1MinimaxRisk n k := hrisk
CausalSmith.Stat.DiscreteBudgetvalueCurve.two_sample_l1_lower · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1Splice.lean:88
theorem two_sample_l1_lower_all_samples

The paper's small-sample bound and the generic large-sample theorem give the matched two-sample lower bound for every positive sample size. With the specified inputs and conditions, the stated relationship holds.

Formal statement
∃ c : ℝ,
0 < c
conclusion 1
k n :
ℕ
2 ≤ k
1 ≤ n
c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ twoSampleL1MinimaxRisk n k
Proof (Lean source)
-- @node: two_sample_l1_lower_all_samples lemma two_sample_l1_lower_all_samples (of_gate : JHWKnownQL1LowerRegime) : ∃ c : ℝ, 0 < c ∧ ∀ k n : ℕ, 2 ≤ k → 1 ≤ n → c * min 1 ((k : ℝ) / (n * logAlphabet k)) ≤ twoSampleL1MinimaxRisk n k := by obtain ⟨cS, hcS, hS⟩ := two_sample_l1_lower of_gate obtain ⟨cL, hcL, hL⟩ := twoSampleL1MinimaxRisk_largeSample_lower refine ⟨min cS cL, by positivity, ?_⟩ intro k n hk hn by_cases hsmall : n ≤ k ^ 2 · have h := hS k n hk hn hsmall have hr : 0 ≤ min 1 ((k : ℝ) / (n * logAlphabet k)) := by apply le_min (by norm_num) have hkpos : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hlog : 0 < logAlphabet k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkpos)] simp positivity positivity exact (mul_le_mul_of_nonneg_right (min_le_left _ _) hr).trans h · have hlarge : k ^ 2 < n := Nat.lt_of_not_ge hsmall have h := hL k n hk hlarge have hratio : (k : ℝ) / (n * logAlphabet k) ≤ 1 := by have hkpos : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hnpos : (0 : ℝ) < n := by exact_mod_cast (by omega : 0 < n) have hlog : 1 ≤ logAlphabet k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkpos)] simp exact Real.log_nonneg (by exact_mod_cast (by omega : 1 ≤ k)) apply (div_le_iff₀ (mul_pos hnpos (lt_of_lt_of_le zero_lt_one hlog))).2 have hlargeR : (k : ℝ) ^ 2 < n := by exact_mod_cast hlarge have hkR : (2 : ℝ) ≤ k := by exact_mod_cast hk nlinarith rw [min_eq_right hratio] have hratio0 : 0 ≤ (k : ℝ) / (n * logAlphabet k) := by have hkpos : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hnpos : (0 : ℝ) < n := by exact_mod_cast (by omega : 0 < n) have hlog : 0 < logAlphabet k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkpos)] simp positivity positivity exact (mul_le_mul_of_nonneg_right (min_le_right _ _) hratio0).trans h
CausalSmith.Stat.DiscreteBudgetvalueCurve.two_sample_l1_lower_all_samples · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/Helpers/TwoSampleL1Splice.lean:151
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TCapacityActiveLower 2 declarations The capacity-active minimax converse, conditional on the known-reference gate.

The capacity-active minimax converse, conditional on the known-reference gate.

Measurable scalar estimators of the half-budget value.

Definition (Lean source)
n d :
ℕ
ScalarEstimator n d :
Type
{f : (Fin n → Obs d) → ℝ // Measurable f}
CausalSmith.Stat.DiscreteBudgetvalueCurve.ScalarEstimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCapacityActiveLower.lean:15
theorem capacity_active_lower

The capacity active lower result. Under the he premise, the he' premise, It proves the stated conclusion.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ c : ℝ,
0 < c
conclusion 1
n d :
ℕ
1 ≤ n
2 ≤ d
mu :
PotentialLaw d → Measure (Fin n → Obs d)
(∀ Q, IidSampling (observedMarginal Q) (mu Q))
T :
∃ Q : PotentialLaw d,
Q ∈ capacityHardClass d epsilon
c * curveRate n d ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2))
Proof (Lean source)
theorem capacity_active_lower (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (_of_gate : JHWKnownQL1LowerRegime) : ∃ c : ℝ, 0 < c ∧ ∀ n d : ℕ, 1 ≤ n → 2 ≤ d → ∀ mu : PotentialLaw d → Measure (Fin n → Obs d), (∀ Q, IidSampling (observedMarginal Q) (mu Q)) → ∀ T : ScalarEstimator n d, ∃ Q : PotentialLaw d, Q ∈ capacityHardClass d epsilon ∧ c * curveRate n d ≤ sqRisk (mu Q) T.1 (budgetValue Q (1 / 2)) := by obtain ⟨cL, hcL, hL⟩ := two_sample_l1_lower_all_samples _of_gate let c : ℝ := min (cL / 6144) (1 / 12288) have hc : 0 < c := by dsimp [c]; positivity refine ⟨c, hc, ?_⟩ intro n d hn hd mu hmu T by_cases hd4 : 4 ≤ d · let k := d / 2 have hk : 2 ≤ k := by dsimp [k]; omega have hkd : 2 * k ≤ d := by dsimp [k]; omega let L := cL * min 1 ((k : ℝ) / (n * logAlphabet k)) have hrate0 : 0 < min 1 ((k : ℝ) / (n * logAlphabet k)) := by apply lt_min zero_lt_one have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hkR : (0 : ℝ) < k := by exact_mod_cast (by omega : 0 < k) have hlog : 0 < logAlphabet k := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hkR)] simp positivity positivity have hlow : L ≤ twoSampleL1MinimaxRisk n k := hL k n hk hn obtain ⟨Q, hQ, hR⟩ := pairedL1_lower_transport_capacity_padded (by omega : 1 ≤ k) hkd epsilon he he' L (mul_pos hcL hrate0) hlow mu hmu T refine ⟨Q, hQ, ?_⟩ have hcurve := curveRate_half_floor hn hd4 have hc_le : c ≤ cL / 6144 := min_le_left _ _ calc c * curveRate n d ≤ (cL / 6144) * curveRate n d := by gcongr exact curveRate_nonneg_local hn hd _ ≤ (1 / 32 : ℝ) ^ 2 * (L / 2) := by dsimp [L, curveRate, k] at hcurve ⊢ nlinarith [mul_nonneg hcL.le (show 0 ≤ min 1 (((d / 2 : ℕ) : ℝ) / ((n : ℝ) * logAlphabet (d / 2))) by positivity)] _ ≤ _ := hR · have hd3 : d ≤ 3 := by omega obtain ⟨Q, hQ, hR⟩ := small_capacity_lower_padded hn hd epsilon he he' mu hmu T refine ⟨Q, hQ, ?_⟩ have hc_le : c ≤ 1 / 12288 := min_le_right _ _ have hcurve := curveRate_small_le hn hd hd3 have hnR : (0 : ℝ) < n := by exact_mod_cast hn calc c * curveRate n d ≤ (1 / 12288 : ℝ) * curveRate n d := by gcongr exact curveRate_nonneg_local hn hd _ ≤ (1 / 12288 : ℝ) * (3 / (n : ℝ)) := by gcongr _ = 1 / (4096 * (n : ℝ)) := by field_simp; ring _ ≤ _ := hR
CausalSmith.Stat.DiscreteBudgetvalueCurve.capacity_active_lower · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCapacityActiveLower.lean:92
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TCurveUpper 19 declarations Uniform risk bound for the explicit total curve estimator.

Uniform risk bound for the explicit total curve estimator.

theorem empiricalCellVector_eq_empiricalMass

The four-mass plug-in coordinate is the ordinary empirical mass of its atom. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
sample :
Fin n → Obs d
j :
Fin d
z :
Cell
= empiricalMass sample (j, finTwoEquiv z.1, finTwoEquiv z.2)
Proof (Lean source)
-- @node: empiricalCellVector_eq_empiricalMass lemma empiricalCellVector_eq_empiricalMass {n d : ℕ} (sample : Fin n → Obs d) (j : Fin d) (z : Cell) : empiricalCellVector sample j z = empiricalMass sample (j, finTwoEquiv z.1, finTwoEquiv z.2) := by classical unfold empiricalCellVector empiricalMass rw [div_eq_inv_mul] congr 1 apply Finset.sum_congr rfl intro i _ have hiff : ((sample i).1 = j ∧ (sample i).2.1 = finTwoEquiv z.1 ∧ (sample i).2.2 = finTwoEquiv z.2) ↔ sample i = (j, finTwoEquiv z.1, finTwoEquiv z.2) := by cases sample i with | mk x ay => cases ay with | mk av yv => simp [Prod.mk.injEq] by_cases h : sample i = (j, finTwoEquiv z.1, finTwoEquiv z.2) <;> simp [h, hiff]
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalCellVector_eq_empiricalMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:15
theorem empiricalCellVector_sq_integral_le

Each plug-in four-mass coordinate has mean-square error at most 1/n. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
P :
hn :
1 ≤ n
j :
Fin d
z :
Cell
(∫ sample : Fin n → Obs d, (empiricalCellVector sample j z - cellVector P j z) ^ 2 ∂productLaw P n)
≤ 1 / (n : ℝ)
Proof (Lean source)
-- @node: empiricalCellVector_sq_integral_le lemma empiricalCellVector_sq_integral_le {n d : ℕ} (P : DiscreteLaw d) (hn : 1 ≤ n) (j : Fin d) (z : Cell) : (∫ sample : Fin n → Obs d, (empiricalCellVector sample j z - cellVector P j z) ^ 2 ∂productLaw P n) ≤ 1 / (n : ℝ) := by classical let a : Obs d := (j, finTwoEquiv z.1, finTwoEquiv z.2) let p : ℝ := (obsLaw P).real {a} have hmean : (∫ sample : Fin n → Obs d, empiricalMass sample a ∂productLaw P n) = p := by exact integral_empiricalMass (obsLaw P) hn a (MeasurableSet.singleton a) have hsq : (∫ sample : Fin n → Obs d, empiricalMass sample a ^ 2 ∂productLaw P n) = p ^ 2 + (n : ℝ)⁻¹ * (p - p ^ 2) := by exact integral_empiricalMass_sq (obsLaw P) hn a (MeasurableSet.singleton a) have hcell : cellVector P j z = p := by change (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal = _ simp [p, a, obsLaw, Measure.real] have hprob : 0 ≤ p ∧ p ≤ 1 := by exact ⟨measureReal_nonneg, measureReal_le_one⟩ have hnreal : (0 : ℝ) < n := by exact_mod_cast hn rw [hcell] simp_rw [empiricalCellVector_eq_empiricalMass] calc (∫ sample : Fin n → Obs d, (empiricalMass sample a - p) ^ 2 ∂productLaw P n) = (n : ℝ)⁻¹ * (p - p ^ 2) := by simp_rw [sub_sq] have hlin : (∫ sample : Fin n → Obs d, empiricalMass sample a ^ 2 - 2 * empiricalMass sample a * p + p ^ 2 ∂productLaw P n) = (∫ sample : Fin n → Obs d, empiricalMass sample a ^ 2 ∂productLaw P n) - 2 * (∫ sample : Fin n → Obs d, empiricalMass sample a ∂productLaw P n) * p + p ^ 2 := by haveI : IsProbabilityMeasure (productLaw P n) := by unfold productLaw infer_instance rw [integral_add (Integrable.of_finite) (integrable_const _), integral_sub (Integrable.of_finite) (Integrable.of_finite), integral_mul_const, integral_const_mul, integral_const] simp rw [hlin, hsq, hmean] ring _ ≤ 1 / (n : ℝ) := by rw [one_div] calc (n : ℝ)⁻¹ * (p - p ^ 2) ≤ (n : ℝ)⁻¹ * 1 := by apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr hnreal.le) nlinarith [sq_nonneg p] _ = (n : ℝ)⁻¹ := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalCellVector_sq_integral_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:38
theorem empiricalThresholdProcess_error_le

Cellwise Lipschitz control of the empirical threshold process. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
P :
sample :
Fin n → Obs d
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
|empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|
≤ (3 * (1 + epsilon⁻¹) + 1) * ∑ j : Fin d, ∑ z : Cell, |empiricalCellVector sample j z
- cellVector P j z|
Proof (Lean source)
-- @node: empiricalThresholdProcess_error_le lemma empiricalThresholdProcess_error_le {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (P : DiscreteLaw d) (sample : Fin n → Obs d) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda| ≤ (3 * (1 + epsilon⁻¹) + 1) * ∑ j : Fin d, ∑ z : Cell, |empiricalCellVector sample j z - cellVector P j z| := by have hnonneg (j : Fin d) (z : Cell) : 0 ≤ empiricalCellVector sample j z := by unfold empiricalCellVector positivity have htrue (j : Fin d) (z : Cell) : 0 ≤ cellVector P j z := by change 0 ≤ (P.pmf (j, finTwoEquiv z.1, finTwoEquiv z.2)).toReal positivity have hcell (j : Fin d) : |thresholdFunReal epsilon lambda (empiricalCellVector sample j) - thresholdFunReal epsilon lambda (cellVector P j)| ≤ (3 * (1 + epsilon⁻¹) + 1) * ∑ z : Cell, |empiricalCellVector sample j z - cellVector P j z| := budget_thresholdFunReal_pointwise_lipschitz he lambda hlambda _ _ (hnonneg j) (htrue j) have hsum : |∑ j : Fin d, (thresholdFunReal epsilon lambda (empiricalCellVector sample j) - thresholdFunReal epsilon lambda (cellVector P j))| ≤ ∑ j : Fin d, (3 * (1 + epsilon⁻¹) + 1) * ∑ z : Cell, |empiricalCellVector sample j z - cellVector P j z| := by calc _ ≤ ∑ j : Fin d, |thresholdFunReal epsilon lambda (empiricalCellVector sample j) - thresholdFunReal epsilon lambda (cellVector P j)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ _ := Finset.sum_le_sum (fun j _ => hcell j) simpa [empiricalThresholdProcess, dualProcessReal, dualProcess, thresholdFunReal, hlambda, Finset.sum_sub_distrib, Finset.mul_sum] using hsum
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalThresholdProcess_error_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:95
theorem empiricalThresholdProcess_uniformRisk_le

The empirical threshold process has uniform squared risk of order d²/n. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
P :
hn :
1 ≤ n
(∫ sample : Fin n → Obs d, (sSup ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1)) ^ 2 ∂productLaw P n)
≤ 16 * (d : ℝ) ^ 2 * (3 * (1 + epsilon⁻¹) + 1) ^ 2 / n
Proof (Lean source)
-- @node: empiricalThresholdProcess_uniformRisk_le lemma empiricalThresholdProcess_uniformRisk_le {n d : ℕ} {epsilon : ℝ} (he : 0 < epsilon) (P : DiscreteLaw d) (hn : 1 ≤ n) : (∫ sample : Fin n → Obs d, (sSup ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1)) ^ 2 ∂productLaw P n) ≤ 16 * (d : ℝ) ^ 2 * (3 * (1 + epsilon⁻¹) + 1) ^ 2 / n := by let K := 3 * (1 + epsilon⁻¹) + 1 have hK : 0 ≤ K := by dsimp [K]; positivity have hcard : card (Fin d × Cell) = 4 * d := by simp [Cell] ring have hpoint (sample : Fin n → Obs d) : (sSup ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1)) ^ 2 ≤ K ^ 2 * (4 * (d : ℝ)) * ∑ j : Fin d, ∑ z : Cell, (empiricalCellVector sample j z - cellVector P j z) ^ 2 := by let S := ∑ j : Fin d, ∑ z : Cell, |empiricalCellVector sample j z - cellVector P j z| have hS : 0 ≤ S := Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => abs_nonneg _)) have hsup : sSup ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1) ≤ K * S := by apply csSup_le · exact ⟨_, 0, by norm_num, rfl⟩ · rintro _ ⟨lambda, hlambda, rfl⟩ exact empiricalThresholdProcess_error_le he P sample lambda hlambda have hsup0 : 0 ≤ sSup ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1) := by have hb : BddAbove ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1) := by refine ⟨K * S, ?_⟩ rintro _ ⟨lambda, hlambda, rfl⟩ exact empiricalThresholdProcess_error_le he P sample lambda hlambda calc 0 ≤ |empiricalThresholdProcess epsilon sample 0 - dualProcessReal epsilon P 0| := abs_nonneg _ _ ≤ _ := le_csSup hb (show |empiricalThresholdProcess epsilon sample 0 - dualProcessReal epsilon P 0| ∈ ((fun lambda : ℝ => |empiricalThresholdProcess epsilon sample lambda - dualProcessReal epsilon P lambda|) '' Icc 0 1) from ⟨0, by norm_num, rfl⟩) have hcs : S ^ 2 ≤ 4 * (d : ℝ) * ∑ j : Fin d, ∑ z : Cell, (empiricalCellVector sample j z - cellVector P j z) ^ 2 := by have h := sq_sum_le_card_mul_sum_sq (s := (Finset.univ : Finset (Fin d × Cell))) (f := fun x => |empiricalCellVector sample x.1 x.2 - cellVector P x.1 x.2|) simpa [S, ← Finset.univ_product_univ, Finset.sum_product, hcard, sq_abs, mul_comm (d : ℝ) 4] using h calc _ ≤ (K * S) ^ 2 := by nlinarith _ = K ^ 2 * S ^ 2 := by ring _ ≤ K ^ 2 * (4 * (d : ℝ) * ∑ j : Fin d, ∑ z : Cell, (empiricalCellVector sample j z - cellVector P j z) ^ 2) := by exact mul_le_mul_of_nonneg_left hcs (sq_nonneg K) _ = _ := by ring calc _ ≤ ∫ sample : Fin n → Obs d, K ^ 2 * (4 * (d : ℝ)) * ∑ j : Fin d, ∑ z : Cell, (empiricalCellVector sample j z - cellVector P j z) ^ 2 ∂productLaw P n := by exact integral_mono Integrable.of_finite Integrable.of_finite hpoint _ = K ^ 2 * (4 * (d : ℝ)) * ∑ j : Fin d, ∑ z : Cell, (∫ sample : Fin n → Obs d, (empiricalCellVector sample j z - cellVector P j z) ^ 2 ∂productLaw P n) := by rw [integral_const_mul] congr 1 rw [integral_finsetSum Finset.univ (by intro j _ exact integrable_finsetSum Finset.univ (fun z _ => Integrable.of_finite))] apply Finset.sum_congr rfl intro j _ rw [integral_finsetSum Finset.univ (by intro z _ exact Integrable.of_finite)] _ ≤ K ^ 2 * (4 * (d : ℝ)) * ∑ j : Fin d, ∑ _z : Cell, (1 / (n : ℝ)) := by gcongr exact empiricalCellVector_sq_integral_le P hn _ _ _ = 16 * (d : ℝ) ^ 2 * K ^ 2 / n := by simp [Fintype.card_fin, Fintype.card_prod, Cell] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalThresholdProcess_uniformRisk_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:137
theorem empiricalThresholdProcess_bounded

The empirical threshold path is bounded on the price interval. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
sample :
Fin n → Obs d
∃ B : ℝ,
∀ lambda ∈ Icc (0 : ℝ) 1, |empiricalThresholdProcess epsilon sample lambda| ≤ B
Proof (Lean source)
-- @node: empiricalThresholdProcess_bounded lemma empiricalThresholdProcess_bounded {n d : ℕ} (epsilon : ℝ) (sample : Fin n → Obs d) : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |empiricalThresholdProcess epsilon sample lambda| ≤ B := by have hc : Continuous (fun lambda : Icc (0 : ℝ) 1 => empiricalThresholdProcess epsilon sample lambda) := by unfold empiricalThresholdProcess apply continuous_finsetSum intro j _ exact thresholdFunReal_continuous_time epsilon (empiricalCellVector sample j) obtain ⟨B, hB⟩ := (isCompact_univ : IsCompact (Set.univ : Set (Icc (0 : ℝ) 1))).exists_bound_of_continuousOn (f := fun lambda : Icc (0 : ℝ) 1 => empiricalThresholdProcess epsilon sample lambda) hc.continuousOn refine ⟨B, ?_⟩ intro lambda hlambda simpa only [Real.norm_eq_abs] using hB ⟨lambda, hlambda⟩ (Set.mem_univ _)
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalThresholdProcess_bounded · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:236
theorem averagedThresholdProcess_bounded

The averaged threshold path is bounded on the price interval. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon :
ℝ
he :
0 < epsilon
hn :
1 ≤ n
hd :
1 ≤ d
sample :
Fin n → Obs d
∃ B : ℝ,
∀ lambda ∈ Icc (0 : ℝ) 1, |averagedThresholdProcess epsilon sample lambda| ≤ B
Proof (Lean source)
-- @node: averagedThresholdProcess_bounded lemma averagedThresholdProcess_bounded {n d : ℕ} (epsilon : ℝ) (he : 0 < epsilon) (hn : 1 ≤ n) (hd : 1 ≤ d) (sample : Fin n → Obs d) : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |averagedThresholdProcess epsilon sample lambda| ≤ B := by have hcell (pilot eval : Cell → ℕ) : Continuous (fun lambda : Icc (0 : ℝ) 1 => jacksonCellStatistic epsilon lambda ((n : ℝ) / 8) d pilot eval) := by apply jacksonCellStatistic_continuous_time intro lambda apply pilotRectangle_threshold_pullback_continuousOn he · have hn' : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) positivity · exact hd have hc : Continuous (fun lambda : Icc (0 : ℝ) 1 => averagedThresholdProcess epsilon sample lambda) := by unfold averagedThresholdProcess cappedThresholdProcess auxiliaryThresholdProcess apply continuous_finsetSum intro M _ apply Continuous.mul continuous_const apply Continuous.div_const apply continuous_finsetSum intro perm _ apply continuous_finsetSum intro marks _ split_ifs · apply continuous_finsetSum intro j _ exact hcell _ _ · exact continuous_const obtain ⟨B, hB⟩ := (isCompact_univ : IsCompact (Set.univ : Set (Icc (0 : ℝ) 1))).exists_bound_of_continuousOn (f := fun lambda : Icc (0 : ℝ) 1 => averagedThresholdProcess epsilon sample lambda) hc.continuousOn refine ⟨B, ?_⟩ intro lambda hlambda simpa only [Real.norm_eq_abs] using hB ⟨lambda, hlambda⟩ (Set.mem_univ _)
CausalSmith.Stat.DiscreteBudgetvalueCurve.averagedThresholdProcess_bounded · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:256

Projection to the unit interval contracts distance to a unit-interval target. With the specified inputs and conditions, the stated relationship holds.

Formal statement
x y :
ℝ
hy :
y ∈ Icc (0 : ℝ) 1
|min 1 (max 0 x) - y| ≤ |x - y|
Proof (Lean source)
-- @node: clip_unit_distance_le lemma clip_unit_distance_le (x y : ℝ) (hy : y ∈ Icc (0 : ℝ) 1) : |min 1 (max 0 x) - y| ≤ |x - y| := by rcases le_total x 0 with hx | hx · simp only [max_eq_left hx, min_eq_right (by norm_num : (0 : ℝ) ≤ 1), zero_sub, abs_neg] rw [abs_of_nonneg hy.1, abs_of_nonpos (by linarith [hy.1])] linarith · rcases le_total x 1 with hx1 | hx1 · simp [max_eq_right hx, min_eq_right hx1] · simp only [max_eq_right hx, min_eq_left hx1] rw [abs_of_nonneg (by linarith [hy.2]), abs_of_nonneg (by linarith [hy.2])] linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.clip_unit_distance_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:296
theorem dualObjective_bddBelow_of_bounded Lemma dualObjective_bddBelow_of_bounded in the paper ↗

A bounded threshold path gives a lower-bounded dual objective. With the specified inputs and conditions, the stated relationship holds.

Formal statement
F :
ℝ → ℝ
b B :
ℝ
hb :
0 ≤ b
hB :
∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda| ≤ B
BddBelow ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1)
Proof (Lean source)
-- @node: dualObjective_bddBelow_of_bounded lemma dualObjective_bddBelow_of_bounded (F : ℝ → ℝ) (b B : ℝ) (hb : 0 ≤ b) (hB : ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda| ≤ B) : BddBelow ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1) := by refine ⟨-B, ?_⟩ rintro y ⟨lambda, hlambda, rfl⟩ have hlow := (abs_le.mp (hB lambda hlambda)).1 nlinarith [mul_nonneg hb hlambda.1]
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualObjective_bddBelow_of_bounded · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:311
theorem clippedDualCurveLoss_le_processError

Dual minimization and clipping transfer a uniform price-path error to curve loss. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon b0 :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hd :
2 ≤ d
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
Q :
hQ :
F :
ℝ → ℝ
hF :
∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda| ≤ B
(⨆ b : Icc b0 (1 - b0), (min 1 (max 0 (dualMinimum b.1 F)) - budgetValue Q b.1) ^ 2)
≤ (sSup ((fun lambda : ℝ => |F lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)) ^ 2
Proof (Lean source)
-- @node: clippedDualCurveLoss_le_processError lemma clippedDualCurveLoss_le_processError {d : ℕ} (epsilon b0 : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hd : 2 ≤ d) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (F : ℝ → ℝ) (hF : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda| ≤ B) : (⨆ b : Icc b0 (1 - b0), (min 1 (max 0 (dualMinimum b.1 F)) - budgetValue Q b.1) ^ 2) ≤ (sSup ((fun lambda : ℝ => |F lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)) ^ 2 := by let G := dualProcessReal epsilon (observedMarginal Q) let M := sSup ((fun lambda : ℝ => |F lambda - G lambda|) '' Icc 0 1) obtain ⟨BF, hBF⟩ := hF obtain ⟨BG, hBG⟩ := dualProcessReal_bounded epsilon (observedMarginal Q) have hMbdd : BddAbove ((fun lambda : ℝ => |F lambda - G lambda|) '' Icc 0 1) := by refine ⟨BF + BG, ?_⟩ rintro x ⟨lambda, hlambda, rfl⟩ calc |F lambda - G lambda| ≤ |F lambda| + |G lambda| := by simpa using (abs_sub_le (F lambda) 0 (G lambda)) _ ≤ BF + BG := add_le_add (hBF lambda hlambda) (hBG lambda hlambda) have hMnonneg : 0 ≤ M := by have h := le_csSup hMbdd (show |F 0 - G 0| ∈ ((fun lambda : ℝ => |F lambda - G lambda|) '' Icc 0 1) from ⟨0, by norm_num, rfl⟩) exact (abs_nonneg _).trans h have hval := (dual_representation epsilon Q hd hQ he he').1 let : Nonempty (Icc b0 (1 - b0)) := ⟨⟨b0, ⟨le_refl _, by linarith [hb0.2]⟩⟩⟩ apply ciSup_le intro b have hb : b.1 ∈ Icc (0 : ℝ) 1 := ⟨hb0.1.trans b.2.1, b.2.2.trans (by linarith [hb0.1])⟩ have hpoint : ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda - G lambda| ≤ M := by intro lambda hlambda exact le_csSup hMbdd ⟨lambda, hlambda, rfl⟩ have hmin := dualMinimum_lipschitz b.1 F G M (dualObjective_bddBelow_of_bounded F b.1 BF hb.1 hBF) (dualObjective_bddBelow_of_bounded G b.1 BG hb.1 hBG) hpoint have hclip := clip_unit_distance_le (dualMinimum b.1 F) (budgetValue Q b.1) (budgetValue_unit_interval Q b.1 hb) rw [hval b.1 hb] at hclip ⊢ change (min 1 (max 0 (dualMinimum b.1 F)) - dualMinimum b.1 G) ^ 2 ≤ M ^ 2 have habs : |min 1 (max 0 (dualMinimum b.1 F)) - dualMinimum b.1 G| ≤ M := hclip.trans hmin let a := min 1 (max 0 (dualMinimum b.1 F)) - dualMinimum b.1 G have hprod : 0 ≤ (M - |a|) * (M + |a|) := mul_nonneg (sub_nonneg.mpr habs) (add_nonneg hMnonneg (abs_nonneg a)) nlinarith [sq_abs a]
CausalSmith.Stat.DiscreteBudgetvalueCurve.clippedDualCurveLoss_le_processError · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:321
theorem jfEstimator_curveLoss_le_processError

The nonconstant estimator branch inherits the threshold-process loss. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
2 ≤ d
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
hbranch :
¬(d ≥ boundedAlphabetCutoff ∧ n < (d : ℝ) / logAlphabet d)
Q :
hQ :
sample :
Fin n → Obs d
(⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 sample b - budgetValue Q b.1) ^ 2)
≤ (sSup ((fun lambda : ℝ => |estimatedThresholdProcess epsilon sample lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)) ^ 2
Proof (Lean source)
-- @node: jfEstimator_curveLoss_le_processError lemma jfEstimator_curveLoss_le_processError {n d : ℕ} (epsilon b0 : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 2 ≤ d) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (hbranch : ¬(d ≥ boundedAlphabetCutoff ∧ n < (d : ℝ) / logAlphabet d)) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (sample : Fin n → Obs d) : (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 sample b - budgetValue Q b.1) ^ 2) ≤ (sSup ((fun lambda : ℝ => |estimatedThresholdProcess epsilon sample lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)) ^ 2 := by have hF : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |estimatedThresholdProcess epsilon sample lambda| ≤ B := by by_cases hs : d < boundedAlphabetCutoff · simpa [estimatedThresholdProcess, hs] using empiricalThresholdProcess_bounded epsilon sample · have hd16 : 16 ≤ d := by unfold boundedAlphabetCutoff at hs omega simpa [estimatedThresholdProcess, hs] using averagedThresholdProcess_bounded epsilon he hn (by omega : 1 ≤ d) sample have hbase := clippedDualCurveLoss_le_processError epsilon b0 he he' hd hb0 Q hQ (estimatedThresholdProcess epsilon sample) hF simpa [jfEstimator, hbranch, estimatedBudgetValue, dualMinimum] using hbase
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_curveLoss_le_processError · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:374
theorem jfEstimator_empiricalCurveRisk_le

In the empirical branch, curve risk is bounded by the empirical process risk. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
2 ≤ d
hdsmall :
d < 16
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
Q :
hQ :
mu :
Measure (Fin n → Obs d)
(∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂mu)
≤ 16 * (d : ℝ) ^ 2 * (3 * (1 + epsilon⁻¹) + 1) ^ 2 / n
Proof (Lean source)
-- @node: jfEstimator_empiricalCurveRisk_le lemma jfEstimator_empiricalCurveRisk_le {n d : ℕ} (epsilon b0 : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 2 ≤ d) (hdsmall : d < 16) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (mu : Measure (Fin n → Obs d)) (hmu : IidSampling (observedMarginal Q) mu) : (∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂mu) ≤ 16 * (d : ℝ) ^ 2 * (3 * (1 + epsilon⁻¹) + 1) ^ 2 / n := by rw [IidSampling] at hmu subst mu have hs : d < boundedAlphabetCutoff := by unfold boundedAlphabetCutoff exact hdsmall have hbranch : ¬(d ≥ boundedAlphabetCutoff ∧ n < (d : ℝ) / logAlphabet d) := by simp [Nat.not_le.mpr hs] calc (∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂productLaw (observedMarginal Q) n) ≤ ∫ z, (sSup ((fun lambda : ℝ => |empiricalThresholdProcess epsilon z lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)) ^ 2 ∂productLaw (observedMarginal Q) n := by apply integral_mono Integrable.of_finite Integrable.of_finite intro z simpa [estimatedThresholdProcess, hs] using jfEstimator_curveLoss_le_processError epsilon b0 he he' hn hd hb0 hbranch Q hQ z _ ≤ _ := empiricalThresholdProcess_uniformRisk_le he (observedMarginal Q) hn
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_empiricalCurveRisk_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:401
theorem jfEstimator_averagedCurveRisk_le

In the Jackson branch, curve risk is bounded by the averaged process risk. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hn :
1 ≤ n
hd :
16 ≤ d
hlarge :
(d : ℝ) / logAlphabet d ≤ n
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
Q :
hQ :
mu :
Measure (Fin n → Obs d)
(∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂mu)
≤ averagedProcessRisk (n := n) epsilon (observedMarginal Q)
Proof (Lean source)
-- @node: jfEstimator_averagedCurveRisk_le lemma jfEstimator_averagedCurveRisk_le {n d : ℕ} (epsilon b0 : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hn : 1 ≤ n) (hd : 16 ≤ d) (hlarge : (d : ℝ) / logAlphabet d ≤ n) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (mu : Measure (Fin n → Obs d)) (hmu : IidSampling (observedMarginal Q) mu) : (∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂mu) ≤ averagedProcessRisk (n := n) epsilon (observedMarginal Q) := by rw [IidSampling] at hmu subst mu have hs : ¬ d < boundedAlphabetCutoff := by unfold boundedAlphabetCutoff omega have hbranch : ¬(d ≥ boundedAlphabetCutoff ∧ n < (d : ℝ) / logAlphabet d) := by simp [not_lt.mpr hlarge] unfold averagedProcessRisk apply integral_mono Integrable.of_finite Integrable.of_finite intro z simpa [estimatedThresholdProcess, hs] using jfEstimator_curveLoss_le_processError epsilon b0 he he' hn (by omega : 2 ≤ d) hb0 hbranch Q hQ z
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_averagedCurveRisk_le · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:434
theorem logAlphabet_bounds_curve

The logarithmic scale lies between one and the alphabet size. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
hd :
1 ≤ d
conclusion 1
0 < logAlphabet d
conclusion 2
logAlphabet d ≤ d
Proof (Lean source)
-- @node: logAlphabet_bounds_curve lemma logAlphabet_bounds_curve (d : ℕ) (hd : 1 ≤ d) : 0 < logAlphabet d ∧ logAlphabet d ≤ d := by have hdpos : (0 : ℝ) < d := by exact_mod_cast (show 0 < d by omega) have hdge : (1 : ℝ) ≤ d := by exact_mod_cast hd have hlog : logAlphabet d = 1 + log d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos)] simp rw [hlog] constructor · have := Real.log_nonneg hdge linarith · have := Real.log_le_sub_one_of_pos hdpos linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.logAlphabet_bounds_curve · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:461
theorem empiricalCurveRate_algebra

The empirical bound has the required logarithmic rate below the cutoff. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
2 ≤ d
hdsmall :
d < 16
K :
ℝ
16 * (d : ℝ) ^ 2 * K ^ 2 / n ≤ (4096 * K ^ 2) * ((d : ℝ) / (n * logAlphabet d))
Proof (Lean source)
-- @node: empiricalCurveRate_algebra lemma empiricalCurveRate_algebra (n d : ℕ) (hn : 1 ≤ n) (hd : 2 ≤ d) (hdsmall : d < 16) (K : ℝ) : 16 * (d : ℝ) ^ 2 * K ^ 2 / n ≤ (4096 * K ^ 2) * ((d : ℝ) / (n * logAlphabet d)) := by obtain ⟨hLpos, hLle⟩ := logAlphabet_bounds_curve d (by omega) have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hdpos : (0 : ℝ) < d := by exact_mod_cast (show 0 < d by omega) have hdle : (d : ℝ) ≤ 16 := by exact_mod_cast (show d ≤ 16 by omega) have hprod : (d : ℝ) * logAlphabet d ≤ 256 := by nlinarith calc 16 * (d : ℝ) ^ 2 * K ^ 2 / n ≤ (4096 * K ^ 2 * d) / (n * logAlphabet d) := by apply (div_le_div_iff₀ hnpos (mul_pos hnpos hLpos)).2 have h := mul_le_mul_of_nonneg_left hprod (show 0 ≤ 16 * (d : ℝ) * K ^ 2 * n by positivity) nlinarith _ = _ := by ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.empiricalCurveRate_algebra · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:478
theorem jfEstimator_unit_interval

The total curve estimator takes values in the unit interval on every branch. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
sample :
Fin n → Obs d
b :
Icc b0 (1 - b0)
jfEstimator n d epsilon b0 sample b ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: jfEstimator_unit_interval lemma jfEstimator_unit_interval (n d : ℕ) (epsilon b0 : ℝ) (sample : Fin n → Obs d) (b : Icc b0 (1 - b0)) : jfEstimator n d epsilon b0 sample b ∈ Icc (0 : ℝ) 1 := by unfold jfEstimator split_ifs · norm_num · unfold estimatedBudgetValue exact ⟨le_min (by norm_num) (le_max_left _ _), min_le_left _ _⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_unit_interval · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:498
theorem jfEstimator_curveLoss_le_one

The clipped estimator has squared uniform loss at most one. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
Q :
sample :
Fin n → Obs d
(⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 sample b - budgetValue Q b.1) ^ 2)
≤ 1
Proof (Lean source)
-- @node: jfEstimator_curveLoss_le_one lemma jfEstimator_curveLoss_le_one (n d : ℕ) (epsilon b0 : ℝ) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (Q : PotentialLaw d) (sample : Fin n → Obs d) : (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 sample b - budgetValue Q b.1) ^ 2) ≤ 1 := by let : Nonempty (Icc b0 (1 - b0)) := ⟨⟨b0, ⟨le_refl _, by linarith [hb0.2]⟩⟩⟩ apply ciSup_le intro b have hb : b.1 ∈ Icc (0 : ℝ) 1 := by exact ⟨le_trans hb0.1 b.2.1, le_trans b.2.2 (by linarith [hb0.1])⟩ have hest := jfEstimator_unit_interval n d epsilon b0 sample b have hvalue := budgetValue_unit_interval Q b.1 hb nlinarith [hest.1, hest.2, hvalue.1, hvalue.2]
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_curveLoss_le_one · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:509
theorem jfEstimator_curveRisk_le_one

Every model has unit-bounded curve risk under the clipped estimator. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
Q :
mu :
Measure (Fin n → Obs d)
(∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂mu)
≤ 1
Proof (Lean source)
-- @node: jfEstimator_curveRisk_le_one lemma jfEstimator_curveRisk_le_one (n d : ℕ) (epsilon b0 : ℝ) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (Q : PotentialLaw d) (mu : Measure (Fin n → Obs d)) (hmu : IidSampling (observedMarginal Q) mu) : (∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂mu) ≤ 1 := by rw [IidSampling] at hmu subst mu let : IsProbabilityMeasure (productLaw (observedMarginal Q) n) := by unfold productLaw CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.productLaw infer_instance calc (∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q b.1) ^ 2) ∂productLaw (observedMarginal Q) n) ≤ ∫ _z : Fin n → Obs d, (1 : ℝ) ∂productLaw (observedMarginal Q) n := by exact integral_mono Integrable.of_finite (integrable_const 1) (jfEstimator_curveLoss_le_one n d epsilon b0 hb0 Q) _ = 1 := by simp
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_curveRisk_le_one · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:526
theorem jfEstimator_worstCurveRisk_le_one

The unit risk bound is uniform over the causal model class. With the specified inputs and conditions, the stated relationship holds.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
mu :
ModelLaw d epsilon → Measure (Fin n → Obs d)
hmu :
∀ Q, IidSampling (observedMarginal Q.1) (mu Q)
sSup (range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q))
≤ 1
Proof (Lean source)
-- @node: jfEstimator_worstCurveRisk_le_one lemma jfEstimator_worstCurveRisk_le_one (n d : ℕ) (epsilon b0 : ℝ) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (mu : ModelLaw d epsilon → Measure (Fin n → Obs d)) (hmu : ∀ Q, IidSampling (observedMarginal Q.1) (mu Q)) : sSup (range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q)) ≤ 1 := by let risks := range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q) by_cases h : risks.Nonempty · change sSup risks ≤ 1 apply csSup_le h rintro _ ⟨Q, rfl⟩ exact jfEstimator_curveRisk_le_one n d epsilon b0 hb0 Q.1 (mu Q) (hmu Q) · have hempty : risks = ∅ := Set.not_nonempty_iff_eq_empty.mp h change sSup risks ≤ 1 simp [hempty]
CausalSmith.Stat.DiscreteBudgetvalueCurve.jfEstimator_worstCurveRisk_le_one · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:548
theorem curve_upper

The curve upper result. Under the he premise, the he' premise, It proves the stated conclusion.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
conclusion 1
n d :
ℕ
b0 :
ℝ
1 ≤ n
2 ≤ d
b0 ∈ Icc (0 : ℝ) (1 / 2)
mu :
ModelLaw d epsilon → Measure (Fin n → Obs d)
(∀ Q, IidSampling (observedMarginal Q.1) (mu Q))
sSup (range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q))
≤ C * min 1 ((d : ℝ) / (n * logAlphabet d))
Proof (Lean source)
theorem curve_upper (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ ∀ n d : ℕ, ∀ b0 : ℝ, 1 ≤ n → 2 ≤ d → b0 ∈ Icc (0 : ℝ) (1 / 2) → ∀ mu : ModelLaw d epsilon → Measure (Fin n → Obs d), (∀ Q, IidSampling (observedMarginal Q.1) (mu Q)) → sSup (range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q)) ≤ C * min 1 ((d : ℝ) / (n * logAlphabet d)) := by obtain ⟨C0, hC0pos, _, hcert⟩ := integrated_process_certificate epsilon he he' let K : ℝ := 3 * (1 + epsilon⁻¹) + 1 let C : ℝ := max 1 (max C0 (4096 * K ^ 2)) have hCpos : 0 < C := lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1) (le_max_left _ _) have hC1 : 1 ≤ C := le_max_left _ _ have hC0 : C0 ≤ C := (le_max_left _ _).trans (le_max_right _ _) have hCK : 4096 * K ^ 2 ≤ C := (le_max_right _ _).trans (le_max_right _ _) refine ⟨C, hCpos, ?_⟩ intro n d b0 hn hd hb0 mu hmu have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) obtain ⟨hLpos, _⟩ := logAlphabet_bounds_curve d (by omega : 1 ≤ d) let r : ℝ := (d : ℝ) / (n * logAlphabet d) have hrnonneg : 0 ≤ r := by dsimp [r]; positivity let risks := range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q) change sSup risks ≤ C * min 1 r by_cases hne : risks.Nonempty · apply csSup_le hne rintro _ ⟨Q, rfl⟩ have hunit := jfEstimator_curveRisk_le_one n d epsilon b0 hb0 Q.1 (mu Q) (hmu Q) by_cases hdsmall : d < 16 · have hemp := jfEstimator_empiricalCurveRisk_le epsilon b0 he he' hn hd hdsmall hb0 Q.1 Q.2 (mu Q) (hmu Q) have halg := empiricalCurveRate_algebra n d hn hd hdsmall K have hscaled : (∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂mu Q) ≤ (4096 * K ^ 2) * r := by exact hemp.trans (by simpa [r, K] using halg) by_cases hbig : 1 ≤ r · rw [min_eq_left hbig] nlinarith [hunit, hC1] · have hsmall : r ≤ 1 := le_of_not_ge hbig rw [min_eq_right hsmall] exact hscaled.trans (mul_le_mul_of_nonneg_right hCK hrnonneg) · have hd16 : 16 ≤ d := by omega by_cases hlarge : (d : ℝ) / logAlphabet d ≤ n · have hratio : r ≤ 1 := by have hnum := (div_le_iff₀ hLpos).1 hlarge apply (div_le_iff₀ (mul_pos hnpos hLpos)).2 nlinarith have hproc := jfEstimator_averagedCurveRisk_le epsilon b0 he he' hn hd16 hlarge hb0 Q.1 Q.2 (mu Q) (hmu Q) obtain ⟨_, _, _, _, _, havg⟩ := hcert n d Q.1 (mu Q) hn hd16 hlarge (hmu Q) Q.2 rw [min_eq_right hratio] calc _ ≤ averagedProcessRisk (n := n) epsilon (observedMarginal Q.1) := hproc _ ≤ C0 * r := by simpa [r, mul_div_assoc] using havg _ ≤ C * r := mul_le_mul_of_nonneg_right hC0 hrnonneg · have hnum := (lt_div_iff₀ hLpos).1 (lt_of_not_ge hlarge) have hratio : 1 ≤ r := by apply (le_div_iff₀ (mul_pos hnpos hLpos)).2 nlinarith rw [min_eq_left hratio] nlinarith [hunit, hC1] · have hempty : risks = ∅ := Set.not_nonempty_iff_eq_empty.mp hne rw [hempty] simpa using mul_nonneg hCpos.le (le_min (by norm_num) hrnonneg)
CausalSmith.Stat.DiscreteBudgetvalueCurve.curve_upper · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TCurveUpper.lean:571
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TDualRepresentation 16 declarations Fractional-knapsack duality and contraction of the dual minimum.

Fractional-knapsack duality and contraction of the dual minimum.

theorem observedMarginal_cellMass_eq_poCellMass

The observed cell mass is the corresponding full-data covariate marginal. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
Q :
j :
Fin d
cellMass (observedMarginal Q) j = poCellMass Q j
Proof (Lean source)
lemma observedMarginal_cellMass_eq_poCellMass {d : ℕ} (Q : PotentialLaw d) (j : Fin d) : cellMass (observedMarginal Q) j = poCellMass Q j := CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal_cellMass Q.val j
CausalSmith.Stat.DiscreteBudgetvalueCurve.observedMarginal_cellMass_eq_poCellMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:13
theorem budget_pairwise_implies_armwise

Joint conditional independence of both potential outcomes implies armwise independence. With the specified inputs and conditions, the stated relationship holds.

Formal statement
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ConditionalExchangeability Q.val
Proof (Lean source)
lemma budget_pairwise_implies_armwise {d : ℕ} (Q : PotentialLaw d) (h : ConditionalExchangeability Q) : CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ConditionalExchangeability Q.val := by intro x r a ya have h00 := h x a false false have h01 := h x a false true have h10 := h x a true false have h11 := h x a true true fin_cases r <;> fin_cases a <;> fin_cases ya all_goals simp [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poArmAtom, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poAtom, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, poJointAtom, poTreatmentAtom, poPairAtom, poCellMass] at h00 h01 h10 h11 ⊢ first | linear_combination h00 + h01 | linear_combination h10 + h11 | linear_combination h00 + h10 | linear_combination h01 + h11
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_pairwise_implies_armwise · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:19
theorem budget_cell_mass_as_totalMass Lemma budget_cell_mass_as_totalMass in the paper ↗

The budget cell mass as total mass result. It proves the stated conclusion.

Formal statement
d :
ℕ
P :
j :
Fin d
totalMass (cellVector P j) = cellMass P j
Proof (Lean source)
lemma budget_cell_mass_as_totalMass {d : ℕ} (P : DiscreteLaw d) (j : Fin d) : totalMass (cellVector P j) = cellMass P j := by simp [totalMass, armMassFn, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_cell_mass_as_totalMass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:41
theorem budget_arm_mass_as_armMassFn Lemma budget_arm_mass_as_armMassFn in the paper ↗

The budget arm mass as arm mass fn result. It proves the stated conclusion.

Formal statement
d :
ℕ
P :
j :
Fin d
a :
Fin 2
Proof (Lean source)
lemma budget_arm_mass_as_armMassFn {d : ℕ} (P : DiscreteLaw d) (j : Fin d) (a : Fin 2) : armMassFn a (cellVector P j) = armMass P (finTwoEquiv a) j := by fin_cases a <;> simp [armMassFn, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass, finTwoEquiv] <;> ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_arm_mass_as_armMassFn · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:51
theorem budget_cell_success_mass Lemma budget_cell_success_mass in the paper ↗

The budget cell success mass result. It proves the stated conclusion.

Formal statement
d :
ℕ
P :
j :
Fin d
a :
Fin 2
cellVector P j (a, 1) = jointMass P j (finTwoEquiv a) true
Proof (Lean source)
lemma budget_cell_success_mass {d : ℕ} (P : DiscreteLaw d) (j : Fin d) (a : Fin 2) : cellVector P j (a, 1) = jointMass P j (finTwoEquiv a) true := by fin_cases a <;> simp [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector, finTwoEquiv]
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_cell_success_mass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:62
theorem budget_armValue_identified

Under causal identification and overlap, the extended arm value is cell mass times mean. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon :
ℝ
Q :
hQ :
j :
Fin d
a :
Fin 2
Proof (Lean source)
lemma budget_armValue_identified {d : ℕ} (epsilon : ℝ) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (j : Fin d) (a : Fin 2) : armValue epsilon a (cellVector (observedMarginal Q) j) = poCellMass Q j * poRegression Q a j := by let P := observedMarginal Q have hm : totalMass (cellVector P j) = cellMass P j := budget_cell_mass_as_totalMass P j have ha : armMassFn a (cellVector P j) = armMass P (finTwoEquiv a) j := budget_arm_mass_as_armMassFn P j a have hy : cellVector P j (a, 1) = jointMass P j (finTwoEquiv a) true := budget_cell_success_mass P j a have hp : cellMass P j = poCellMass Q j := observedMarginal_cellMass_eq_poCellMass Q j by_cases hz : cellMass P j = 0 · change armValue epsilon a (cellVector P j) = poCellMass Q j * poRegression Q a j rw [armValue, hm, ← hp] simp only [hz, zero_mul, zero_div] have hnonneg : 0 ≤ cellMass P j := by unfold cellMass unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass positivity have hpos : 0 < cellMass P j := lt_of_le_of_ne hnonneg (Ne.symm hz) obtain ⟨hlo, hhi⟩ := hQ.overlap j hpos have hsum : cellMass P j = armMass P false j + armMass P true j := by simp [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass] ring have hband : epsilon * cellMass P j ≤ armMass P (finTwoEquiv a) j := by fin_cases a · change epsilon * cellMass P j ≤ armMass P false j change armMass P true j / cellMass P j ≤ 1 - epsilon at hhi rw [div_le_iff₀ hpos] at hhi linarith · change epsilon * cellMass P j ≤ armMass P true j exact (le_div_iff₀ hpos).mp hlo have harm : 0 < armMass P (finTwoEquiv a) j := lt_of_lt_of_le (mul_pos hQ.overlapParameter.1 hpos) hband have hmax : max (armMassFn a (cellVector P j)) (epsilon * totalMass (cellVector P j)) = armMassFn a (cellVector P j) := by rw [hm, ha] exact max_eq_left hband have hident : poRegression Q a j = jointMass P j (finTwoEquiv a) true / armMass P (finTwoEquiv a) j := by exact CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression_eq_outcomeMean_of_pos Q.val Q.property.1 (budget_pairwise_implies_armwise Q hQ.exchangeability) j a hpos harm rw [armValue, hmax, hm, ha, hy, ← hp, hident] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_armValue_identified · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:70
theorem budget_threshold_identified

The observed threshold term is the causal baseline plus the positive effect hinge. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon :
ℝ
Q :
hQ :
j :
Fin d
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
= poCellMass Q j * poRegression Q 0 j + poCellMass Q j * max 0 (effect Q j - lambda)
Proof (Lean source)
lemma budget_threshold_identified {d : ℕ} (epsilon : ℝ) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (j : Fin d) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : thresholdFunReal epsilon lambda (cellVector (observedMarginal Q) j) = poCellMass Q j * poRegression Q 0 j + poCellMass Q j * max 0 (effect Q j - lambda) := by have hp : 0 ≤ poCellMass Q j := by unfold poCellMass unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass positivity have hmax (x : ℝ) : max 0 (poCellMass Q j * x) = poCellMass Q j * max 0 x := by by_cases hx : 0 ≤ x · rw [max_eq_right (mul_nonneg hp hx), max_eq_right hx] · have hxle : x ≤ 0 := le_of_lt (lt_of_not_ge hx) rw [max_eq_left (mul_nonpos_of_nonneg_of_nonpos hp hxle), max_eq_left hxle] simp simp only [thresholdFunReal, dif_pos hlambda, thresholdFun] rw [budget_armValue_identified epsilon Q hQ j 0, budget_armValue_identified epsilon Q hQ j 1, budget_cell_mass_as_totalMass] have hmass : cellMass (observedMarginal Q) j = poCellMass Q j := observedMarginal_cellMass_eq_poCellMass Q j rw [hmass] have hrew : poCellMass Q j * poRegression Q 1 j - poCellMass Q j * poRegression Q 0 j - lambda * poCellMass Q j = poCellMass Q j * (effect Q j - lambda) := by unfold effect ring rw [hrew, hmax]
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_threshold_identified · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:219
theorem budget_dualProcess_identified

The threshold process equals control value plus the sum of positive effect hinges. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon :
ℝ
Q :
hQ :
lambda :
ℝ
hlambda :
lambda ∈ Icc (0 : ℝ) 1
= controlValue Q + ∑ j : Fin d, poCellMass Q j * max 0 (effect Q j - lambda)
Proof (Lean source)
lemma budget_dualProcess_identified {d : ℕ} (epsilon : ℝ) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (lambda : ℝ) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : dualProcessReal epsilon (observedMarginal Q) lambda = controlValue Q + ∑ j : Fin d, poCellMass Q j * max 0 (effect Q j - lambda) := by simp only [dualProcessReal, dif_pos hlambda, dualProcess, controlValue] rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j _ simpa [thresholdFunReal, hlambda] using (budget_threshold_identified epsilon Q hQ j lambda hlambda)
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_dualProcess_identified · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:307
def dualMinimum

The minimum of an indexed shadow-price process on [0,1].

Definition (Lean source)
b :
ℝ
F :
ℝ → ℝ
dualMinimum b F :
ℝ
sInf ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1)

The dual minimum lipschitz result. Under the hF premise, the hG premise, the hM premise, It proves the stated conclusion.

Formal statement
b :
ℝ
F G :
ℝ → ℝ
M :
ℝ
hF :
BddBelow ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1)
hG :
BddBelow ((fun lambda : ℝ => b * lambda + G lambda) '' Icc 0 1)
hM :
∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda - G lambda| ≤ M
|dualMinimum b F - dualMinimum b G| ≤ M
Proof (Lean source)
lemma dualMinimum_lipschitz (b : ℝ) (F G : ℝ → ℝ) (M : ℝ) (hF : BddBelow ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1)) (hG : BddBelow ((fun lambda : ℝ => b * lambda + G lambda) '' Icc 0 1)) (hM : ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda - G lambda| ≤ M) : |dualMinimum b F - dualMinimum b G| ≤ M := by have hneF : ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1).Nonempty := ⟨F 0, 0, by norm_num, by simp⟩ have hneG : ((fun lambda : ℝ => b * lambda + G lambda) '' Icc 0 1).Nonempty := ⟨G 0, 0, by norm_num, by simp⟩ have hFG : dualMinimum b F ≤ dualMinimum b G + M := by have h : dualMinimum b F - M ≤ dualMinimum b G := by unfold dualMinimum apply le_csInf hneG rintro x ⟨lambda, hlambda, rfl⟩ have hleft := csInf_le hF (Set.mem_image_of_mem _ hlambda) have hdiff := (abs_le.mp (hM lambda hlambda)).2 linarith linarith have hGF : dualMinimum b G ≤ dualMinimum b F + M := by have h : dualMinimum b G - M ≤ dualMinimum b F := by unfold dualMinimum apply le_csInf hneF rintro x ⟨lambda, hlambda, rfl⟩ have hleft := csInf_le hG (Set.mem_image_of_mem _ hlambda) have hdiff := (abs_le.mp (hM lambda hlambda)).1 linarith linarith exact abs_le.mpr ⟨by linarith, by linarith⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualMinimum_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:325
theorem weighted_budget_weak_duality Lemma weighted_budget_weak_duality in the paper ↗

The weighted budget weak duality result. Under the hp premise, the hpi premise, the hbudget premise, the hlambda premise, It proves the stated conclusion.

Formal statement
d :
ℕ
p tau pi :
Fin d → ℝ
b lambda :
ℝ
hp :
∀ j, 0 ≤ p j
hpi :
∀ j, pi j ∈ Icc (0 : ℝ) 1
hbudget :
∑ j, p j * pi j ≤ b
hlambda :
0 ≤ lambda
∑ j, p j * pi j * tau j ≤ b * lambda + ∑ j, p j * max 0 (tau j - lambda)
Proof (Lean source)
lemma weighted_budget_weak_duality {d : ℕ} (p tau pi : Fin d → ℝ) (b lambda : ℝ) (hp : ∀ j, 0 ≤ p j) (hpi : ∀ j, pi j ∈ Icc (0 : ℝ) 1) (hbudget : ∑ j, p j * pi j ≤ b) (hlambda : 0 ≤ lambda) : ∑ j, p j * pi j * tau j ≤ b * lambda + ∑ j, p j * max 0 (tau j - lambda) := by have hcell (j : Fin d) : p j * pi j * (tau j - lambda) ≤ p j * max 0 (tau j - lambda) := by rcases hpi j with ⟨hpi0, hpi1⟩ by_cases ht : 0 ≤ tau j - lambda · rw [max_eq_right ht] nlinarith [mul_nonneg (hp j) (sub_nonneg.mpr hpi1), mul_nonneg (hp j) ht] · rw [max_eq_left (le_of_not_ge ht)] nlinarith [mul_nonneg (hp j) hpi0] have hsum : ∑ j, p j * pi j * (tau j - lambda) ≤ ∑ j, p j * max 0 (tau j - lambda) := Finset.sum_le_sum (fun j _ => hcell j) have hbudget' : (∑ j, p j * pi j) * lambda ≤ b * lambda := mul_le_mul_of_nonneg_right hbudget hlambda simp only [mul_sub, Finset.sum_sub_distrib, ← Finset.sum_mul] at hsum linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.weighted_budget_weak_duality · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:356
theorem dualMinimum_uniform_lipschitz Lemma dualMinimum_uniform_lipschitz in the paper ↗

The dual minimum uniform lipschitz result. Under the hF premise, the hG premise, the hM premise, It proves the stated conclusion.

Formal statement
F G :
ℝ → ℝ
M :
ℝ
hF :
∀ b ∈ Icc (0 : ℝ) 1,
BddBelow ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1)
hG :
∀ b ∈ Icc (0 : ℝ) 1,
BddBelow ((fun lambda : ℝ => b * lambda + G lambda) '' Icc 0 1)
hM :
∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda - G lambda| ≤ M
sSup ((fun b : ℝ => |dualMinimum b F - dualMinimum b G|) '' Icc 0 1) ≤ M
Proof (Lean source)
lemma dualMinimum_uniform_lipschitz (F G : ℝ → ℝ) (M : ℝ) (hF : ∀ b ∈ Icc (0 : ℝ) 1, BddBelow ((fun lambda : ℝ => b * lambda + F lambda) '' Icc 0 1)) (hG : ∀ b ∈ Icc (0 : ℝ) 1, BddBelow ((fun lambda : ℝ => b * lambda + G lambda) '' Icc 0 1)) (hM : ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda - G lambda| ≤ M) : sSup ((fun b : ℝ => |dualMinimum b F - dualMinimum b G|) '' Icc 0 1) ≤ M := by apply csSup_le · exact ⟨|dualMinimum 0 F - dualMinimum 0 G|, 0, by norm_num, rfl⟩ · rintro x ⟨b, hb, rfl⟩ exact dualMinimum_lipschitz b F G M (hF b hb) (hG b hb) hM
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualMinimum_uniform_lipschitz · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:382
theorem dualMinimum_uniform_contraction Lemma dualMinimum_uniform_contraction in the paper ↗

The dual minimum uniform contraction result. Under the hF premise, the hG premise, It proves the stated conclusion.

Formal statement
F G :
ℝ → ℝ
hF :
∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda| ≤ B
hG :
∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |G lambda| ≤ B
sSup ((fun b : ℝ => |dualMinimum b F - dualMinimum b G|) '' Icc 0 1)
≤ sSup ((fun lambda : ℝ => |F lambda - G lambda|) '' Icc 0 1)
Proof (Lean source)
lemma dualMinimum_uniform_contraction (F G : ℝ → ℝ) (hF : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |F lambda| ≤ B) (hG : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |G lambda| ≤ B) : sSup ((fun b : ℝ => |dualMinimum b F - dualMinimum b G|) '' Icc 0 1) ≤ sSup ((fun lambda : ℝ => |F lambda - G lambda|) '' Icc 0 1) := by obtain ⟨BF, hBF⟩ := hF obtain ⟨BG, hBG⟩ := hG have hdiff : BddAbove ((fun lambda : ℝ => |F lambda - G lambda|) '' Icc (0 : ℝ) 1) := by refine ⟨BF + BG, ?_⟩ rintro x ⟨lambda, hlambda, rfl⟩ calc |F lambda - G lambda| ≤ |F lambda| + |G lambda| := by simpa using (abs_sub_le (F lambda) 0 (G lambda)) _ ≤ BF + BG := add_le_add (hBF lambda hlambda) (hBG lambda hlambda) have hbelow (H : ℝ → ℝ) (B : ℝ) (hB : ∀ lambda ∈ Icc (0 : ℝ) 1, |H lambda| ≤ B) : ∀ b ∈ Icc (0 : ℝ) 1, BddBelow ((fun lambda : ℝ => b * lambda + H lambda) '' Icc 0 1) := by intro b hb refine ⟨-B, ?_⟩ rintro x ⟨lambda, hlambda, rfl⟩ have hnonneg : 0 ≤ b * lambda := mul_nonneg hb.1 hlambda.1 have hlow := (abs_le.mp (hB lambda hlambda)).1 linarith apply dualMinimum_uniform_lipschitz F G _ (hbelow F BF hBF) (hbelow G BG hBG) intro lambda hlambda exact le_csSup hdiff ⟨lambda, hlambda, rfl⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualMinimum_uniform_contraction · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:396
theorem dualProcessReal_bounded Lemma dualProcessReal_bounded in the paper ↗

The dual process real bounded result. It proves the stated conclusion.

Formal statement
d :
ℕ
epsilon :
ℝ
P :
∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |dualProcessReal epsilon P lambda| ≤ B
Proof (Lean source)
lemma dualProcessReal_bounded {d : ℕ} (epsilon : ℝ) (P : DiscreteLaw d) : ∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |dualProcessReal epsilon P lambda| ≤ B := by let F : ℝ → ℝ := fun lambda => ∑ j : Fin d, (armValue epsilon 0 (cellVector P j) + max 0 (armValue epsilon 1 (cellVector P j) - armValue epsilon 0 (cellVector P j) - lambda * totalMass (cellVector P j))) have hF : Continuous F := by dsimp [F] fun_prop have heq : ∀ lambda ∈ Icc (0 : ℝ) 1, dualProcessReal epsilon P lambda = F lambda := by intro lambda hlambda simp [dualProcessReal, dualProcess, thresholdFun, F, hlambda] have hcont : ContinuousOn (dualProcessReal epsilon P) (Icc (0 : ℝ) 1) := by exact hF.continuousOn.congr fun lambda hlambda => heq lambda hlambda obtain ⟨B, hB⟩ := (isCompact_Icc : IsCompact (Icc (0 : ℝ) 1)).exists_bound_of_continuousOn (f := dualProcessReal epsilon P) hcont exact ⟨B, by simpa only [Real.norm_eq_abs] using hB⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.dualProcessReal_bounded · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:428
theorem budget_dual_weak_bound

Every feasible policy lies below every nonnegative shadow-price objective. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
epsilon :
ℝ
Q :
hQ :
b lambda :
ℝ
hb :
b ∈ Icc (0 : ℝ) 1
hlambda :
lambda ∈ Icc (0 : ℝ) 1
budgetValue Q b ≤ b * lambda + dualProcessReal epsilon (observedMarginal Q) lambda
Proof (Lean source)
lemma budget_dual_weak_bound {d : ℕ} (epsilon : ℝ) (Q : PotentialLaw d) (hQ : CausalModelClass epsilon Q) (b lambda : ℝ) (hb : b ∈ Icc (0 : ℝ) 1) (hlambda : lambda ∈ Icc (0 : ℝ) 1) : budgetValue Q b ≤ b * lambda + dualProcessReal epsilon (observedMarginal Q) lambda := by let S := ((fun pi : Fin d → ℝ => ∑ j, poCellMass Q j * pi j * effect Q j) '' budgetPolicyClass Q ⟨b, hb⟩) have hnonempty : S.Nonempty := by refine ⟨0, fun _ => 0, ?_, by simp [S]⟩ simp [budgetPolicyClass, hb.1] have hp : ∀ j : Fin d, 0 ≤ poCellMass Q j := by intro j unfold poCellMass unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass positivity have hsup : sSup S ≤ b * lambda + ∑ j : Fin d, poCellMass Q j * max 0 (effect Q j - lambda) := by apply csSup_le hnonempty rintro y ⟨pi, hpi, rfl⟩ exact weighted_budget_weak_duality (poCellMass Q) (effect Q) pi b lambda hp hpi.1 hpi.2 hlambda.1 rw [budgetValue, dif_pos hb, budget_dualProcess_identified epsilon Q hQ lambda hlambda] dsimp [S] at hsup linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.budget_dual_weak_bound · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:451
theorem dual_representation

The dual representation result. Under the hd premise, the hQ premise, the he premise, the he' premise, It proves the stated conclusion.

Formal statement
d :
ℕ
epsilon :
ℝ
Q :
hd :
2 ≤ d
hQ :
he :
0 < epsilon
he' :
epsilon < 1 / 2
conclusion 1
b ∈ Set.Icc (0 : ℝ) 1 :
conclusion 2
Fhat :
ℝ → ℝ
(∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |Fhat lambda| ≤ B)
sSup ((fun b : ℝ => |dualMinimum b Fhat - budgetValue Q b|) '' Icc 0 1)
≤ sSup ((fun lambda : ℝ => |Fhat lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)
Proof (Lean source)
theorem dual_representation {d : ℕ} (epsilon : ℝ) (Q : PotentialLaw d) (hd : 2 ≤ d) (hQ : CausalModelClass epsilon Q) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : (∀ b ∈ Icc (0 : ℝ) 1, budgetValue Q b = dualMinimum b (dualProcessReal epsilon (observedMarginal Q))) ∧ (∀ Fhat : ℝ → ℝ, (∃ B : ℝ, ∀ lambda ∈ Icc (0 : ℝ) 1, |Fhat lambda| ≤ B) → sSup ((fun b : ℝ => |dualMinimum b Fhat - budgetValue Q b|) '' Icc 0 1) ≤ sSup ((fun lambda : ℝ => |Fhat lambda - dualProcessReal epsilon (observedMarginal Q) lambda|) '' Icc 0 1)) := by have hdual : ∀ b ∈ Icc (0 : ℝ) 1, budgetValue Q b = dualMinimum b (dualProcessReal epsilon (observedMarginal Q)) := by intro b hb have hweak : budgetValue Q b ≤ dualMinimum b (dualProcessReal epsilon (observedMarginal Q)) := by unfold dualMinimum apply le_csInf · exact ⟨b * 0 + dualProcessReal epsilon (observedMarginal Q) 0, 0, by norm_num, rfl⟩ · rintro y ⟨lambda, hlambda, rfl⟩ exact budget_dual_weak_bound epsilon Q hQ b lambda hb hlambda have hstrong : dualMinimum b (dualProcessReal epsilon (observedMarginal Q)) ≤ budgetValue Q b := by have hp : ∀ j : Fin d, 0 ≤ poCellMass Q j := by intro j unfold poCellMass unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass positivity have ht : ∀ j : Fin d, effect Q j ≤ 1 := by intro j have h0 := (poRegression_unit_interval_budget Q 0 j).1 have h1 := (poRegression_unit_interval_budget Q 1 j).2 unfold effect linarith obtain ⟨pi, hpi, hpibudget, lambda, hlambda, heq⟩ := finite_knapsack_dual_witness (poCellMass Q) (effect Q) b hp ht hb have hpifeas : (fun j => pi j) ∈ budgetPolicyClass Q ⟨b, hb⟩ := ⟨hpi, hpibudget⟩ let gains := ((fun rho : Fin d → ℝ => ∑ j, poCellMass Q j * rho j * effect Q j) '' budgetPolicyClass Q ⟨b, hb⟩) have hgains_bdd : BddAbove gains := by refine ⟨1, ?_⟩ rintro y ⟨rho, hrho, rfl⟩ calc (∑ j, poCellMass Q j * rho j * effect Q j) ≤ ∑ j, poCellMass Q j * rho j := by apply Finset.sum_le_sum intro j _ have hpr : 0 ≤ poCellMass Q j * rho j := mul_nonneg (hp j) (hrho.1 j).1 nlinarith [ht j] _ ≤ b := hrho.2 _ ≤ 1 := hb.2 have hpigain_le : controlValue Q + (∑ j, poCellMass Q j * pi j * effect Q j) ≤ budgetValue Q b := by rw [budgetValue, dif_pos hb] simpa [gains, add_comm] using add_le_add_left (le_csSup hgains_bdd ⟨(fun j => pi j), hpifeas, rfl⟩) (controlValue Q) have hdual_bdd : BddBelow ((fun l : ℝ => b * l + dualProcessReal epsilon (observedMarginal Q) l) '' Icc 0 1) := by obtain ⟨B, hB⟩ := dualProcessReal_bounded epsilon (observedMarginal Q) refine ⟨-B, ?_⟩ rintro y ⟨l, hl, rfl⟩ have hbl : 0 ≤ b * l := mul_nonneg hb.1 hl.1 have hlow := (abs_le.mp (hB l hl)).1 linarith unfold dualMinimum calc sInf ((fun l : ℝ => b * l + dualProcessReal epsilon (observedMarginal Q) l) '' Icc 0 1) ≤ b * lambda + dualProcessReal epsilon (observedMarginal Q) lambda := csInf_le hdual_bdd ⟨lambda, hlambda, rfl⟩ _ = controlValue Q + ∑ j, poCellMass Q j * pi j * effect Q j := by rw [budget_dualProcess_identified epsilon Q hQ lambda hlambda] linarith _ ≤ budgetValue Q b := hpigain_le exact le_antisymm hweak hstrong constructor · exact hdual · intro Fhat hFhat let F := dualProcessReal epsilon (observedMarginal Q) have hcontract := dualMinimum_uniform_contraction Fhat F hFhat (dualProcessReal_bounded epsilon (observedMarginal Q)) have himage : ((fun b : ℝ => |dualMinimum b Fhat - budgetValue Q b|) '' Icc 0 1) = ((fun b : ℝ => |dualMinimum b Fhat - dualMinimum b F|) '' Icc 0 1) := by ext x constructor · rintro ⟨b, hb, rfl⟩ refine ⟨b, hb, ?_⟩ change |dualMinimum b Fhat - dualMinimum b F| = |dualMinimum b Fhat - budgetValue Q b| rw [hdual b hb] · rintro ⟨b, hb, rfl⟩ refine ⟨b, hb, ?_⟩ change |dualMinimum b Fhat - budgetValue Q b| = |dualMinimum b Fhat - dualMinimum b F| rw [hdual b hb] simpa only [himage, F] using hcontract
CausalSmith.Stat.DiscreteBudgetvalueCurve.dual_representation · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TDualRepresentation.lean:478
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TFixedAlphabetReduction 4 declarations Parametric fixed-alphabet specialization and linear budget curves.

Parametric fixed-alphabet specialization and linear budget curves.

theorem poCellMass_nonneg_budget

The po cell mass nonneg budget result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
j :
Fin d
0 ≤ poCellMass Q j
Proof (Lean source)
lemma poCellMass_nonneg_budget {d : ℕ} (Q : PotentialLaw d) (j : Fin d) : 0 ≤ poCellMass Q j := by unfold poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass exact Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => ENNReal.toReal_nonneg
CausalSmith.Stat.DiscreteBudgetvalueCurve.poCellMass_nonneg_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TFixedAlphabetReduction.lean:13
theorem poCellMass_sum_budget

The po cell mass sum budget result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
∑ j : Fin d, poCellMass Q j = 1
Proof (Lean source)
lemma poCellMass_sum_budget {d : ℕ} (Q : PotentialLaw d) : ∑ j : Fin d, poCellMass Q j = 1 := by calc _ = ∑ z : FullObs d, (Q.pmf z).toReal := by simp [poCellMass, PotentialLaw.pmf, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum Q.pmf (fun _ : FullObs d => (1 : ℝ))).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.poCellMass_sum_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TFixedAlphabetReduction.lean:21
theorem constant_effect_budget_value

The constant effect budget value result. Under the hcpos premise, the hc premise, the hb premise, It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
c b :
ℝ
hcpos :
0 < c
hc :
∀ j
if
0 < poCellMass Q j
then
effect Q j = c
hb :
b ∈ Icc (0 : ℝ) 1
budgetValue Q b = controlValue Q + c * b
Proof (Lean source)
lemma constant_effect_budget_value {d : ℕ} (Q : PotentialLaw d) (c b : ℝ) (hcpos : 0 < c) (hc : ∀ j, 0 < poCellMass Q j → effect Q j = c) (hb : b ∈ Icc (0 : ℝ) 1) : budgetValue Q b = controlValue Q + c * b := by have hw (j : Fin d) : 0 ≤ poCellMass Q j := poCellMass_nonneg_budget Q j have hsum : ∑ j, poCellMass Q j = 1 := poCellMass_sum_budget Q have hcell (j : Fin d) (t : ℝ) : poCellMass Q j * t * effect Q j = c * (poCellMass Q j * t) := by by_cases hp : poCellMass Q j = 0 · simp [hp] · have hpos : 0 < poCellMass Q j := lt_of_le_of_ne (hw j) (Ne.symm hp) rw [hc j hpos] ring have hgain (pi : Fin d → ℝ) : (∑ j, poCellMass Q j * pi j * effect Q j) = c * ∑ j, poCellMass Q j * pi j := by simp_rw [hcell] rw [Finset.mul_sum] let pi : Fin d → ℝ := fun _ => b have hpi : pi ∈ budgetPolicyClass Q ⟨b, hb⟩ := by constructor · intro j exact hb · change ∑ j, poCellMass Q j * pi j ≤ b simp only [pi] rw [← Finset.sum_mul, hsum] simp have hupper (rho : Fin d → ℝ) (hrho : rho ∈ budgetPolicyClass Q ⟨b, hb⟩) : ∑ j, poCellMass Q j * rho j * effect Q j ≤ c * b := by rw [hgain] exact mul_le_mul_of_nonneg_left hrho.2 (le_of_lt hcpos) have hhit : ∑ j, poCellMass Q j * pi j * effect Q j = c * b := by rw [hgain] simp only [pi] rw [← Finset.sum_mul, hsum] ring have hsup : sSup ((fun rho : Fin d → ℝ => ∑ j, poCellMass Q j * rho j * effect Q j) '' budgetPolicyClass Q ⟨b, hb⟩) = c * b := by apply le_antisymm · apply csSup_le · exact ⟨_, ⟨pi, hpi, rfl⟩⟩ · rintro x ⟨rho, hrho, rfl⟩ exact hupper rho hrho · rw [← hhit] exact le_csSup (by refine ⟨c * b, ?_⟩ rintro x ⟨rho, hrho, rfl⟩ exact hupper rho hrho) ⟨pi, hpi, rfl⟩ simp only [budgetValue, dif_pos hb] exact congrArg (controlValue Q + ·) hsup
CausalSmith.Stat.DiscreteBudgetvalueCurve.constant_effect_budget_value · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TFixedAlphabetReduction.lean:34
theorem fixed_alphabet_reduction

The fixed alphabet reduction result. Under the he premise, the he' premise, the hd premise, It proves the stated conclusion.

Formal statement
epsilon :
ℝ
d :
ℕ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hd :
2 ≤ d
conclusion 1
∃ c C : ℝ,
0 < c
c ≤ C
n :
ℕ
1 ≤ n
b0 ∈ Set.Icc (0 : ℝ) (1 / 2) :
c / n ≤ curveMinimaxRisk n d epsilon b0
curveMinimaxRisk n d epsilon b0 ≤ C / n
conclusion 2
Q :
c :
ℝ
0 < c
(∀ j, 0 < poCellMass Q j → effect Q j = c)
b0 ∈ Set.Icc (0 : ℝ) (1 / 2) :
b ∈ Set.Icc b0 (1 - b0) :
budgetValue Q b = controlValue Q + c * b
Proof (Lean source)
theorem fixed_alphabet_reduction (epsilon : ℝ) (d : ℕ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hd : 2 ≤ d) (_of_gate : JHWKnownQL1LowerRegime) : (∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ ∀ n : ℕ, 1 ≤ n → ∀ b0 ∈ Icc (0 : ℝ) (1 / 2), c / n ≤ curveMinimaxRisk n d epsilon b0 ∧ curveMinimaxRisk n d epsilon b0 ≤ C / n) ∧ (∀ Q : PotentialLaw d, CausalModelClass epsilon Q → ∀ c : ℝ, 0 < c → (∀ j, 0 < poCellMass Q j → effect Q j = c) → ∀ b0 ∈ Icc (0 : ℝ) (1 / 2), ∀ b ∈ Icc b0 (1 - b0), budgetValue Q b = controlValue Q + c * b) := by have hdreal : (1 : ℝ) < d := by exact_mod_cast (show 1 < d by omega) have hdpos : (0 : ℝ) < d := by linarith have hlog : logAlphabet d = 1 + log d := by unfold logAlphabet rw [Real.log_mul (by positivity : exp 1 ≠ 0) (by positivity : (d : ℝ) ≠ 0)] simp have hlogpos : 0 < logAlphabet d := by rw [hlog] have := Real.log_pos hdreal linarith have hlogle : logAlphabet d ≤ d := by rw [hlog] have := Real.log_le_sub_one_of_pos hdpos linarith let alpha : ℝ := d / logAlphabet d have halpha : 1 ≤ alpha := (le_div_iff₀ hlogpos).2 (by simpa using hlogle) have hrate (n : ℕ) (hn : 1 ≤ n) : 1 / (n : ℝ) ≤ curveRate n d ∧ curveRate n d ≤ alpha / n := by have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hnreal : (1 : ℝ) ≤ n := by exact_mod_cast hn have hratio : (d : ℝ) / (n * logAlphabet d) = alpha / n := by dsimp [alpha] field_simp rw [curveRate, hratio] constructor · apply le_min · exact (div_le_iff₀ hnpos).2 (by nlinarith) · exact div_le_div_of_nonneg_right halpha (le_of_lt hnpos) · exact min_le_right _ _ constructor · obtain ⟨c, C, hcpos, hcC, hfront⟩ := matched_curve_frontier epsilon he he' _of_gate refine ⟨c, C * alpha, hcpos, ?_, ?_⟩ · have hCpos : 0 ≤ C := by linarith nlinarith · intro n hn b0 hb0 have hF := (hfront n d b0 hn hd hb0).1 have hr := hrate n hn have hCpos : 0 ≤ C := by linarith constructor · calc c / n = c * (1 / n) := by ring _ ≤ c * curveRate n d := mul_le_mul_of_nonneg_left hr.1 (le_of_lt hcpos) _ ≤ curveMinimaxRisk n d epsilon b0 := hF.1 · calc curveMinimaxRisk n d epsilon b0 ≤ C * curveRate n d := hF.2 _ ≤ C * (alpha / n) := mul_le_mul_of_nonneg_left hr.2 hCpos _ = (C * alpha) / n := by ring · intro Q _hQ c hcpos hc b0 hb0 b hb have hbi : b ∈ Icc (0 : ℝ) 1 := by constructor · exact le_trans hb0.1 hb.1 · have := hb0.1 linarith [hb.2] exact constant_effect_budget_value Q c b hcpos hc hbi
CausalSmith.Stat.DiscreteBudgetvalueCurve.fixed_alphabet_reduction · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TFixedAlphabetReduction.lean:88
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TIntegratedProcessCertificate 1 declarations Uniform Jackson-factorial threshold-process certificate.

Uniform Jackson-factorial threshold-process certificate.

theorem integrated_process_certificate

The integrated process certificate result. Under the he premise, the he' premise, It proves the stated conclusion.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ C : ℝ,
0 < C
C ∈ processHandle epsilon
conclusion 1
n d :
ℕ
Q :
mu :
Measure (Fin n → Obs d)
1 ≤ n
16 ≤ d
(d : ℝ) / logAlphabet d ≤ n
j :
Fin d
lambda ∈ Set.Icc (0 : ℝ) 1 :
uncappedJacksonCellBias (n := n) epsilon lambda (observedMarginal Q) j
≤ C * (sqrt (poCellMass Q j / (n * logAlphabet d)) + 1 / (n * logAlphabet d))
≤ C * d / (n * logAlphabet d)
j :
Fin d
badPilotCellEnvelope (n := n) epsilon (observedMarginal Q) j
≤ C * (d : ℝ) ^ (1 / 4 : ℝ) * exp (-10 * logAlphabet d) * badPilotCellScale (n := n) (observedMarginal Q) j
≤ C * d / (((n : ℝ) / 8) * logAlphabet d)
idealProcessRisk (n := n) epsilon (observedMarginal Q) ≤ C * d / (n * logAlphabet d)
averagedProcessRisk (n := n) epsilon (observedMarginal Q) ≤ C * d / (n * logAlphabet d)
Proof (Lean source)
theorem integrated_process_certificate (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : ∃ C : ℝ, 0 < C ∧ C ∈ processHandle epsilon ∧ ∀ (n d : ℕ) (Q : PotentialLaw d) (mu : Measure (Fin n → Obs d)), 1 ≤ n → 16 ≤ d → (d : ℝ) / logAlphabet d ≤ n → IidSampling (observedMarginal Q) mu → CausalModelClass epsilon Q → (∀ j : Fin d, ∀ lambda ∈ Icc (0 : ℝ) 1, uncappedJacksonCellBias (n := n) epsilon lambda (observedMarginal Q) j ≤ C * (sqrt (poCellMass Q j / (n * logAlphabet d)) + 1 / (n * logAlphabet d))) ∧ centeredIdealPilotErrorRisk (n := n) epsilon (observedMarginal Q) true ≤ C * d / (n * logAlphabet d) ∧ (∀ j : Fin d, badPilotCellEnvelope (n := n) epsilon (observedMarginal Q) j ≤ C * (d : ℝ) ^ (1 / 4 : ℝ) * exp (-10 * logAlphabet d) * badPilotCellScale (n := n) (observedMarginal Q) j) ∧ centeredIdealPilotErrorRisk (n := n) epsilon (observedMarginal Q) false ≤ C * d / (((n : ℝ) / 8) * logAlphabet d) ∧ idealProcessRisk (n := n) epsilon (observedMarginal Q) ≤ C * d / (n * logAlphabet d) ∧ averagedProcessRisk (n := n) epsilon (observedMarginal Q) ≤ C * d / (n * logAlphabet d) := by obtain ⟨Ccoeff, hCcoeff, hcoeff⟩ := jacksonCoefficientBV_pilot_le epsilon he he' obtain ⟨Cbias, hCbias, hbias⟩ := uncappedJacksonCellBias_le_rate epsilon he he' obtain ⟨Cgood, hCgood, hgood⟩ := centeredIdealGoodPilotErrorRisk_le_rate epsilon he he' obtain ⟨Cenv, hCenv, henv⟩ := badPilotCellEnvelope_le epsilon he obtain ⟨Cbad, hCbad, hbad⟩ := centeredIdealBadPilotErrorRisk_le_rate epsilon he obtain ⟨Ccap, hCcap, hcap⟩ := capTransferRisk epsilon he he' let Ki : ℝ := 24 * Cgood + 24 * Cbad + 432 * Cbias ^ 2 let C : ℝ := 1 + Ccoeff + exp 115 + 8 * Cbias + 8 * Cgood + Cenv + Cbad + Ki + Ccap * (Ki + 16) have hKi : 0 < Ki := by dsimp [Ki]; positivity have hC : 0 < C := by dsimp [C]; positivity have hcapKi : 0 < Ccap * (Ki + 16) := by positivity have hcoeffC : Ccoeff ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have hexpC : exp 115 ≤ C := by dsimp [C]; nlinarith have hbiasC : 8 * Cbias ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have hgoodC : 8 * Cgood ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have henvC : Cenv ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have hbadC : Cbad ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have hidealC : Ki ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have havgC : Ccap * (Ki + 16) ≤ C := by dsimp [C]; nlinarith [Real.exp_pos 115] have hbiasBaseC : Cbias ≤ C := by nlinarith have hgoodBaseC : Cgood ≤ C := by nlinarith refine ⟨C, hC, ?_, ?_⟩ · refine ⟨hC, ?_⟩ intro n d P hn hd hbranch have hL : 0 < logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] positivity have hprob : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P refine ⟨?_, ?_, ?_, ?_, ?_⟩ · intro pilot dsimp only constructor · calc jacksonCoefficientBV epsilon ((n : ℝ) / 8) d pilot ≤ Ccoeff * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta) * exp (12 * jacksonDegree d) := hcoeff ((n : ℝ) / 8) (by positivity) d (by omega) pilot _ ≤ C * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta) * exp (12 * jacksonDegree d) := by have hsum : 0 ≤ ∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta := Finset.sum_nonneg fun z _ => (pilotRadius_pos_of_pos (by positivity) (by omega) pilot z).le exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hcoeffC hsum) (Real.exp_nonneg _) · have hdegree := jacksonDegree_exponential_budget d hd calc (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta) ^ 2 * exp (24 * jacksonDegree d + 16 * (jacksonDegree d : ℝ) ^ 2 / logAlphabet d) ≤ (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta) ^ 2 * (exp 115 * (d : ℝ) ^ (1 / 16 : ℝ)) := by gcongr _ = exp 115 * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta) ^ 2 := by ring _ ≤ C * (d : ℝ) ^ (1 / 16 : ℝ) * (∑ zeta : Cell, pilotRadius ((n : ℝ) / 8) d pilot zeta) ^ 2 := by gcongr · exact (hgood hn hd hbranch P hprob).trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hgoodBaseC (Nat.cast_nonneg d)) (by positivity)) · intro j lambda hlambda exact (hbias hn hd P j lambda hlambda).trans (mul_le_mul_of_nonneg_right hbiasBaseC (add_nonneg (Real.sqrt_nonneg _) (one_div_nonneg.mpr (by positivity)))) · intro j have hscale : 0 ≤ badPilotCellScale (n := n) P j := by unfold badPilotCellScale exact add_nonneg (Real.sqrt_nonneg _) (div_nonneg hL.le (by positivity)) exact (henv hn (by omega) P j).trans (by exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right henvC (Real.rpow_nonneg (by positivity) _)) (Real.exp_nonneg _)) hscale) · exact (hbad hn hd hbranch P hprob).trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hbadC (Nat.cast_nonneg d)) (by positivity)) · intro n d Q mu hn hd hbranch _hsampling _hmodel let P := observedMarginal Q have hL : 0 < logAlphabet d := by unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] positivity have hden : 0 ≤ (n : ℝ) * logAlphabet d := by positivity have hprob : IsProbabilityMeasure (idealCountLaw (n := n) P) := idealCountLaw_isProbabilityMeasure P have hgoodP := hgood hn hd hbranch P hprob have hbadP := hbad hn hd hbranch P hprob have hidealP : idealProcessRisk (n := n) epsilon P ≤ Ki * d / ((n : ℝ) * logAlphabet d) := by simpa [Ki] using idealProcessRisk_le_rate epsilon he he' hn hd hbranch P Cbias Cgood Cbad hCbias.le (hbias hn hd P) hgoodP hbadP have havgP : averagedProcessRisk (n := n) epsilon P ≤ (Ccap * (Ki + 16)) * d / ((n : ℝ) * logAlphabet d) := by calc _ ≤ Ccap * (idealProcessRisk (n := n) epsilon P + exp (-(n : ℝ) / 16)) := hcap n d hn hd P _ ≤ Ccap * (Ki * d / ((n : ℝ) * logAlphabet d) + 16 * d / ((n : ℝ) * logAlphabet d)) := by gcongr exact exponential_cap_remainder_le_rate hn hd _ = (Ccap * (Ki + 16)) * d / ((n : ℝ) * logAlphabet d) := by ring refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · intro j lambda hlambda have hmass : cellMass P j = poCellMass Q j := observedMarginal_cellMass_local Q j calc uncappedJacksonCellBias (n := n) epsilon lambda P j ≤ Cbias * (sqrt (cellMass P j / (((n : ℝ) / 8) * logAlphabet d)) + 1 / (((n : ℝ) / 8) * logAlphabet d)) := hbias hn hd P j lambda hlambda _ ≤ Cbias * (8 * (sqrt (cellMass P j / ((n : ℝ) * logAlphabet d)) + 1 / ((n : ℝ) * logAlphabet d))) := by gcongr exact pilot_bias_scale_eight hn (by omega) P j _ = (8 * Cbias) * (sqrt (poCellMass Q j / ((n : ℝ) * logAlphabet d)) + 1 / ((n : ℝ) * logAlphabet d)) := by rw [hmass]; ring _ ≤ C * (sqrt (poCellMass Q j / ((n : ℝ) * logAlphabet d)) + 1 / ((n : ℝ) * logAlphabet d)) := by exact mul_le_mul_of_nonneg_right hbiasC (add_nonneg (Real.sqrt_nonneg _) (one_div_nonneg.mpr hden)) · calc centeredIdealPilotErrorRisk (n := n) epsilon P true ≤ Cgood * d / (((n : ℝ) / 8) * logAlphabet d) := hgoodP _ = (8 * Cgood) * d / ((n : ℝ) * logAlphabet d) := by ring _ ≤ C * d / ((n : ℝ) * logAlphabet d) := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hgoodC (Nat.cast_nonneg d)) hden · intro j have hscale : 0 ≤ badPilotCellScale (n := n) P j := by unfold badPilotCellScale exact add_nonneg (Real.sqrt_nonneg _) (div_nonneg hL.le (by positivity)) exact (henv hn (by omega) P j).trans (by exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right henvC (Real.rpow_nonneg (by positivity) _)) (Real.exp_nonneg _)) hscale) · exact hbadP.trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hbadC (Nat.cast_nonneg d)) (by positivity)) · exact hidealP.trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hidealC (Nat.cast_nonneg d)) hden) · exact havgP.trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right havgC (Nat.cast_nonneg d)) hden)
CausalSmith.Stat.DiscreteBudgetvalueCurve.integrated_process_certificate · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TIntegratedProcessCertificate.lean:587
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TMatchedCurveFrontier 12 declarations The matched all-procedure budget-curve frontier.

The matched all-procedure budget-curve frontier.

theorem curve_coordinate_in_budget_interval Lemma curve_coordinate_in_budget_interval in the paper ↗

The curve coordinate in budget interval result. Under the hb0 premise, It proves the stated conclusion.

Formal statement
b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
(1 / 2 : ℝ) ∈ Icc b0 (1 - b0)
Proof (Lean source)
lemma curve_coordinate_in_budget_interval (b0 : ℝ) (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) : (1 / 2 : ℝ) ∈ Icc b0 (1 - b0) := by constructor <;> linarith [hb0.2]
CausalSmith.Stat.DiscreteBudgetvalueCurve.curve_coordinate_in_budget_interval · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:15
theorem curve_loss_pointwise_bound

The curve loss pointwise bound result. Under the hb0 premise, the hB premise, It proves the stated conclusion.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
est :
Q :
ModelLaw d epsilon
B :
ℝ
hB :
∀ z b, |est.1 z b| ≤ B
z :
Fin n → Obs d
b :
Icc b0 (1 - b0)
(est.1 z b - budgetValue Q.1 b.1) ^ 2 ≤ (B + 1) ^ 2
Proof (Lean source)
lemma curve_loss_pointwise_bound {n d : ℕ} {epsilon b0 : ℝ} (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (est : CurveEstimator n d b0) (Q : ModelLaw d epsilon) (B : ℝ) (hB : ∀ z b, |est.1 z b| ≤ B) (z : Fin n → Obs d) (b : Icc b0 (1 - b0)) : (est.1 z b - budgetValue Q.1 b.1) ^ 2 ≤ (B + 1) ^ 2 := by have hbi : b.1 ∈ Icc (0 : ℝ) 1 := by constructor · exact le_trans hb0.1 b.2.1 · linarith [b.2.2, hb0.1] obtain ⟨hv0, hv1⟩ := budgetValue_unit_interval Q.1 b.1 hbi obtain ⟨he0, he1⟩ := abs_le.mp (hB z b) apply sq_le_sq' · linarith · linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.curve_loss_pointwise_bound · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:22
theorem curve_loss_sup_bound

The curve loss sup bound result. Under the hb0 premise, the hB premise, It proves the stated conclusion.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
est :
Q :
ModelLaw d epsilon
B :
ℝ
hB :
∀ z b, |est.1 z b| ≤ B
z :
Fin n → Obs d
(⨆ b : Icc b0 (1 - b0), (est.1 z b - budgetValue Q.1 b.1) ^ 2) ≤ (B + 1) ^ 2
Proof (Lean source)
lemma curve_loss_sup_bound {n d : ℕ} {epsilon b0 : ℝ} (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (est : CurveEstimator n d b0) (Q : ModelLaw d epsilon) (B : ℝ) (hB : ∀ z b, |est.1 z b| ≤ B) (z : Fin n → Obs d) : (⨆ b : Icc b0 (1 - b0), (est.1 z b - budgetValue Q.1 b.1) ^ 2) ≤ (B + 1) ^ 2 := by letI : Nonempty (Icc b0 (1 - b0)) := ⟨⟨1 / 2, curve_coordinate_in_budget_interval b0 hb0⟩⟩ exact ciSup_le fun b => curve_loss_pointwise_bound hb0 est Q B hB z b
CausalSmith.Stat.DiscreteBudgetvalueCurve.curve_loss_sup_bound · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:40
theorem curve_risk_bddAbove

The curve risk bdd above result. Under the hb0 premise, It proves the stated conclusion.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
est :
BddAbove (range (curveRisk n (d := d) (epsilon := epsilon) b0 est))
Proof (Lean source)
lemma curve_risk_bddAbove {n d : ℕ} {epsilon b0 : ℝ} (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (est : CurveEstimator n d b0) : BddAbove (range (curveRisk n (d := d) (epsilon := epsilon) b0 est)) := by obtain ⟨B, hB⟩ := est.2.2.2 refine ⟨(B + 1) ^ 2, ?_⟩ rintro x ⟨Q, rfl⟩ unfold curveRisk calc (∫ z, (⨆ b : Icc b0 (1 - b0), (est.1 z b - budgetValue Q.1 b.1) ^ 2) ∂productLaw (observedMarginal Q.1) n) ≤ ∫ _z, (B + 1) ^ 2 ∂productLaw (observedMarginal Q.1) n := by apply integral_mono (Integrable.of_finite) (integrable_const _) intro z exact curve_loss_sup_bound hb0 est Q B hB z _ = (B + 1) ^ 2 := by simp
CausalSmith.Stat.DiscreteBudgetvalueCurve.curve_risk_bddAbove · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:53
theorem curve_risk_nonneg

The curve risk nonneg result. Under the hb0 premise, It proves the stated conclusion.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
est :
Q :
ModelLaw d epsilon
0 ≤ curveRisk n b0 est Q
Proof (Lean source)
lemma curve_risk_nonneg {n d : ℕ} {epsilon b0 : ℝ} (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (est : CurveEstimator n d b0) (Q : ModelLaw d epsilon) : 0 ≤ curveRisk n b0 est Q := by obtain ⟨B, hB⟩ := est.2.2.2 unfold curveRisk apply integral_nonneg intro z have hbdd : BddAbove (range (fun b : Icc b0 (1 - b0) => (est.1 z b - budgetValue Q.1 b.1) ^ 2)) := by exact ⟨(B + 1) ^ 2, by rintro x ⟨b, rfl⟩ exact curve_loss_pointwise_bound hb0 est Q B hB z b⟩ calc 0 ≤ (est.1 z ⟨1 / 2, curve_coordinate_in_budget_interval b0 hb0⟩ - budgetValue Q.1 (1 / 2)) ^ 2 := sq_nonneg _ _ ≤ ⨆ b : Icc b0 (1 - b0), (est.1 z b - budgetValue Q.1 b.1) ^ 2 := le_ciSup hbdd ⟨1 / 2, curve_coordinate_in_budget_interval b0 hb0⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.curve_risk_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:72
def scalar_coordinate_of_curve_estimator

For n, b0, hb0, est, the scalar coordinate of curve estimator definition specifies the stated object.

Definition (Lean source)
n d :
ℕ
b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
est :
scalar_coordinate_of_curve_estimator hb0 est :
⟨fun z => est.1 z ⟨1 / 2, curve_coordinate_in_budget_interval b0 hb0⟩, by fun_prop⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.scalar_coordinate_of_curve_estimator · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:94
theorem scalar_coordinate_risk_le_curve_risk

The scalar coordinate risk le curve risk result. Under the hb0 premise, It proves the stated conclusion.

Formal statement
n d :
ℕ
epsilon b0 :
ℝ
hb0 :
b0 ∈ Icc (0 : ℝ) (1 / 2)
est :
Q :
ModelLaw d epsilon
sqRisk (productLaw (observedMarginal Q.1) n) (scalar_coordinate_of_curve_estimator hb0 est).1 (budgetValue Q.1 (1 / 2))
≤ curveRisk n b0 est Q
Proof (Lean source)
lemma scalar_coordinate_risk_le_curve_risk {n d : ℕ} {epsilon b0 : ℝ} (hb0 : b0 ∈ Icc (0 : ℝ) (1 / 2)) (est : CurveEstimator n d b0) (Q : ModelLaw d epsilon) : sqRisk (productLaw (observedMarginal Q.1) n) (scalar_coordinate_of_curve_estimator hb0 est).1 (budgetValue Q.1 (1 / 2)) ≤ curveRisk n b0 est Q := by obtain ⟨B, hB⟩ := est.2.2.2 unfold sqRisk curveRisk apply integral_mono (Integrable.of_finite) (Integrable.of_finite) intro z have hbdd : BddAbove (range (fun b : Icc b0 (1 - b0) => (est.1 z b - budgetValue Q.1 b.1) ^ 2)) := by exact ⟨(B + 1) ^ 2, by rintro x ⟨b, rfl⟩ exact curve_loss_pointwise_bound hb0 est Q B hB z b⟩ exact le_ciSup hbdd ⟨1 / 2, curve_coordinate_in_budget_interval b0 hb0⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.scalar_coordinate_risk_le_curve_risk · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:103
theorem curveRate_nonneg

The curve rate nonneg result. Under the hn premise, the hd premise, It proves the stated conclusion.

Formal statement
n d :
ℕ
hn :
1 ≤ n
hd :
2 ≤ d
0 ≤ curveRate n d
Proof (Lean source)
lemma curveRate_nonneg (n d : ℕ) (hn : 1 ≤ n) (hd : 2 ≤ d) : 0 ≤ curveRate n d := by have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hdgt : (1 : ℝ) < d := by exact_mod_cast (show 1 < d by omega) have hlog : 0 < logAlphabet d := by unfold logAlphabet exact Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith) unfold curveRate apply le_min · norm_num · positivity
CausalSmith.Stat.DiscreteBudgetvalueCurve.curveRate_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:122
theorem full_budget_cell_mass_nonneg

The full budget cell mass nonneg result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
j :
Fin d
0 ≤ poCellMass Q j
Proof (Lean source)
lemma full_budget_cell_mass_nonneg {d : ℕ} (Q : PotentialLaw d) (j : Fin d) : 0 ≤ poCellMass Q j := by unfold poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass exact Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => ENNReal.toReal_nonneg
CausalSmith.Stat.DiscreteBudgetvalueCurve.full_budget_cell_mass_nonneg · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:138
theorem full_budget_cell_mass_sum

The full budget cell mass sum result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
∑ j : Fin d, poCellMass Q j = 1
Proof (Lean source)
lemma full_budget_cell_mass_sum {d : ℕ} (Q : PotentialLaw d) : ∑ j : Fin d, poCellMass Q j = 1 := by calc _ = ∑ z : FullObs d, (Q.pmf z).toReal := by simp [poCellMass, PotentialLaw.pmf, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum Q.pmf (fun _ : FullObs d => (1 : ℝ))).symm
CausalSmith.Stat.DiscreteBudgetvalueCurve.full_budget_cell_mass_sum · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:146
theorem full_budget_value

The full budget value result. It proves the stated conclusion.

Formal statement
d :
ℕ
Q :
budgetValue Q 1 = controlValue Q + ∑ j : Fin d, poCellMass Q j * max (effect Q j) 0
Proof (Lean source)
lemma full_budget_value {d : ℕ} (Q : PotentialLaw d) : budgetValue Q 1 = controlValue Q + ∑ j : Fin d, poCellMass Q j * max (effect Q j) 0 := by let pi : Fin d → ℝ := fun j => if 0 ≤ effect Q j then 1 else 0 have hpi : pi ∈ budgetPolicyClass Q ⟨1, by norm_num⟩ := by constructor · intro j dsimp [pi] split_ifs <;> norm_num · change ∑ j, poCellMass Q j * pi j ≤ (1 : ℝ) calc _ ≤ ∑ j : Fin d, poCellMass Q j := by apply Finset.sum_le_sum intro j _ apply mul_le_of_le_one_right (full_budget_cell_mass_nonneg Q j) dsimp [pi] split_ifs <;> norm_num _ = 1 := by exact full_budget_cell_mass_sum Q have hpoint (j : Fin d) : poCellMass Q j * pi j * effect Q j = poCellMass Q j * max (effect Q j) 0 := by dsimp [pi] by_cases h : 0 ≤ effect Q j · simp [h] · have hle : effect Q j ≤ 0 := le_of_lt (lt_of_not_ge h) simp [h, max_eq_right hle] have hupper (rho : Fin d → ℝ) (hrho : rho ∈ budgetPolicyClass Q ⟨1, by norm_num⟩) : (∑ j, poCellMass Q j * rho j * effect Q j) ≤ ∑ j, poCellMass Q j * max (effect Q j) 0 := by apply Finset.sum_le_sum intro j _ have hp := full_budget_cell_mass_nonneg Q j have hlo := (hrho.1 j).1 have hhi := (hrho.1 j).2 by_cases h : 0 ≤ effect Q j · rw [max_eq_left h] calc poCellMass Q j * rho j * effect Q j = poCellMass Q j * (rho j * effect Q j) := by ring _ ≤ poCellMass Q j * (1 * effect Q j) := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hhi h) hp _ = poCellMass Q j * effect Q j := by ring · have hle : effect Q j ≤ 0 := le_of_lt (lt_of_not_ge h) rw [max_eq_right hle, mul_zero] have hneg : rho j * effect Q j ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hlo hle calc poCellMass Q j * rho j * effect Q j = poCellMass Q j * (rho j * effect Q j) := by ring _ ≤ poCellMass Q j * 0 := mul_le_mul_of_nonneg_left hneg hp _ = 0 := mul_zero _ have hhit : (∑ j, poCellMass Q j * pi j * effect Q j) = ∑ j, poCellMass Q j * max (effect Q j) 0 := by apply Finset.sum_congr rfl intro j _ exact hpoint j have hsup : sSup ((fun rho : Fin d → ℝ => ∑ j, poCellMass Q j * rho j * effect Q j) '' budgetPolicyClass Q ⟨1, by norm_num⟩) = ∑ j, poCellMass Q j * max (effect Q j) 0 := by apply le_antisymm · apply csSup_le · exact ⟨_, ⟨pi, hpi, rfl⟩⟩ · rintro x ⟨rho, hrho, rfl⟩ exact hupper rho hrho · rw [← hhit] exact le_csSup (by refine ⟨∑ j : Fin d, poCellMass Q j * max (effect Q j) 0, ?_⟩ rintro x ⟨rho, hrho, rfl⟩ exact hupper rho hrho) ⟨pi, hpi, rfl⟩ simp only [budgetValue, dif_pos (show (1 : ℝ) ∈ Icc 0 1 by norm_num)] exact congrArg (controlValue Q + ·) hsup
CausalSmith.Stat.DiscreteBudgetvalueCurve.full_budget_value · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:159
theorem matched_curve_frontier

The matched curve frontier result. Under the he premise, the he' premise, It proves the stated conclusion.

Formal statement
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
∃ c C : ℝ,
0 < c
c ≤ C
conclusion 1
n d :
ℕ
b0 :
ℝ
1 ≤ n
2 ≤ d
b0 ∈ Icc (0 : ℝ) (1 / 2)
c * curveRate n d ≤ curveMinimaxRisk n d epsilon b0
curveMinimaxRisk n d epsilon b0 ≤ C * curveRate n d
T :
∃ Q : PotentialLaw d,
Q ∈ capacityHardClass d epsilon
j :
Fin d
0 < poCellMass Q j
0 < effect Q j
budgetValue Q 1 = 1 / 2
c * curveRate n d
≤ sqRisk (productLaw (observedMarginal Q) n) T.1 (budgetValue Q (1 / 2))
b0 = 0
Q :
ModelLaw d epsilon
= controlValue Q.1 + ∑ j : Fin d, poCellMass Q.1 j * max (effect Q.1 j) 0
Proof (Lean source)
theorem matched_curve_frontier (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (_of_gate : JHWKnownQL1LowerRegime) : ∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ ∀ n d : ℕ, ∀ b0 : ℝ, 1 ≤ n → 2 ≤ d → b0 ∈ Icc (0 : ℝ) (1 / 2) → (c * curveRate n d ≤ curveMinimaxRisk n d epsilon b0 ∧ curveMinimaxRisk n d epsilon b0 ≤ C * curveRate n d) ∧ (∀ T : ScalarEstimator n d, ∃ Q : PotentialLaw d, Q ∈ capacityHardClass d epsilon ∧ (∀ j : Fin d, 0 < poCellMass Q j → 0 < effect Q j) ∧ BindingHalfBudget Q ∧ budgetValue Q 1 = 1 / 2 ∧ c * curveRate n d ≤ sqRisk (productLaw (observedMarginal Q) n) T.1 (budgetValue Q (1 / 2))) ∧ (b0 = 0 → ∀ Q : ModelLaw d epsilon, budgetValue Q.1 1 = controlValue Q.1 + ∑ j : Fin d, poCellMass Q.1 j * max (effect Q.1 j) 0) := by obtain ⟨c, hc, hlower⟩ := capacity_active_lower epsilon he he' _of_gate obtain ⟨C, hC, hupper⟩ := curve_upper epsilon he he' refine ⟨c, C + c, hc, by linarith, ?_⟩ intro n d b0 hn hd hb0 let mu : PotentialLaw d → Measure (Fin n → Obs d) := fun Q => productLaw (observedMarginal Q) n have hmu : ∀ Q, IidSampling (observedMarginal Q) (mu Q) := by intro Q rfl have hrate := curveRate_nonneg n d hn hd have hmodel_nonempty : Nonempty (ModelLaw d epsilon) := by let T : ScalarEstimator n d := ⟨fun _ => 0, by fun_prop⟩ obtain ⟨Q, hQ, _⟩ := hlower n d hn hd mu hmu T exact ⟨⟨Q, hQ.1⟩⟩ letI : Nonempty (ModelLaw d epsilon) := hmodel_nonempty letI : Nonempty (CurveEstimator n d b0) := ⟨jfCurveEstimator n d epsilon b0 hb0⟩ have hminlower : c * curveRate n d ≤ curveMinimaxRisk n d epsilon b0 := by unfold curveMinimaxRisk apply le_minimaxValue intro est obtain ⟨Q, hQ, hrisk⟩ := hlower n d hn hd mu hmu (scalar_coordinate_of_curve_estimator hb0 est) let Qm : ModelLaw d epsilon := ⟨Q, hQ.1⟩ calc c * curveRate n d ≤ sqRisk (mu Q) (scalar_coordinate_of_curve_estimator hb0 est).1 (budgetValue Q (1 / 2)) := hrisk _ ≤ curveRisk n b0 est Qm := scalar_coordinate_risk_le_curve_risk hb0 est Qm _ ≤ worstCaseRiskReal (curveRisk n (d := d) (epsilon := epsilon) b0) est := le_worstCaseRisk (curve_risk_bddAbove hb0 est) Qm have hminupper : curveMinimaxRisk n d epsilon b0 ≤ C * curveRate n d := by unfold curveMinimaxRisk calc minimaxValueReal (curveRisk n (d := d) (epsilon := epsilon) b0) ≤ worstCaseRiskReal (curveRisk n (d := d) (epsilon := epsilon) b0) (jfCurveEstimator n d epsilon b0 hb0) := by exact minimaxValue_le_worstCaseRisk_of_nonneg (fun est Q => curve_risk_nonneg hb0 est Q) _ _ ≤ C * curveRate n d := by apply worstCaseRisk_le intro Q have hup := hupper n d b0 hn hd hb0 (fun Q : ModelLaw d epsilon => productLaw (observedMarginal Q.1) n) (by intro Q; rfl) have hmem : curveRisk n b0 (jfCurveEstimator n d epsilon b0 hb0) Q ≤ sSup (range (fun Q : ModelLaw d epsilon => ∫ z, (⨆ b : Icc b0 (1 - b0), (jfEstimator n d epsilon b0 z b - budgetValue Q.1 b.1) ^ 2) ∂productLaw (observedMarginal Q.1) n)) := by apply le_csSup · change BddAbove (range (curveRisk n b0 (jfCurveEstimator n d epsilon b0 hb0))) exact curve_risk_bddAbove hb0 (jfCurveEstimator n d epsilon b0 hb0) · exact ⟨Q, rfl⟩ exact hmem.trans (by simpa [curveRate, curveRisk, jfCurveEstimator] using hup) refine ⟨⟨hminlower, ?_⟩, ?_, ?_⟩ · calc curveMinimaxRisk n d epsilon b0 ≤ C * curveRate n d := hminupper _ ≤ (C + c) * curveRate n d := by nlinarith · intro T obtain ⟨Q, hQ, hrisk⟩ := hlower n d hn hd mu hmu T rcases hQ with ⟨hmodel, hvalue, heffect, hbinding⟩ refine ⟨Q, ⟨hmodel, hvalue, heffect, hbinding⟩, ?_, hbinding, hvalue, hrisk⟩ intro j hj have hlow := (heffect j hj).1 linarith · intro _ Q exact full_budget_value Q.1
CausalSmith.Stat.DiscreteBudgetvalueCurve.matched_curve_frontier · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TMatchedCurveFrontier.lean:234
CausalSmith.Stat.STAT_DiscreteBudgetvalueCurve_Research.TPairedCapacityIdentity 16 declarations The positive-effect paired family and its exact fixed-sample reduction.

The positive-effect paired family and its exact fixed-sample reduction.

theorem observedMarginal_armMass_eq_poTreatmentAtom

The observed arm mass is the corresponding full-data treatment marginal. With the specified inputs and conditions, the stated relationship holds.

Formal statement
d :
ℕ
Q :
j :
Fin d
a :
Proof (Lean source)
lemma observedMarginal_armMass_eq_poTreatmentAtom {d : ℕ} (Q : PotentialLaw d) (j : Fin d) (a : Bool) : armMass (observedMarginal Q) a j = poTreatmentAtom Q j a := by simp [CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass, poTreatmentAtom, CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal_jointMass]
CausalSmith.Stat.DiscreteBudgetvalueCurve.observedMarginal_armMass_eq_poTreatmentAtom · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:15

Binding capacity with an attaining randomized policy.

Definition (Lean source)
d :
ℕ
Q :
BindingHalfBudget Q :
Prop
∃ pi ∈ budgetPolicyClass Q ⟨1 / 2,
clause 1
by norm_num⟩, (∑ j, poCellMass Q j * pi j) = 1 / 2
clause 2
budgetValue Q (1 / 2) = controlValue Q + ∑ j, poCellMass Q j * pi j * effect Q j
CausalSmith.Stat.DiscreteBudgetvalueCurve.BindingHalfBudget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:23
theorem normalizedPairedParameters Lemma normalizedPairedParameters in the paper ↗

The two sampled simplex vectors give valid pair masses and contrasts. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S :
ProbabilitySimplex k
∃ r : ProbabilitySimplex k, ∃ theta : PairedContrasts k,
conclusion 1
i :
r.1 i = (R.1 i + S.1 i) / 2
conclusion 2
i :
theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
Proof (Lean source)
-- @node: normalizedPairedParameters lemma normalizedPairedParameters {k : ℕ} (R S : ProbabilitySimplex k) : ∃ r : ProbabilitySimplex k, ∃ theta : PairedContrasts k, (∀ i, r.1 i = (R.1 i + S.1 i) / 2) ∧ (∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) := by let r : ProbabilitySimplex k := ⟨fun i => (R.1 i + S.1 i) / 2, by constructor · intro i exact div_nonneg (add_nonneg (R.2.1 i) (S.2.1 i)) (by norm_num) · simp only [← Finset.sum_div, Finset.sum_add_distrib, R.2.2, S.2.2] norm_num⟩ let theta : PairedContrasts k := ⟨fun i => if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i)), by intro i have hR := R.2.1 i have hS := S.2.1 i by_cases h : R.1 i + S.1 i = 0 · simp only [h, ↓reduceIte, Set.mem_Icc] constructor <;> norm_num · have hp : 0 < R.1 i + S.1 i := lt_of_le_of_ne (add_nonneg hR hS) (Ne.symm h) simp only [h, ↓reduceIte, Set.mem_Icc] constructor · apply (le_div_iff₀ (by positivity)).2 nlinarith [hR, hS] · apply (div_le_iff₀ (by positivity)).2 nlinarith [hR, hS]⟩ exact ⟨r, theta, fun _ => rfl, fun _ => rfl⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.normalizedPairedParameters · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:30

The normalized embedding converts the paired capacity term to L1 distance. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
R S r :
ProbabilitySimplex k
theta :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
(∑ i, r.1 i * |theta.1 i|) = simplexL1 R S / 16
Proof (Lean source)
-- @node: normalizedPairedL1 lemma normalizedPairedL1 {k : ℕ} (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) : (∑ i, r.1 i * |theta.1 i|) = simplexL1 R S / 16 := by rw [simplexL1, simplexL1, Finset.sum_div] apply Finset.sum_congr rfl intro i _ calc r.1 i * |theta.1 i| = |r.1 i * theta.1 i| := by rw [abs_mul, abs_of_nonneg (r.2.1 i)] _ = |R.1 i - S.1 i| / 16 := by rw [normalizedPairedMassContrast R S r theta hr htheta i, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 16)]
CausalSmith.Stat.DiscreteBudgetvalueCurve.normalizedPairedL1 · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:63
theorem pairedCompletion_effect_bounds

Occupied cells of a paired completion have the specified positive effects. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
j :
Fin (2 * k)
hj :
0 < poCellMass Q j
effect Q j ∈ Icc (1 / 8 : ℝ) (3 / 8)
Proof (Lean source)
-- @node: pairedCompletion_effect_bounds lemma pairedCompletion_effect_bounds {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) (j : Fin (2 * k)) (hj : 0 < poCellMass Q j) : effect Q j ∈ Icc (1 / 8 : ℝ) (3 / 8) := by let pair := (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j obtain ⟨_, _, h0, h1⟩ := h.2.2 j have hr0 : poRegression Q 0 j = 1 / 4 := by nlinarith have hr1 : poRegression Q 1 j = 1 / 2 + (if pair.1 = 0 then 1 else -1) * theta.1 pair.2 := by dsimp [pair] at h1 ⊢ nlinarith have ht := theta.2 pair.2 simp only [Set.mem_Icc] at ht ⊢ rw [effect, hr0, hr1] by_cases hs : pair.1 = 0 · simp only [hs, ↓reduceIte] constructor <;> nlinarith [ht.1, ht.2] · simp only [hs, ↓reduceIte] constructor <;> nlinarith [ht.1, ht.2]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_effect_bounds · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:84
theorem pairedCompletion_controlValue

The paired family has a fixed control-policy value. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
controlValue Q = 1 / 4
Proof (Lean source)
-- @node: pairedCompletion_controlValue lemma pairedCompletion_controlValue {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) : controlValue Q = 1 / 4 := by unfold controlValue calc (∑ j : Fin (2 * k), poCellMass Q j * poRegression Q 0 j) = ∑ j : Fin (2 * k), poCellMass Q j * (1 / 4 : ℝ) := by apply Finset.sum_congr rfl intro j _ exact (h.2.2 j).2.2.1 _ = 1 / 4 := by rw [← Finset.sum_mul, poCellMass_sum_one_budget] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_controlValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:108
theorem pairedCompletion_fullTreatmentValue

Pairwise cancellation makes the value of treating every cell constant. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
(∑ j : Fin (2 * k), poCellMass Q j * poRegression Q 1 j) = 1 / 2
Proof (Lean source)
-- @node: pairedCompletion_fullTreatmentValue lemma pairedCompletion_fullTreatmentValue {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) : (∑ j : Fin (2 * k), poCellMass Q j * poRegression Q 1 j) = 1 / 2 := by calc (∑ j : Fin (2 * k), poCellMass Q j * poRegression Q 1 j) = ∑ j : Fin (2 * k), r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * (1 / 2 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by apply Finset.sum_congr rfl intro j _ rw [(h.2.2 j).2.2.2, (h.2.2 j).1] _ = 1 / 2 := by rw [← Equiv.sum_comp (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k))] simp only [Equiv.symm_apply_apply, Fintype.sum_prod_type] simp [Fin.sum_univ_two, ← Finset.sum_add_distrib] calc (∑ x : Fin k, (r.1 x / 2 * (2⁻¹ + theta.1 x) + r.1 x / 2 * (2⁻¹ + -theta.1 x))) = (∑ x : Fin k, r.1 x) / 2 := by rw [Finset.sum_div] apply Finset.sum_congr rfl intro i _ ring _ = 2⁻¹ := by rw [r.2.2]; norm_num
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_fullTreatmentValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:124
theorem pairedCompletion_modelClass

Every paired completion obeys the causal model restrictions. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
hk :
1 ≤ k
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
Proof (Lean source)
-- @node: pairedCompletion_modelClass lemma pairedCompletion_modelClass {k : ℕ} (hk : 1 ≤ k) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) : CausalModelClass epsilon Q := by apply CausalModelClass.mk · omega · exact ⟨he, he'⟩ · exact Q.property.1 · exact h.2.1 intro j hj have hmass : cellMass (observedMarginal Q) j = poCellMass Q j := observedMarginal_cellMass_eq_poCellMass Q j have harm : armMass (observedMarginal Q) true j = poTreatmentAtom Q j true := observedMarginal_armMass_eq_poTreatmentAtom Q j true have hhalf := (h.2.2 j).2.1 have hp : poCellMass Q j ≠ 0 := by rw [← hmass]; exact ne_of_gt hj have hprop : propensity (observedMarginal Q) j = 1 / 2 := by change CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass (observedMarginal Q) true j / CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass (observedMarginal Q) j = 1 / 2 change CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass (observedMarginal Q) true j = poTreatmentAtom Q j true at harm change CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass (observedMarginal Q) j = poCellMass Q j at hmass rw [harm, hhalf, hmass] field_simp rw [hprop] constructor <;> linarith
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_modelClass · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:156
theorem pairedCompletion_budgetValue_one

The paired completion budget value one result. It proves the stated conclusion.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
budgetValue Q 1 = 1 / 2
Proof (Lean source)
lemma pairedCompletion_budgetValue_one {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) : budgetValue Q 1 = 1 / 2 := by let gain : (Fin (2 * k) → ℝ) → ℝ := fun pi => ∑ j, poCellMass Q j * pi j * effect Q j let feasible := budgetPolicyClass Q ⟨1, by norm_num⟩ have hp : ∀ j : Fin (2 * k), 0 ≤ poCellMass Q j := by intro j unfold poCellMass unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass positivity have hfull : (fun _ : Fin (2 * k) => (1 : ℝ)) ∈ feasible := by constructor · intro j norm_num · simp only [mul_one] rw [poCellMass_sum_one_budget] have hupper (pi : Fin (2 * k) → ℝ) (hpi : pi ∈ feasible) : gain pi ≤ gain (fun _ => 1) := by dsimp [gain] apply Finset.sum_le_sum intro j _ have hle := (hpi.1 j).2 by_cases hj : 0 < poCellMass Q j · have heff : 0 ≤ effect Q j := le_trans (by norm_num) (pairedCompletion_effect_bounds Q r theta h j hj).1 have hprod : poCellMass Q j * pi j ≤ poCellMass Q j * 1 := mul_le_mul_of_nonneg_left hle (hp j) exact mul_le_mul_of_nonneg_right hprod heff · have hz : poCellMass Q j = 0 := le_antisymm (le_of_not_gt hj) (hp j) simp [hz] have hsup : sSup (gain '' feasible) = gain (fun _ => 1) := by apply le_antisymm · apply csSup_le · exact ⟨_, ⟨_, hfull, rfl⟩⟩ · rintro y ⟨pi, hpi, rfl⟩ exact hupper pi hpi · exact le_csSup (⟨_, fun y hy => by rcases hy with ⟨pi, hpi, rfl⟩ exact hupper pi hpi⟩ : BddAbove (gain '' feasible)) ⟨_, hfull, rfl⟩ have hvalue : controlValue Q + gain (fun _ => 1) = ∑ j : Fin (2 * k), poCellMass Q j * poRegression Q 1 j := by unfold controlValue gain effect simp only [mul_one, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j _ ring rw [budgetValue, dif_pos (by norm_num : (1 : ℝ) ∈ Icc 0 1)] change controlValue Q + sSup (gain '' feasible) = 1 / 2 rw [hsup, hvalue] exact pairedCompletion_fullTreatmentValue Q r theta h
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_budgetValue_one · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:245

Select exactly the better member of each cell pair, including at ties.

Definition (Lean source)
k :
ℕ
theta :
j :
Fin (2 * k)
pairedSignPolicy theta j :
ℝ
pair :
(finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j
if 0 ≤ theta.1 pair.2 then if pair.1 = 0 then 1 else 0 else if pair.1 = 0 then 0 else 1
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSignPolicy · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:299
theorem pairedSignPolicy_budget

The sign-selecting policy treats exactly half the population. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
conclusion 1
pairedSignPolicy theta ∈ budgetPolicyClass Q ⟨1 / 2, by norm_num⟩
conclusion 2
(∑ j, poCellMass Q j * pairedSignPolicy theta j) = 1 / 2
Proof (Lean source)
-- @node: pairedSignPolicy_budget lemma pairedSignPolicy_budget {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) : pairedSignPolicy theta ∈ budgetPolicyClass Q ⟨1 / 2, by norm_num⟩ ∧ (∑ j, poCellMass Q j * pairedSignPolicy theta j) = 1 / 2 := by have hbox : ∀ j, pairedSignPolicy theta j ∈ Icc (0 : ℝ) 1 := by intro j simp only [pairedSignPolicy] split_ifs <;> norm_num have hmass : (∑ j, poCellMass Q j * pairedSignPolicy theta j) = 1 / 2 := by calc (∑ j, poCellMass Q j * pairedSignPolicy theta j) = ∑ j : Fin (2 * k), r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * pairedSignPolicy theta j := by apply Finset.sum_congr rfl intro j _ rw [(h.2.2 j).1] _ = 1 / 2 := by rw [← Equiv.sum_comp (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k))] simp only [Equiv.symm_apply_apply, Fintype.sum_prod_type] simp only [Fin.sum_univ_two, pairedSignPolicy, Equiv.symm_apply_apply, Fin.isValue, ↓reduceIte, one_ne_zero] simp only [← Finset.sum_add_distrib] calc (∑ i : Fin k, (r.1 i / 2 * (if 0 ≤ theta.1 i then 1 else 0) + r.1 i / 2 * (if 0 ≤ theta.1 i then 0 else 1))) = ∑ i : Fin k, r.1 i / 2 := by apply Finset.sum_congr rfl intro i _ split_ifs <;> ring _ = 1 / 2 := by rw [← Finset.sum_div, r.2.2] exact ⟨⟨hbox, hmass.le⟩, hmass⟩
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSignPolicy_budget · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:307
theorem pairedSignPolicy_value

The sign-selecting feasible policy realizes the paired value formula. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
controlValue Q + (∑ j, poCellMass Q j * pairedSignPolicy theta j * effect Q j)
= 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i|
Proof (Lean source)
-- @node: pairedSignPolicy_value lemma pairedSignPolicy_value {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) : controlValue Q + (∑ j, poCellMass Q j * pairedSignPolicy theta j * effect Q j) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| := by rw [pairedCompletion_controlValue Q r theta h] have hcell (j : Fin (2 * k)) : poCellMass Q j * pairedSignPolicy theta j * effect Q j = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * pairedSignPolicy theta j * (1 / 4 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by obtain ⟨hp, _, h0, h1⟩ := h.2.2 j calc poCellMass Q j * pairedSignPolicy theta j * effect Q j = pairedSignPolicy theta j * (poCellMass Q j * poRegression Q 1 j - poCellMass Q j * poRegression Q 0 j) := by unfold effect; ring _ = _ := by rw [h0, h1, hp]; ring calc (1 / 4 : ℝ) + ∑ j, poCellMass Q j * pairedSignPolicy theta j * effect Q j = 1 / 4 + ∑ j : Fin (2 * k), r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * pairedSignPolicy theta j * (1 / 4 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by congr 1 apply Finset.sum_congr rfl intro j _ exact hcell j _ = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| := by rw [← Equiv.sum_comp (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k))] simp only [Equiv.symm_apply_apply, Fintype.sum_prod_type, Fin.sum_univ_two, pairedSignPolicy, Fin.isValue, ↓reduceIte, one_ne_zero] simp only [one_mul, neg_mul] rw [← Finset.sum_add_distrib] have hterm (i : Fin k) : r.1 i / 2 * (if 0 ≤ theta.1 i then 1 else 0) * (1 / 4 + theta.1 i) + r.1 i / 2 * (if 0 ≤ theta.1 i then 0 else 1) * (1 / 4 - theta.1 i) = r.1 i / 8 + r.1 i * |theta.1 i| / 2 := by by_cases ht : 0 ≤ theta.1 i · simp only [ht, ↓reduceIte, one_mul, mul_one, mul_zero, add_zero, abs_of_nonneg ht] ring · have ht' : theta.1 i ≤ 0 := le_of_lt (lt_of_not_ge ht) simp only [ht, ↓reduceIte, mul_zero, zero_mul, zero_add, mul_one, abs_of_nonpos ht'] ring calc 1 / 4 + ∑ i : Fin k, (r.1 i / 2 * (if 0 ≤ theta.1 i then 1 else 0) * (1 / 4 + theta.1 i) + r.1 i / 2 * (if 0 ≤ theta.1 i then 0 else 1) * (1 / 4 - theta.1 i)) = 1 / 4 + ∑ i : Fin k, (r.1 i / 8 + r.1 i * |theta.1 i| / 2) := by congr 1 apply Finset.sum_congr rfl intro i _ exact hterm i _ = _ := by rw [Finset.sum_add_distrib, ← Finset.sum_div, ← Finset.sum_div, r.2.2] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedSignPolicy_value · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:344
theorem pairedCompletion_dualQuarter

The shadow price one quarter evaluates to the paired capacity value. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hk :
1 ≤ k
(1 / 8 : ℝ) + dualProcessReal epsilon (observedMarginal Q) (1 / 4)
= 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i|
Proof (Lean source)
-- @node: pairedCompletion_dualQuarter lemma pairedCompletion_dualQuarter {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hk : 1 ≤ k) : (1 / 8 : ℝ) + dualProcessReal epsilon (observedMarginal Q) (1 / 4) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| := by have hQ := pairedCompletion_modelClass hk epsilon he he' Q r theta h rw [budget_dualProcess_identified epsilon Q hQ (1 / 4) (by norm_num), pairedCompletion_controlValue Q r theta h] have hcell (j : Fin (2 * k)) : poCellMass Q j * max 0 (effect Q j - 1 / 4) = r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * max 0 ((if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by obtain ⟨hp, _, h0, h1⟩ := h.2.2 j by_cases hz : poCellMass Q j = 0 · rw [← hp, hz] simp · have heff : effect Q j = 1 / 4 + (if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 := by unfold effect apply (mul_left_cancel₀ hz) linear_combination h1 - h0 rw [heff, hp] simp only [add_sub_cancel_left] calc (1 / 8 : ℝ) + (1 / 4 + ∑ j : Fin (2 * k), poCellMass Q j * max 0 (effect Q j - 1 / 4)) = 3 / 8 + ∑ j : Fin (2 * k), r.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2 / 2 * max 0 ((if ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).1 = 0 then 1 else -1) * theta.1 ((finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k)).symm j).2) := by simp_rw [hcell] ring _ = _ := by rw [← Equiv.sum_comp (finProdFinEquiv : Fin 2 × Fin k ≃ Fin (2 * k))] simp only [Equiv.symm_apply_apply, Fintype.sum_prod_type, Fin.sum_univ_two, Fin.isValue, ↓reduceIte, one_ne_zero, one_mul, neg_one_mul] rw [← Finset.sum_add_distrib] rw [Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro i _ by_cases ht : 0 ≤ theta.1 i · rw [max_eq_right ht, max_eq_left (neg_nonpos.mpr ht), abs_of_nonneg ht] ring · have ht' : theta.1 i ≤ 0 := le_of_lt (lt_of_not_ge ht) rw [max_eq_left ht', max_eq_right (neg_nonneg.mpr ht'), abs_of_nonpos ht'] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_dualQuarter · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:414
theorem pairedCompletion_bindingValue

The sign policy attains the shadow-price bound and uses the full half budget. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
Q :
PotentialLaw (2 * k)
r :
ProbabilitySimplex k
theta :
h :
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
hk :
1 ≤ k
conclusion 1
conclusion 2
budgetValue Q (1 / 2) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i|
conclusion 3
budgetValue Q (1 / 2) = 1 / 8 + dualProcessReal epsilon (observedMarginal Q) (1 / 4)
Proof (Lean source)
-- @node: pairedCompletion_bindingValue lemma pairedCompletion_bindingValue {k : ℕ} (Q : PotentialLaw (2 * k)) (r : ProbabilitySimplex k) (theta : PairedContrasts k) (h : PairedCompletion Q r theta) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (hk : 1 ≤ k) : BindingHalfBudget Q ∧ budgetValue Q (1 / 2) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| ∧ budgetValue Q (1 / 2) = 1 / 8 + dualProcessReal epsilon (observedMarginal Q) (1 / 4) := by let pi := pairedSignPolicy theta let gain : (Fin (2 * k) → ℝ) → ℝ := fun pi => ∑ j, poCellMass Q j * pi j * effect Q j let feasible := budgetPolicyClass Q ⟨1 / 2, by norm_num⟩ have hpi := pairedSignPolicy_budget Q r theta h have hvalue := pairedSignPolicy_value Q r theta h have hQ := pairedCompletion_modelClass hk epsilon he he' Q r theta h have hdual := pairedCompletion_dualQuarter Q r theta h epsilon he he' hk have hupper : budgetValue Q (1 / 2) ≤ 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| := by calc budgetValue Q (1 / 2) ≤ (1 / 2 : ℝ) * (1 / 4) + dualProcessReal epsilon (observedMarginal Q) (1 / 4) := budget_dual_weak_bound epsilon Q hQ (1 / 2) (1 / 4) (by norm_num) (by norm_num) _ = _ := by convert hdual using 1 <;> ring have hlower : 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| ≤ budgetValue Q (1 / 2) := by rw [← hvalue] rw [budgetValue, dif_pos (by norm_num : (1 / 2 : ℝ) ∈ Icc 0 1)] change controlValue Q + gain pi ≤ controlValue Q + sSup (gain '' feasible) gcongr apply le_csSup · refine ⟨(1 / 2 : ℝ) * (1 / 4) + ∑ j, poCellMass Q j * max 0 (effect Q j - 1 / 4), ?_⟩ rintro y ⟨pi', hpi', rfl⟩ -- The generic budget bound supplies a finite upper bound for the image. have hbound := weighted_budget_weak_duality (poCellMass Q) (effect Q) pi' (1 / 2) (1 / 4) (by intro j; unfold poCellMass unfold CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass positivity) hpi'.1 hpi'.2 (by norm_num : (0 : ℝ) ≤ 1 / 4) exact hbound · exact ⟨pi, hpi.1, rfl⟩ have hv : budgetValue Q (1 / 2) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| := le_antisymm hupper (by simpa [gain, pi] using hlower) refine ⟨?_, hv, ?_⟩ · refine ⟨pi, hpi.1, hpi.2, ?_⟩ rw [hv] simpa [gain, pi] using hvalue.symm · rw [hv, hdual]
CausalSmith.Stat.DiscreteBudgetvalueCurve.pairedCompletion_bindingValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:471
theorem normalizedPairedBudgetValue

The normalized pair's half-budget value is an affine copy of L1 distance. With the specified inputs and conditions, the stated relationship holds.

Formal statement
k :
ℕ
hk :
1 ≤ k
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
R S r :
ProbabilitySimplex k
theta :
Q :
PotentialLaw (2 * k)
hQ :
hr :
∀ i, r.1 i = (R.1 i + S.1 i) / 2
htheta :
∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))
budgetValue Q (1 / 2) = 3 / 8 + simplexL1 R S / 32
Proof (Lean source)
-- @node: normalizedPairedBudgetValue lemma normalizedPairedBudgetValue {k : ℕ} (hk : 1 ≤ k) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) (R S r : ProbabilitySimplex k) (theta : PairedContrasts k) (Q : PotentialLaw (2 * k)) (hQ : PairedCompletion Q r theta) (hr : ∀ i, r.1 i = (R.1 i + S.1 i) / 2) (htheta : ∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) : budgetValue Q (1 / 2) = 3 / 8 + simplexL1 R S / 32 := by have h := (pairedCompletion_bindingValue Q r theta hQ epsilon he he' hk).2.1 rw [h, normalizedPairedL1 R S r theta hr htheta] ring
CausalSmith.Stat.DiscreteBudgetvalueCurve.normalizedPairedBudgetValue · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:526
theorem paired_capacity_identity

The paired capacity identity result. Under the hk premise, the he premise, the he' premise, It proves the stated conclusion.

Formal statement
k :
ℕ
hk :
1 ≤ k
epsilon :
ℝ
he :
0 < epsilon
he' :
epsilon < 1 / 2
conclusion 1
Q :
PotentialLaw (2 * k)
Q ∈ pairedFamily k
r :
ProbabilitySimplex k
theta :
j :
0 < poCellMass Q j
effect Q j ∈ Icc (1 / 8 : ℝ) (3 / 8)
budgetValue Q (1 / 2) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i|
budgetValue Q 1 = 1 / 2
budgetValue Q (1 / 2) = 1 / 8 + dualProcessReal epsilon (observedMarginal Q) (1 / 4)
conclusion 2
n :
ℕ
∃ K : ((Fin n → Fin k) × (Fin n → Fin k)) → PMF (Fin n → Obs (2 * k)),
∀ R S : ProbabilitySimplex k,
∃ r : ProbabilitySimplex k,
∃ theta : PairedContrasts k,
(∀ i, r.1 i = (R.1 i + S.1 i) / 2) ∧
(∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) ∧
pairedLaw r theta ∈ pairedFamily k ∧
∀ z : Fin n → Obs (2 * k),
(∑ x : (Fin n → Fin k) × (Fin n → Fin k), (twoSampleLaw n (R, S)) {x} * K x z)
= (productLaw (observedMarginal (pairedLaw r theta)) n) {z}
Proof (Lean source)
theorem paired_capacity_identity (k : ℕ) (hk : 1 ≤ k) (epsilon : ℝ) (he : 0 < epsilon) (he' : epsilon < 1 / 2) : (∀ Q : PotentialLaw (2 * k), Q ∈ pairedFamily k → ∀ r : ProbabilitySimplex k, ∀ theta : PairedContrasts k, PairedCompletion Q r theta → CausalModelClass epsilon Q ∧ (∀ j, 0 < poCellMass Q j → effect Q j ∈ Icc (1 / 8 : ℝ) (3 / 8)) ∧ BindingHalfBudget Q ∧ budgetValue Q (1 / 2) = 3 / 8 + (1 / 2) * ∑ i, r.1 i * |theta.1 i| ∧ budgetValue Q 1 = 1 / 2 ∧ budgetValue Q (1 / 2) = 1 / 8 + dualProcessReal epsilon (observedMarginal Q) (1 / 4)) ∧ (∀ n : ℕ, ∃ K : ((Fin n → Fin k) × (Fin n → Fin k)) → PMF (Fin n → Obs (2 * k)), ∀ R S : ProbabilitySimplex k, ∃ r : ProbabilitySimplex k, ∃ theta : PairedContrasts k, (∀ i, r.1 i = (R.1 i + S.1 i) / 2) ∧ (∀ i, theta.1 i = if R.1 i + S.1 i = 0 then 0 else (R.1 i - S.1 i) / (8 * (R.1 i + S.1 i))) ∧ pairedLaw r theta ∈ pairedFamily k ∧ ∀ z : Fin n → Obs (2 * k), (∑ x : (Fin n → Fin k) × (Fin n → Fin k), (twoSampleLaw n (R, S)) {x} * K x z) = (productLaw (observedMarginal (pairedLaw r theta)) n) {z}) := by constructor · intro Q _ r theta h have hb := pairedCompletion_bindingValue Q r theta h epsilon he he' hk exact ⟨pairedCompletion_modelClass hk epsilon he he' Q r theta h, (fun j hj => pairedCompletion_effect_bounds Q r theta h j hj), hb.1, hb.2.1, pairedCompletion_budgetValue_one Q r theta h, hb.2.2⟩ · intro n refine ⟨pairedSampleKernel n, ?_⟩ intro R S obtain ⟨r, theta, hr, htheta⟩ := normalizedPairedParameters R S refine ⟨r, theta, hr, htheta, ?_, ?_⟩ · exact ⟨r, theta, pairedLaw_completion r theta⟩ · intro z exact pairedSampleKernel_reproduces R S r theta hr htheta z
CausalSmith.Stat.DiscreteBudgetvalueCurve.paired_capacity_identity · CausalSmith/Stat/STAT_DiscreteBudgetvalueCurve_Research/TPairedCapacityIdentity.lean:542