Exact Lean source
Nonadditivity.Quantitative
Download original .lean · View on GitHub · Jump to source
Direct imports
Mathlib.Analysis.Complex.ExponentialBoundsdependencyMathlib.Analysis.SpecialFunctions.Pow.RealdependencyMathlib.Tactic.LinarithdependencyMathlib.Tactic.NormNumdependencyMathlib.Tactic.FieldSimpdependencyMathlib.Tactic.RingdependencyMathlib.Tactic.Positivitydependency
Imported by project modules
Relationships above come from literal import commands. The declarations below link to types and references extracted from Lean’s environment. Source text is complete and unchanged.
Declarations in this module
80 project constants, including generated, internal and private declarations.
80 declarations
Nonadditivity.Quantitative.coefficient_cost_absorptionNonadditivity.Quantitative.coefficient_error_contributionNonadditivity.Quantitative.coefficient_error_contribution._simp_1_1internal/detail/privateNonadditivity.Quantitative.coefficient_error_contribution._simp_1_2internal/detail/privateNonadditivity.Quantitative.coefficient_error_contribution._simp_1_3internal/detail/privateNonadditivity.Quantitative.coefficient_error_contribution._simp_1_4internal/detail/privateNonadditivity.Quantitative.coefficient_error_contribution._simp_1_5internal/detail/privateNonadditivity.Quantitative.coefficient_error_contribution._simp_1_6internal/detail/privateNonadditivity.Quantitative.coefficient_error_contribution._simp_1_7internal/detail/privateNonadditivity.Quantitative.coefficient_exponent_alignmentNonadditivity.Quantitative.coefficient_remainder_absorptionNonadditivity.Quantitative.dimensionChoiceNonadditivity.Quantitative.dimensionExponentNonadditivity.Quantitative.dimensionExponent._proof_1internal/detail/privateNonadditivity.Quantitative.dimensionExponent._proof_2internal/detail/privateNonadditivity.Quantitative.dimensionExponent_leNonadditivity.Quantitative.dimension_choice_boundsNonadditivity.Quantitative.dimension_choice_log_boundsNonadditivity.Quantitative.dimension_choice_log_upperNonadditivity.Quantitative.dimension_error_contributionNonadditivity.Quantitative.dimension_error_contribution._simp_1_1internal/detail/privateNonadditivity.Quantitative.dimension_error_contribution._simp_1_2internal/detail/privateNonadditivity.Quantitative.dimension_error_contribution._simp_1_3internal/detail/privateNonadditivity.Quantitative.dimension_error_contribution._simp_1_4internal/detail/privateNonadditivity.Quantitative.dimension_error_contribution._simp_1_5internal/detail/privateNonadditivity.Quantitative.dimension_error_contribution._simp_1_6internal/detail/privateNonadditivity.Quantitative.dimension_error_contribution._simp_1_7internal/detail/privateNonadditivity.Quantitative.dimension_rpow_eq_expNonadditivity.Quantitative.error_cost_absorptionNonadditivity.Quantitative.exp_dominates_linearNonadditivity.Quantitative.exp_dominates_powerNonadditivity.Quantitative.explicit_haar_error_boundNonadditivity.Quantitative.explicit_haar_error_bound._proof_1_1internal/detail/privateNonadditivity.Quantitative.explicit_haar_log_comparisonNonadditivity.Quantitative.exponential_tail_leNonadditivity.Quantitative.final_coefficient_sizeNonadditivity.Quantitative.final_error_from_contributionsNonadditivity.Quantitative.final_log_comparisonNonadditivity.Quantitative.final_three_tails_ltNonadditivity.Quantitative.gammaNonadditivity.Quantitative.haarLogMultiplierNonadditivity.Quantitative.haar_error_boundNonadditivity.Quantitative.log_le_twice_sqrt_sub_oneNonadditivity.Quantitative.log_one_add_two_mul_leNonadditivity.Quantitative.momentChoiceNonadditivity.Quantitative.momentChoice._proof_1internal/detail/privateNonadditivity.Quantitative.momentParameterNonadditivity.Quantitative.momentParameter._proof_1internal/detail/privateNonadditivity.Quantitative.moment_choice_boundsNonadditivity.Quantitative.moment_choice_bounds._proof_1_1internal/detail/privateNonadditivity.Quantitative.moment_parameter_boundsNonadditivity.Quantitative.moment_parameter_eq_originalNonadditivity.Quantitative.moment_parameter_haar_rangeNonadditivity.Quantitative.moment_parameter_inverse_boundNonadditivity.Quantitative.moment_parameter_inverse_bound._proof_1_1internal/detail/privateNonadditivity.Quantitative.moment_parameter_log_boundNonadditivity.Quantitative.moment_parameter_log_bound._proof_1_1internal/detail/privateNonadditivity.Quantitative.n₀Nonadditivity.Quantitative.n₀._proof_1internal/detail/privateNonadditivity.Quantitative.parameter_alignmentNonadditivity.Quantitative.quantitative_certificateNonadditivity.Quantitative.reduction_coefficient_log_boundNonadditivity.Quantitative.reduction_error_log_boundNonadditivity.Quantitative.remainder_error_contributionNonadditivity.Quantitative.remainder_exponent_gapNonadditivity.Quantitative.remainder_log_boundNonadditivity.Quantitative.tailBoundNonadditivity.Quantitative.tailBound._proof_1internal/detail/privateNonadditivity.Quantitative.tailBound._proof_2internal/detail/privateNonadditivity.Quantitative.tailBound._proof_3internal/detail/privateNonadditivity.Quantitative.tailBound._proof_4internal/detail/privateNonadditivity.Quantitative.threshold_absorptionNonadditivity.Quantitative.threshold_base_logNonadditivity.Quantitative.threshold_consequencesNonadditivity.Quantitative.toleranceNonadditivity.Quantitative.tolerance_lt_oneNonadditivity.Quantitative.tolerance_posNonadditivity.Quantitative.tolerance_times_error_factorNonadditivity.Quantitative.zetaNonadditivity.Quantitative.zeta_exponential_comparison
Full module
1/-2Copyright (c) 2026 the Nonadditivity project contributors.3All rights reserved. See COPYRIGHT.md for licensing and attribution.4-/56import Mathlib.Analysis.Complex.ExponentialBounds7import Mathlib.Analysis.SpecialFunctions.Pow.Real8import Mathlib.Tactic.Linarith9import Mathlib.Tactic.NormNum10import Mathlib.Tactic.FieldSimp11import Mathlib.Tactic.Ring12import Mathlib.Tactic.Positivity1314/-!15# Exact scalar estimates in the quantitative approximation argument1617This file proves scalar estimates from the appendix of `nonadditivity.tex`.18All constants and inequalities below are checked by Lean. Operator-algebraic19and random-matrix input is deliberately kept separate from these estimates.20-/2122namespace Nonadditivity.Quantitative2324noncomputable section2526open Real2728/-- A degree twelve Taylor term suffices to control every exponential tail29used in the appendix. This avoids using unformalized derivative arguments. -/30theorem exp_dominates_power {x b C : ℝ} (k : ℕ) (hk : k ≤ 12)31(hx : 64 ≤ x) (hb : 0 ≤ b)32(hC : 64 * C * (Nat.factorial 12 : ℝ) ≤ b ^ 12 * 64 ^ (12 - k)) :3364 * C * x ^ k ≤ Real.exp (b * x) := by34have hx0 : 0 ≤ x := by linarith35have hpower : (64 : ℝ) ^ (12 - k) ≤ x ^ (12 - k) :=36pow_le_pow_left₀ (by norm_num) hx _37have hcoeff : 64 * C * (Nat.factorial 12 : ℝ) ≤ b ^ 12 * x ^ (12 - k) :=38hC.trans (mul_le_mul_of_nonneg_left hpower (pow_nonneg hb _))39have hmul := mul_le_mul_of_nonneg_right hcoeff (pow_nonneg hx0 k)40have hp : x ^ (12 - k) * x ^ k = x ^ 12 := by41rw [← pow_add, Nat.sub_add_cancel hk]42have hf : (0 : ℝ) < Nat.factorial 12 := by norm_num43calc4464 * C * x ^ k ≤ (b * x) ^ 12 / (Nat.factorial 12 : ℝ) := by45apply (le_div_iff₀ hf).246calc4764 * C * x ^ k * (Nat.factorial 12 : ℝ) =4864 * C * (Nat.factorial 12 : ℝ) * x ^ k := by ring49_ ≤ b ^ 12 * x ^ (12 - k) * x ^ k := hmul50_ = (b * x) ^ 12 := by rw [mul_assoc, hp, mul_pow]51_ ≤ Real.exp (b * x) :=52Real.pow_div_factorial_le_exp (b * x) (mul_nonneg hb hx0) 125354theorem exponential_tail_le {x b C : ℝ} (k : ℕ) (hk : k ≤ 12)55(hx : 64 ≤ x) (hb : 0 ≤ b)56(hC : 64 * C * (Nat.factorial 12 : ℝ) ≤ b ^ 12 * 64 ^ (12 - k)) :57C * x ^ k * Real.exp (-(b * x)) ≤ (1 : ℝ) / 64 := by58have h := exp_dominates_power k hk hx hb hC59rw [Real.exp_neg, ← div_eq_mul_inv]60apply (div_le_iff₀ (Real.exp_pos _)).261linarith6263/-- The precise three-tail expression occurring in the final norm error. -/64def tailBound (n : ℝ) : ℝ :=6512 * n ^ 3 * Real.exp (-n / 2) +661494 * n ^ 4 * Real.exp (-3 * n / 2) + n ^ 2 * Real.exp (-n)6768theorem final_three_tails_lt {n : ℝ} (hn : 64 ≤ n) : tailBound n < 1 / 16 := by69have h₁ := exponential_tail_le (x := n) (b := (1 : ℝ) / 2)70(C := 12) 3 (by norm_num) hn (by norm_num) (by norm_num)71have h₂ := exponential_tail_le (x := n) (b := (3 : ℝ) / 2)72(C := 1494) 4 (by norm_num) hn (by norm_num) (by norm_num)73have h₃ := exponential_tail_le (x := n) (b := (1 : ℝ))74(C := 1) 2 (by norm_num) hn (by norm_num) (by norm_num)75have he₁ : -((1 : ℝ) / 2 * n) = -n / 2 := by ring76have he₂ : -((3 : ℝ) / 2 * n) = -3 * n / 2 := by ring77simp only [he₁] at h₁78simp only [he₂] at h₂79simp only [one_mul] at h₃80dsimp [tailBound]81linarith8283def gamma (h : ℝ) : ℝ := 3 / 2 * h + 1 / 284def zeta (h : ℝ) : ℝ := 2 * h + 1 / 285def dimensionExponent (h : ℝ) : ℝ := 40 * (7 * h + 2)86def tolerance (h n : ℝ) : ℝ := Real.exp (-(gamma h * n)) / n87def dimensionChoice (h n : ℝ) : ℕ := ⌈Real.exp (dimensionExponent h * n)⌉₊88def momentChoice (t : ℝ) : ℕ := 2 * ⌊t / 4⌋₊8990theorem parameter_alignment (h : ℝ) :91dimensionExponent h / 80 = gamma h + zeta h := by92dsimp [dimensionExponent, gamma, zeta]93ring9495theorem dimensionExponent_le {h : ℝ} (hh : 0 ≤ h) :96dimensionExponent h ≤ 160 * zeta h := by97dsimp [dimensionExponent, zeta]98linarith99100theorem coefficient_exponent_alignment (h : ℝ) :1012 * h + gamma h - dimensionExponent h / 80 = -(1 / 2 : ℝ) := by102dsimp [dimensionExponent, gamma]103ring104105theorem remainder_exponent_gap {h : ℝ} (hh : 0 ≤ h) :1061 ≤ dimensionExponent h / 2 - gamma h := by107dsimp [dimensionExponent, gamma]108linarith109110theorem dimension_choice_bounds {h n : ℝ} (hh : 0 ≤ h) (hn : 0 ≤ n) :111Real.exp (dimensionExponent h * n) ≤ (dimensionChoice h n : ℝ) ∧112(dimensionChoice h n : ℝ) ≤ 2 * Real.exp (dimensionExponent h * n) := by113have hb : 0 ≤ dimensionExponent h := by dsimp [dimensionExponent]; positivity114have he : 1 ≤ Real.exp (dimensionExponent h * n) :=115Real.one_le_exp_iff.mpr (mul_nonneg hb hn)116refine ⟨Nat.le_ceil _, ?_⟩117have hc := Nat.ceil_lt_add_one (Real.exp_pos (dimensionExponent h * n)).le118dsimp [dimensionChoice]119linarith120121theorem dimension_choice_log_bounds {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)122(hn : 2 ≤ n) :123dimensionExponent h * n ≤ Real.log (dimensionChoice h n : ℝ) ∧124Real.log (dimensionChoice h n : ℝ) ≤ 2 * dimensionExponent h * n := by125have hh0 : 0 ≤ h := by linarith126have hn0 : 0 ≤ n := by linarith127obtain ⟨hlo, hhi⟩ := dimension_choice_bounds hh0 hn0128have hNpos : 0 < (dimensionChoice h n : ℝ) := (Real.exp_pos _).trans_le hlo129have hl := Real.log_le_log (Real.exp_pos _) hlo130rw [Real.log_exp] at hl131have hu := Real.log_le_log hNpos hhi132rw [Real.log_mul (by norm_num) (Real.exp_pos _).ne', Real.log_exp] at hu133have hb : 80 ≤ dimensionExponent h := by dsimp [dimensionExponent]; linarith134have hbn : 160 ≤ dimensionExponent h * n := by135nlinarith [mul_nonneg (show 0 ≤ dimensionExponent h - 80 by linarith) hn0]136refine ⟨hl, ?_⟩137linarith [Real.log_two_lt_d9]138139theorem dimension_choice_log_upper {h n : ℝ} (hh : 0 ≤ h) (hn : 0 ≤ n) :140Real.log (dimensionChoice h n : ℝ) ≤ dimensionExponent h * n + Real.log 2 := by141obtain ⟨hlo, hhi⟩ := dimension_choice_bounds hh hn142have hNpos : 0 < (dimensionChoice h n : ℝ) := (Real.exp_pos _).trans_le hlo143have hu := Real.log_le_log hNpos hhi144rw [Real.log_mul (by norm_num) (Real.exp_pos _).ne', Real.log_exp] at hu145linarith146147theorem moment_choice_bounds {t : ℝ} (ht : 8 ≤ t) :148Even (momentChoice t) ∧ 2 ≤ momentChoice t ∧149t / 4 ≤ (momentChoice t : ℝ) ∧ (momentChoice t : ℝ) ≤ t / 2 := by150have ht0 : 0 ≤ t / 4 := by linarith151have hf := Nat.floor_le ht0152have hg := Nat.sub_one_lt_floor (t / 4)153have hn : 1 ≤ ⌊t / 4⌋₊ := (Nat.one_le_floor_iff _).2 (by linarith)154dsimp [momentChoice]155refine ⟨even_two_mul _, by omega, ?_, ?_⟩ <;>156simp only [Nat.cast_mul, Nat.cast_ofNat] <;> linarith157158/-- `exp (log N / 80)` is exactly `N^(1/80)` for positive `N`. -/159def momentParameter (h n : ℝ) : ℕ :=160momentChoice (Real.exp (Real.log (dimensionChoice h n : ℝ) / 80))161162theorem moment_parameter_bounds {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)163(hn : 2 ≤ n) :164Even (momentParameter h n) ∧ 2 ≤ momentParameter h n ∧165(Real.exp (Real.log (dimensionChoice h n : ℝ) / 80) / 4 ≤166(momentParameter h n : ℝ)) ∧167((momentParameter h n : ℝ) ≤168Real.exp (Real.log (dimensionChoice h n : ℝ) / 80) / 2) := by169obtain ⟨hN, _⟩ := dimension_choice_log_bounds hh hn170have hb : 80 * (10 : ℝ) / 3 ≤ dimensionExponent h := by171dsimp [dimensionExponent]172linarith173have hn0 : 0 ≤ n := by linarith174have hbig : 6 ≤ Real.log (dimensionChoice h n : ℝ) / 80 := by175have hm := mul_le_mul_of_nonneg_right hb hn0176nlinarith177have he : Real.exp 6 ≤ Real.exp (Real.log (dimensionChoice h n : ℝ) / 80) :=178Real.exp_le_exp.mpr hbig179have h6 := Real.pow_div_factorial_le_exp (6 : ℝ) (by norm_num) 2180norm_num at h6181have ht : 8 ≤ Real.exp (Real.log (dimensionChoice h n : ℝ) / 80) := by linarith182exact moment_choice_bounds ht183184theorem moment_parameter_inverse_bound {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)185(hn : 2 ≤ n) :1861 / (momentParameter h n : ℝ) ≤1874 * Real.exp (-(dimensionExponent h * n / 80)) := by188obtain ⟨_, hp, hlo, _⟩ := moment_parameter_bounds hh hn189have hp0 : (0 : ℝ) < momentParameter h n := by exact_mod_cast (by omega : 0 < momentParameter h n)190obtain ⟨hN, _⟩ := dimension_choice_log_bounds hh hn191have he := Real.exp_le_exp.mpr (show dimensionExponent h * n / 80 ≤192Real.log (dimensionChoice h n : ℝ) / 80 by linarith)193have hlow : Real.exp (dimensionExponent h * n / 80) / 4 ≤194(momentParameter h n : ℝ) := (div_le_div_of_nonneg_right he (by norm_num)).trans hlo195have hbound : 1 / (momentParameter h n : ℝ) ≤1961 / (Real.exp (dimensionExponent h * n / 80) / 4) :=197one_div_le_one_div_of_le (by positivity) hlow198rw [Real.exp_neg]199convert hbound using 1200field_simp201202theorem moment_parameter_log_bound {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)203(hn : 2 ≤ n) :204Real.log (momentParameter h n : ℝ) ≤205Real.log (dimensionChoice h n : ℝ) / 80 := by206obtain ⟨_, hp, _, hhi⟩ := moment_parameter_bounds hh hn207have hp0 : (0 : ℝ) < momentParameter h n := by exact_mod_cast (by omega : 0 < momentParameter h n)208have he := Real.exp_pos (Real.log (dimensionChoice h n : ℝ) / 80)209have hle : (momentParameter h n : ℝ) ≤210Real.exp (Real.log (dimensionChoice h n : ℝ) / 80) := by linarith211have hl := Real.log_le_log hp0 hle212simpa only [Real.log_exp] using hl213214theorem remainder_log_bound {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)215(hn : 2 ≤ n) :216Real.log (1 + Real.exp (-(Real.log (dimensionChoice h n : ℝ) / 2))) ≤217Real.exp (-(dimensionExponent h * n / 2)) := by218have he := Real.exp_pos (-(Real.log (dimensionChoice h n : ℝ) / 2))219have hl := Real.log_le_sub_one_of_pos (show 0 < 1 +220Real.exp (-(Real.log (dimensionChoice h n : ℝ) / 2)) by linarith)221obtain ⟨hN, _⟩ := dimension_choice_log_bounds hh hn222have hm := Real.exp_le_exp.mpr (show223-(Real.log (dimensionChoice h n : ℝ) / 2) ≤ -(dimensionExponent h * n / 2) by linarith)224linarith225226theorem dimension_rpow_eq_exp (h n : ℝ) :227(dimensionChoice h n : ℝ) ^ (1 / 80 : ℝ) =228Real.exp (Real.log (dimensionChoice h n : ℝ) / 80) := by229have hp : 0 < (dimensionChoice h n : ℝ) :=230(Real.exp_pos _).trans_le (Nat.le_ceil _)231rw [Real.rpow_def_of_pos hp]232congr 1233ring234235theorem moment_parameter_eq_original (h n : ℝ) :236momentParameter h n =2372 * ⌊((dimensionChoice h n : ℝ) ^ (1 / 80 : ℝ)) / 4⌋₊ := by238rw [dimension_rpow_eq_exp]239rfl240241theorem moment_parameter_haar_range {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)242(hn : 2 ≤ n) :243Even (momentParameter h n) ∧ 2 ≤ momentParameter h n ∧244(momentParameter h n : ℝ) ≤245(2 : ℝ) ^ (-(2 / 5 : ℝ)) * (dimensionChoice h n : ℝ) ^ (1 / 80 : ℝ) := by246obtain ⟨heven, hp, _, hhi⟩ := moment_parameter_bounds hh hn247have hhalf : (1 : ℝ) / 2 ≤ (2 : ℝ) ^ (-(2 / 5 : ℝ)) := by248have he := Real.rpow_le_rpow_of_exponent_le (by norm_num : (1 : ℝ) ≤ 2)249(by norm_num : (-1 : ℝ) ≤ -(2 / 5 : ℝ))250simpa only [Real.rpow_neg_one, one_div] using he251have hm := mul_le_mul_of_nonneg_right hhalf252(Real.exp_pos (Real.log (dimensionChoice h n : ℝ) / 80)).le253rw [dimension_rpow_eq_exp]254refine ⟨heven, hp, ?_⟩255linarith256257theorem tolerance_pos {h n : ℝ} (hn : 0 < n) : 0 < tolerance h n :=258div_pos (Real.exp_pos _) hn259260theorem tolerance_lt_one {h n : ℝ} (hh : 0 ≤ h) (hn : 2 ≤ n) :261tolerance h n < 1 := by262have hn0 : 0 < n := by linarith263have hg : 0 ≤ gamma h := by dsimp [gamma]; linarith264have he : Real.exp (-(gamma h * n)) ≤ 1 :=265(Real.exp_le_one_iff).2 (neg_nonpos.mpr (mul_nonneg hg hn0.le))266dsimp [tolerance]267apply (div_lt_iff₀ hn0).2268linarith269270/-- Tangency of the logarithm, applied to the square root. -/271theorem log_le_twice_sqrt_sub_one {t : ℝ} (ht : 0 < t) :272Real.log t ≤ 2 * (Real.sqrt t - 1) := by273have hs := Real.sqrt_pos.2 ht274have hl := Real.log_le_sub_one_of_pos hs275calc276Real.log t = Real.log (Real.sqrt t ^ 2) :=277congrArg Real.log (Real.sq_sqrt ht.le).symm278_ = 2 * Real.log (Real.sqrt t) := by rw [Real.log_pow]; norm_num279_ ≤ 2 * (Real.sqrt t - 1) := by linarith280281theorem threshold_base_log {y : ℝ} (hy : (5 : ℝ) / 3 ≤ y) :282y + Real.log (256 * y ^ 2) ≤ 5 * y := by283have hy0 : 0 < y := by linarith284have hl := Real.log_le_sub_one_of_pos (div_pos hy0 (by norm_num : (0 : ℝ) < 2))285rw [Real.log_div hy0.ne' (by norm_num)] at hl286have h2 : Real.log 2 < (7 : ℝ) / 10 :=287Real.log_two_lt_d9.trans (by norm_num)288have h256 : Real.log (256 : ℝ) = 8 * Real.log 2 := by289have he : (256 : ℝ) = 2 ^ (8 : ℕ) := by norm_num290rw [he, Real.log_pow]291norm_num292rw [Real.log_mul (by norm_num) (pow_ne_zero _ hy0.ne'), h256, Real.log_pow]293norm_num294linarith295296/-- The threshold absorption estimate (equation `threshold-absorption`).297The proof uses an elementary logarithm inequality in place of monotonicity298of `x / (y + log x)^2`. -/299theorem threshold_absorption {y n : ℝ} (hy : (5 : ℝ) / 3 ≤ y)300(hn : 256 * y ^ 2 ≤ n) :301(y + Real.log n) ^ 2 ≤ (25 : ℝ) / 256 * n := by302have hy0 : 0 < y := by linarith303have hx0 : 0 < 256 * y ^ 2 := by positivity304have hn0 : 0 < n := hx0.trans_le hn305have hr : 1 ≤ n / (256 * y ^ 2) := by306apply (le_div_iff₀ hx0).2307simpa using hn308have hr0 : 0 < n / (256 * y ^ 2) := by linarith309have hs1 : 1 ≤ Real.sqrt (n / (256 * y ^ 2)) := by310exact (Real.le_sqrt (by norm_num) hr0.le).2 (by simpa using hr)311have hlog := log_le_twice_sqrt_sub_one hr0312rw [Real.log_div hn0.ne' hx0.ne'] at hlog313have hbase := threshold_base_log hy314have hprod : 0 ≤ (5 * y - 2) * (Real.sqrt (n / (256 * y ^ 2)) - 1) :=315mul_nonneg (by linarith) (by linarith)316have hub : y + Real.log n ≤ 5 * y * Real.sqrt (n / (256 * y ^ 2)) := by317nlinarith318have hn1 : 1 ≤ n := by nlinarith [sq_nonneg (y - 5 / 3)]319have hu0 : 0 ≤ y + Real.log n := add_nonneg hy0.le (Real.log_nonneg hn1)320have hsq := sq_le_sq₀ hu0 (by positivity : 0 ≤ 5 * y * Real.sqrt (n / (256 * y ^ 2)))321have hsquare : (5 * y * Real.sqrt (n / (256 * y ^ 2))) ^ 2 =322(25 : ℝ) / 256 * n := by323rw [mul_pow, Real.sq_sqrt hr0.le]324field_simp325ring326rw [← hsquare]327exact hsq.2 hub328329/-- The two numerical absorptions used for the total error factor and330matrix coefficient cost, with the manuscript's exact constants. -/331theorem error_cost_absorption {u n : ℝ} (hu : (15 : ℝ) / 2 ≤ u)332(hn : u ^ 2 ≤ (25 : ℝ) / 256 * n) :3337 / 4 * u ^ 2 + 14 * u < n / 2 := by334have hquad : 14 * u ≤ (28 : ℝ) / 15 * u ^ 2 := by335nlinarith336have hn0 : 0 < n := by nlinarith337nlinarith338339theorem coefficient_cost_absorption {u n : ℝ} (hu : (15 : ℝ) / 2 ≤ u)340(hn : u ^ 2 ≤ (25 : ℝ) / 256 * n) :3417 / 4 * u ^ 2 + 21 / 2 * u < n / 3 := by342have hquad : 21 / 2 * u ≤ (7 : ℝ) / 5 * u ^ 2 := by343nlinarith344have hn0 : 0 < n := by nlinarith345nlinarith346347/-- The paper's explicit integer threshold, with natural-number ceiling. -/348def n₀ (K : ℕ) : ℕ := ⌈256 * (1 + Real.log (K : ℝ)) ^ 2⌉₊349350theorem threshold_consequences {K n : ℕ} (hK : 2 ≤ K) (hn : n₀ K ≤ n) :351(0 ≤ Real.log (K : ℝ)) ∧352((64 : ℝ) ≤ n) ∧353((15 : ℝ) / 2 ≤ 1 + Real.log (K : ℝ) + Real.log (n : ℝ)) ∧354((1 + Real.log (K : ℝ) + Real.log (n : ℝ)) ^ 2 ≤355(25 : ℝ) / 256 * n) := by356have hKreal : (2 : ℝ) ≤ K := by exact_mod_cast hK357have hlogK := Real.log_le_log (by norm_num : (0 : ℝ) < 2) hKreal358have hh : (2 : ℝ) / 3 ≤ Real.log (K : ℝ) := by359linarith [Real.log_two_gt_d9]360have hy : (5 : ℝ) / 3 ≤ 1 + Real.log (K : ℝ) := by linarith361have hbase : 256 * (1 + Real.log (K : ℝ)) ^ 2 ≤ (n : ℝ) := by362exact (Nat.le_ceil _).trans (by exact_mod_cast hn)363have hn512 : (512 : ℝ) ≤ n := by364nlinarith [sq_nonneg (1 + Real.log (K : ℝ) - 5 / 3)]365have hv0 := Real.log_le_log (by norm_num : (0 : ℝ) < 512) hn512366have h512 : Real.log (512 : ℝ) = 9 * Real.log 2 := by367have he : (512 : ℝ) = 2 ^ (9 : ℕ) := by norm_num368rw [he, Real.log_pow]369norm_num370rw [h512] at hv0371have hv : 6 ≤ Real.log (n : ℝ) := by linarith [Real.log_two_gt_d9]372refine ⟨by linarith, by linarith, by linarith, ?_⟩373exact threshold_absorption hy hbase374375/-- Summed support estimates imply the total relative-error logarithm376bound. The premises are the distinct elementary support/counting estimates,377not the desired final error estimate. -/378theorem reduction_error_log_bound {h n u initial overhead tensor shortening : ℝ}379(hu : (15 : ℝ) / 2 ≤ u)380(hthreshold : u ^ 2 ≤ (25 : ℝ) / 256 * n)381(hinitial : initial ≤ n * h / 2 + u)382(hoverhead : overhead ≤ 5 * u)383(htensor : tensor ≤ n * h + 3 / 4 * u ^ 2 + 2 * u)384(hshortening : shortening ≤ u ^ 2 + 6 * u) :385initial + overhead + tensor + shortening < gamma h * n := by386have ha := error_cost_absorption hu hthreshold387dsimp [gamma]388nlinarith389390theorem reduction_coefficient_log_bound {h n u overhead tensor shortening : ℝ}391(hu : (15 : ℝ) / 2 ≤ u)392(hthreshold : u ^ 2 ≤ (25 : ℝ) / 256 * n)393(hoverhead : overhead ≤ 5 / 2 * u)394(htensor : tensor ≤ n * h + 3 / 4 * u ^ 2 + 2 * u)395(hshortening : shortening ≤ u ^ 2 + 6 * u) :396overhead + tensor + shortening < n * h + n / 3 := by397have ha := coefficient_cost_absorption hu hthreshold398nlinarith399400theorem log_one_add_two_mul_le {n : ℝ} (hn : 2 ≤ n) :401Real.log (1 + 2 * n) ≤ n := by402have hn0 : 0 ≤ n := by linarith403have hs := Real.sum_le_exp_of_nonneg hn0 3404simp only [Finset.sum_range_succ, Finset.sum_range_zero, zero_add, pow_zero,405pow_one] at hs406norm_num at hs407have he : 1 + 2 * n ≤ Real.exp n := by nlinarith408exact (Real.log_le_iff_le_exp (by linarith : 0 < 1 + 2 * n)).2 he409410/-- Exact scalar replacement for the manuscript's monotonicity argument for411`t ↦ t * exp (-n*t)`. -/412theorem zeta_exponential_comparison {n z : ℝ} (hn : 2 ≤ n)413(hz : (3 : ℝ) / 2 ≤ z) :414z * Real.exp (-(z * n)) ≤415(3 : ℝ) / 2 * Real.exp (-(3 / 2 * n)) := by416have hd : 0 ≤ z - 3 / 2 := by linarith417have he := Real.add_one_le_exp (n * (z - 3 / 2))418have hm : z ≤ 3 / 2 * Real.exp (n * (z - 3 / 2)) := by419nlinarith [mul_nonneg (show 0 ≤ n - 2 by linarith) hd]420have hmul := mul_le_mul_of_nonneg_right hm (Real.exp_pos (-(z * n))).le421have heq : Real.exp (n * (z - 3 / 2)) * Real.exp (-(z * n)) =422Real.exp (-(3 / 2 * n)) := by423rw [← Real.exp_add]424congr 1425ring426simpa only [mul_assoc, heq] using hmul427428/-- The three separate bounds obtained from the Haar estimate imply the429final scalar error estimate. These hypotheses expose the precise analytic430inputs needed from the operator/random-matrix argument. -/431theorem final_error_from_contributions {n h ε A D R : ℝ}432(hn : 64 ≤ n) (hh : (2 : ℝ) / 3 ≤ h) (hε : 0 < ε)433(hA : A / ε ≤ 8 * n * (n + 1) * Real.log (1 + 2 * n) * Real.exp (-n / 2))434(hD : D / ε ≤ 664 * zeta h * n ^ 3 * (n + 1) * Real.exp (-(zeta h * n)))435(hR : R / ε ≤ n ^ 2 * Real.exp (-n)) :436A + D + R ≤ ε / 16 := by437have hn0 : 0 ≤ n := by linarith438have hntwo : 2 ≤ n := by linarith439have hn1 : n + 1 ≤ 3 / 2 * n := by linarith440have hlog := log_one_add_two_mul_le hntwo441have hlog0 : 0 ≤ Real.log (1 + 2 * n) := Real.log_nonneg (by linarith)442have hz : (3 : ℝ) / 2 ≤ zeta h := by dsimp [zeta]; linarith443have hz0 : 0 ≤ zeta h := by linarith444have hzexp := zeta_exponential_comparison hntwo hz445have hA' : A / ε ≤ 12 * n ^ 3 * Real.exp (-n / 2) := by446have h₁ := mul_le_mul_of_nonneg_left hn1 (show 0 ≤ 8 * n by positivity)447have h₂ := mul_le_mul h₁ hlog hlog0 (by positivity : 0 ≤ 8 * n * (3 / 2 * n))448have h₃ := mul_le_mul_of_nonneg_right h₂ (Real.exp_pos (-n / 2)).le449nlinarith450have hD' : D / ε ≤ 1494 * n ^ 4 * Real.exp (-3 * n / 2) := by451have h₁ := mul_le_mul_of_nonneg_left hn1 (show 0 ≤ 664 * n ^ 3 by positivity)452have h₂ := mul_le_mul h₁ hzexp453(by positivity : 0 ≤ zeta h * Real.exp (-(zeta h * n)))454(by positivity : 0 ≤ 664 * n ^ 3 * (3 / 2 * n))455have heq : -(3 / 2 * n) = -3 * n / 2 := by ring456rw [heq] at h₂457nlinarith458have ht := final_three_tails_lt hn459dsimp [tailBound] at ht460have htotal : (A + D + R) / ε < 1 / 16 := by461rw [add_div, add_div]462linarith463have h := (div_lt_iff₀ hε).1 htotal464linarith465466theorem exp_dominates_linear {x : ℝ} (hx : 0 ≤ x) :467(9 : ℝ) / 2 * x ≤ Real.exp (2 * x) := by468have he := Real.add_one_le_exp (2 * x - 1)469have hm := mul_le_mul_of_nonneg_left he (Real.exp_pos 1).le470have heq : Real.exp 1 * Real.exp (2 * x - 1) = Real.exp (2 * x) := by471rw [← Real.exp_add]472congr 1473ring474rw [heq] at hm475have hconst := Real.exp_one_gt_d9476nlinarith477478theorem coefficient_remainder_absorption {h n : ℝ} (hh : (2 : ℝ) / 3 ≤ h)479(hn : 2 ≤ n) :480Real.log 4 + 2 * n * h + n / 3 ≤481Real.exp (2 * n * h) * Real.log (1 + 2 * n) := by482have hn0 : 0 ≤ n := by linarith483have hh0 : 0 ≤ h := by linarith484have hnh : (4 : ℝ) / 3 ≤ n * h := by485nlinarith [mul_nonneg (show 0 ≤ n - 2 by linarith) hh0]486have hlog4 : Real.log 4 < (7 : ℝ) / 5 := by487have he : (4 : ℝ) = 2 ^ (2 : ℕ) := by norm_num488rw [he, Real.log_pow]489norm_num490linarith [Real.log_two_lt_d9]491have hlog : 1 ≤ Real.log (1 + 2 * n) := by492apply (Real.le_log_iff_exp_le (by linarith : 0 < 1 + 2 * n)).2493linarith [Real.exp_one_lt_three]494have habsorb : Real.log 4 + 2 * n * h + n / 3 ≤ 9 / 2 * (n * h) := by495nlinarith496have he := exp_dominates_linear (mul_nonneg hn0 hh0)497have he' : Real.exp (2 * (n * h)) = Real.exp (2 * n * h) := by congr 1; ring498rw [he'] at he499have hm := mul_le_mul_of_nonneg_left hlog (Real.exp_pos (2 * n * h)).le500nlinarith501502theorem final_coefficient_size {h n J reductions L : ℝ}503(hh : (2 : ℝ) / 3 ≤ h) (hn : 2 ≤ n)504(hJ : J ≤ (Real.exp (2 * n * h) - 1) * Real.log (1 + 2 * n))505(hred : reductions ≤ n * h + n / 3)506(hL : L ≤ Real.log 4 + J + n * h + reductions) :507L ≤ 2 * Real.exp (2 * n * h) * Real.log (1 + 2 * n) := by508have hr := coefficient_remainder_absorption hh hn509have hlog0 : 0 ≤ Real.log (1 + 2 * n) := Real.log_nonneg (by linarith)510nlinarith511512theorem tolerance_times_error_factor {h n T : ℝ} (hn : 0 < n)513(hT : T ≤ Real.exp (gamma h * n)) :514T * tolerance h n ≤ 1 / n := by515have he := mul_le_mul_of_nonneg_right hT (tolerance_pos (h := h) hn).le516have heq : Real.exp (gamma h * n) * tolerance h n = 1 / n := by517dsimp [tolerance]518rw [← mul_div_assoc, ← Real.exp_add]519simp520exact heq ▸ he521522theorem coefficient_error_contribution {h n L invp : ℝ}523(hn : 0 < n) (_hL0 : 0 ≤ L) (hip0 : 0 ≤ invp)524(hL : L ≤ 2 * Real.exp (2 * h * n) * Real.log (1 + 2 * n))525(hip : invp ≤ 4 * Real.exp (-(dimensionExponent h * n / 80))) :526((n + 1) * L * invp) / tolerance h n ≤5278 * n * (n + 1) * Real.log (1 + 2 * n) * Real.exp (-n / 2) := by528have hlog0 : 0 ≤ Real.log (1 + 2 * n) := Real.log_nonneg (by linarith)529have hm := mul_le_mul hL hip hip0 (by positivity :5300 ≤ 2 * Real.exp (2 * h * n) * Real.log (1 + 2 * n))531have hm' := mul_le_mul_of_nonneg_left hm (show 0 ≤ n + 1 by linarith)532have hexp : Real.exp (2 * h * n) *533Real.exp (-(dimensionExponent h * n / 80)) =534Real.exp (-(gamma h * n)) * Real.exp (-n / 2) := by535rw [← Real.exp_add, ← Real.exp_add]536congr 1537dsimp [gamma, dimensionExponent]538ring539apply (div_le_iff₀ (tolerance_pos hn)).2540calc541(n + 1) * L * invp ≤ (n + 1) *542(2 * Real.exp (2 * h * n) * Real.log (1 + 2 * n) *543(4 * Real.exp (-(dimensionExponent h * n / 80)))) := by544simpa only [mul_assoc] using hm'545_ = 8 * (n + 1) * Real.log (1 + 2 * n) *546(Real.exp (2 * h * n) * Real.exp (-(dimensionExponent h * n / 80))) := by ring547_ = (8 * n * (n + 1) * Real.log (1 + 2 * n) * Real.exp (-n / 2)) *548tolerance h n := by549rw [hexp]550dsimp [tolerance]551field_simp552553theorem dimension_error_contribution {h n logN logp invp : ℝ}554(hh : 0 ≤ h) (hn : 0 < n)555(_hN0 : 0 ≤ logN) (_hp0 : 0 ≤ logp) (hip0 : 0 ≤ invp)556(hN : logN ≤ 2 * dimensionExponent h * n)557(hp : logp ≤ logN / 80)558(hip : invp ≤ 4 * Real.exp (-(dimensionExponent h * n / 80))) :559((n * (n + 1) / 2) * (logN + 3 * logp) * invp) / tolerance h n ≤560664 * zeta h * n ^ 3 * (n + 1) * Real.exp (-(zeta h * n)) := by561have hlog : logN + 3 * logp ≤ (83 : ℝ) / 40 * dimensionExponent h * n := by562linarith563have hblog : 0 ≤ (83 : ℝ) / 40 * dimensionExponent h * n := by564dsimp [dimensionExponent]565positivity566have hm := mul_le_mul hlog hip hip0 hblog567have hfactor : 0 ≤ n * (n + 1) / 2 := by positivity568have hm' := mul_le_mul_of_nonneg_left hm hfactor569have hb := dimensionExponent_le hh570have hz0 : 0 ≤ zeta h := by dsimp [zeta]; positivity571have hexp : Real.exp (-(dimensionExponent h * n / 80)) =572Real.exp (-(gamma h * n)) * Real.exp (-(zeta h * n)) := by573rw [← Real.exp_add]574congr 1575dsimp [dimensionExponent, gamma, zeta]576ring577apply (div_le_iff₀ (tolerance_pos hn)).2578calc579n * (n + 1) / 2 * (logN + 3 * logp) * invp ≤580n * (n + 1) / 2 * ((83 : ℝ) / 40 * dimensionExponent h * n *581(4 * Real.exp (-(dimensionExponent h * n / 80)))) := by582simpa only [mul_assoc] using hm'583_ = (83 : ℝ) / 20 * dimensionExponent h * n ^ 2 * (n + 1) *584Real.exp (-(dimensionExponent h * n / 80)) := by ring585_ ≤ 664 * zeta h * n ^ 2 * (n + 1) *586Real.exp (-(dimensionExponent h * n / 80)) := by587have hm'' := mul_le_mul_of_nonneg_right hb (show 0 ≤588(83 : ℝ) / 20 * n ^ 2 * (n + 1) *589Real.exp (-(dimensionExponent h * n / 80)) by positivity)590nlinarith591_ = (664 * zeta h * n ^ 3 * (n + 1) * Real.exp (-(zeta h * n))) *592tolerance h n := by593rw [hexp]594dsimp [tolerance]595field_simp596597theorem remainder_error_contribution {h n remainderLog : ℝ}598(hh : 0 ≤ h) (hn : 0 < n)599(hR : remainderLog ≤ Real.exp (-(dimensionExponent h * n / 2))) :600(n * remainderLog) / tolerance h n ≤ n ^ 2 * Real.exp (-n) := by601have hgap := remainder_exponent_gap hh602have hgap' := mul_le_mul_of_nonneg_right hgap hn.le603have he : Real.exp (-(dimensionExponent h * n / 2)) ≤604Real.exp (-(gamma h * n) - n) := by605apply Real.exp_le_exp.mpr606nlinarith607have hr := hR.trans he608have hm := mul_le_mul_of_nonneg_left hr hn.le609apply (div_le_iff₀ (tolerance_pos hn)).2610calc611n * remainderLog ≤ n * Real.exp (-(gamma h * n) - n) := hm612_ = (n ^ 2 * Real.exp (-n)) * tolerance h n := by613rw [sub_eq_add_neg, Real.exp_add]614dsimp [tolerance]615field_simp616617/-- Scalar validation of the complete logarithmic Haar multiplier. The618premises are the separately stated coefficient-size, moment-size and619dimension estimates derived in the paper. -/620theorem haar_error_bound {h n L logN logp invp remainderLog : ℝ}621(hh : (2 : ℝ) / 3 ≤ h) (hn : 64 ≤ n)622(hL0 : 0 ≤ L) (hN0 : 0 ≤ logN) (hp0 : 0 ≤ logp) (hip0 : 0 ≤ invp)623(hL : L ≤ 2 * Real.exp (2 * h * n) * Real.log (1 + 2 * n))624(hN : logN ≤ 2 * dimensionExponent h * n)625(hp : logp ≤ logN / 80)626(hip : invp ≤ 4 * Real.exp (-(dimensionExponent h * n / 80)))627(hR : remainderLog ≤ Real.exp (-(dimensionExponent h * n / 2))) :628(n + 1) * L * invp + (n * (n + 1) / 2) * (logN + 3 * logp) * invp +629n * remainderLog ≤ tolerance h n / 16 := by630have hn0 : 0 < n := by linarith631have hh0 : 0 ≤ h := by linarith632exact final_error_from_contributions hn hh (tolerance_pos hn0)633(coefficient_error_contribution hn0 hL0 hip0 hL hip)634(dimension_error_contribution hh0 hn0 hN0 hp0 hip0 hN hp hip)635(remainder_error_contribution hh0 hn0 hR)636637/-- The logarithm of the multiplicative factor in equation `haar`, with the638paper's explicit choices of `N` and the even moment order `p`. -/639def haarLogMultiplier (h n L : ℝ) : ℝ :=640(n + 1) * L / (momentParameter h n : ℝ) +641n * (n + 1) * Real.log (dimensionChoice h n : ℝ) /642(2 * (momentParameter h n : ℝ)) +6433 * n * (n + 1) * Real.log (momentParameter h n : ℝ) /644(2 * (momentParameter h n : ℝ)) +645n * Real.log (1 + Real.exp (-(Real.log (dimensionChoice h n : ℝ) / 2)))646647/-- With explicit ceiling/floor parameters, only the separately proved648coefficient-size estimate remains a premise of the scalar Haar error bound. -/649theorem explicit_haar_error_bound {h n L : ℝ} (hh : (2 : ℝ) / 3 ≤ h)650(hn : 64 ≤ n) (hL0 : 0 ≤ L)651(hL : L ≤ 2 * Real.exp (2 * h * n) * Real.log (1 + 2 * n)) :652haarLogMultiplier h n L ≤ tolerance h n / 16 := by653have hn2 : 2 ≤ n := by linarith654obtain ⟨_, hp, _, _⟩ := moment_parameter_bounds hh hn2655have hp1 : (1 : ℝ) ≤ momentParameter h n := by exact_mod_cast (by omega : 1 ≤ momentParameter h n)656have hp0 : (0 : ℝ) ≤ momentParameter h n := hp1.trans' (by norm_num)657obtain ⟨hNlo, hNhi⟩ := dimension_choice_log_bounds hh hn2658have hh0 : 0 ≤ h := by linarith659have hn0 : 0 ≤ n := by linarith660have hbn0 : 0 ≤ dimensionExponent h * n := by dsimp [dimensionExponent]; positivity661have hN0 : 0 ≤ Real.log (dimensionChoice h n : ℝ) := hbn0.trans hNlo662have hpLog0 : 0 ≤ Real.log (momentParameter h n : ℝ) := Real.log_nonneg hp1663have hb := haar_error_bound hh hn hL0 hN0 hpLog0 (by positivity :664(0 : ℝ) ≤ 1 / (momentParameter h n : ℝ)) hL hNhi665(moment_parameter_log_bound hh hn2)666(moment_parameter_inverse_bound hh hn2)667(remainder_log_bound hh hn2)668convert hb using 1669dsimp [haarLogMultiplier]670ring671672/-- The final conversion from an additive logarithmic error to the target673multiplicative norm tolerance. -/674theorem final_log_comparison {ε E : ℝ} (hε : 0 < ε) (hε1 : ε < 1)675(hE : E ≤ ε / 16) : E < Real.log (1 + ε / 2) := by676have hp : 0 < 1 + ε / 2 := by linarith677have hlog := Real.one_sub_inv_le_log_of_pos hp678have hrewrite : 1 - (1 + ε / 2)⁻¹ = ε / (2 + ε) := by679field_simp680ring681rw [hrewrite] at hlog682have hdiv : ε / 3 < ε / (2 + ε) := by683apply (div_lt_div_iff_of_pos_left hε (by norm_num) (by linarith)).2684linarith685linarith686687theorem explicit_haar_log_comparison {h n L : ℝ} (hh : (2 : ℝ) / 3 ≤ h)688(hn : 64 ≤ n) (hL0 : 0 ≤ L)689(hL : L ≤ 2 * Real.exp (2 * h * n) * Real.log (1 + 2 * n)) :690haarLogMultiplier h n L < Real.log (1 + tolerance h n / 2) := by691have hn0 : 0 < n := by linarith692have hn2 : 2 ≤ n := by linarith693have hh0 : 0 ≤ h := by linarith694exact final_log_comparison (tolerance_pos hn0) (tolerance_lt_one hh0 hn2)695(explicit_haar_error_bound hh hn hL0 hL)696697/-- The numerical appendix at the paper's stated integer threshold. Here698`L` denotes `log (2*m_n)`; its displayed bound is the coefficient-size699certificate obtained from the separately formalized reduction arithmetic. -/700theorem quantitative_certificate {K n : ℕ} {L : ℝ} (hK : 2 ≤ K)701(hn : n₀ K ≤ n) (hL0 : 0 ≤ L)702(hL : L ≤ 2 * (K : ℝ) ^ (2 * n) * Real.log (1 + 2 * (n : ℝ))) :703Even (momentParameter (Real.log (K : ℝ)) n) ∧7042 ≤ momentParameter (Real.log (K : ℝ)) n ∧705haarLogMultiplier (Real.log (K : ℝ)) n L ≤706tolerance (Real.log (K : ℝ)) n / 16 ∧707haarLogMultiplier (Real.log (K : ℝ)) n L <708Real.log (1 + tolerance (Real.log (K : ℝ)) n / 2) := by709obtain ⟨_, hn64, _, _⟩ := threshold_consequences hK hn710have hKreal : (2 : ℝ) ≤ K := by exact_mod_cast hK711have hlogK := Real.log_le_log (by norm_num : (0 : ℝ) < 2) hKreal712have hh : (2 : ℝ) / 3 ≤ Real.log (K : ℝ) := by linarith [Real.log_two_gt_d9]713have hK0 : (0 : ℝ) < K := by linarith714have hexp : Real.exp (2 * Real.log (K : ℝ) * (n : ℝ)) = (K : ℝ) ^ (2 * n) := by715have he : 2 * Real.log (K : ℝ) * (n : ℝ) = (2 * n : ℕ) * Real.log (K : ℝ) := by716push_cast717ring718rw [he, Real.exp_nat_mul, Real.exp_log hK0]719have hL' : L ≤ 2 * Real.exp (2 * Real.log (K : ℝ) * (n : ℝ)) *720Real.log (1 + 2 * (n : ℝ)) := by simpa only [hexp] using hL721have hn2 : (2 : ℝ) ≤ n := by linarith722obtain ⟨heven, hp, _, _⟩ := moment_parameter_bounds hh hn2723exact ⟨heven, hp, explicit_haar_error_bound hh hn64 hL0 hL',724explicit_haar_log_comparison hh hn64 hL0 hL'⟩725726end727728end Nonadditivity.Quantitative