Pratik Patil

AncillaKernelBound.lean

1module23public import SubentropyCertificates.AncillaReplicatedFactor4public import Mathlib.Analysis.Convex.SpecificFunctions.Basic56/-! An integrable majorant for the centered, replicated determinant spectrum. -/7@[expose] public section8noncomputable section9open scoped BigOperators10namespace SubentropyCertificates.AncillaLimit1112private theorem sum_le_product {I : Type*} (s : Finset I) (v : I → ℝ) (hv : ∀ i, 0 ≤ v i) :13    1 + ∑ i ∈ s, v i ≤ ∏ i ∈ s, (1 + v i) := by14  classical15  induction s using Finset.induction_on with16  | empty => simp17  | @insert i s hi ih =>18    rw [Finset.sum_insert hi, Finset.prod_insert hi]19    have hcross := mul_nonneg (hv i) (Finset.sum_nonneg (fun j (_ : j ∈ s) ↦ hv j))20    calc21      _ ≤ (1 + v i) * (1 + ∑ j ∈ s, v j) := by nlinarith22      _ ≤ _ := mul_le_mul_of_nonneg_left ih (by linarith [hv i])2324private theorem scalar_envelope (t : ℝ) (ht : 0 < t) (n : ℕ) (hn : 2 ≤ n) :25    (1 + t) ^ 2 ≤ 4 * (1 + t / n) ^ n := by26  have hN : (2 : ℝ) ≤ n := by exact_mod_cast hn27  have hNpos : (0 : ℝ) < n := by linarith28  have hx : 0 < 1 + t / n := by positivity29  have hhalf := one_add_mul_self_le_rpow_one_add (s := t / n) (p := (n : ℝ) / 2)30    (by linarith [div_pos ht hNpos]) (by linarith)31  have heq : (n : ℝ) / 2 * (t / n) = t / 2 := by field_simp32  rw [heq] at hhalf33  have hpow : ((1 + t / n) ^ ((n : ℝ) / 2)) ^ (2 : ℕ) = (1 + t / n) ^ n := by34    rw [← Real.rpow_natCast, ← Real.rpow_mul hx.le]35    simp36  have hsq := pow_le_pow_left₀ (by linarith : 0 ≤ 1 + t / 2) hhalf 237  rw [hpow] at hsq38  nlinarith3940/-- For dimension at least two, the centered scaled factor is bounded by a single41integrable function, uniformly in the dimension and in the probability spectrum. -/42theorem replicatedFactor_centered_bound {I : Type*} [Fintype I] (w : I → ℝ)43    (hw : ∀ i, 0 ≤ w i) (hs : ∑ i, w i = 1) {k : ℕ} (hk : 1 ≤ k) {t : ℝ} (ht : 0 < t) :44    |((k + 1 : ℕ) : ℝ) * (replicatedFactor w k t - Real.exp (-t)) / t ^ 2| ≤45      4 / (1 + t) ^ 2 := by46  let n := k + 147  let x := t / (n : ℝ)48  let P := ∏ i, (1 + t * w i / (n : ℝ))49  have hn : 2 ≤ n := by dsimp [n]; omega50  have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega)51  have hx : 0 < x := div_pos ht hnpos52  have hnx : (n : ℝ) * x = t := by dsimp [x]; field_simp53  have hv i : 0 ≤ t * w i / (n : ℝ) := by positivity [hw i]54  have hsum : ∑ i, t * w i / (n : ℝ) = x := by55    rw [← Finset.sum_div, ← Finset.mul_sum, hs, mul_one]56  have hprod : 1 + x ≤ P := by57    simpa only [P, hsum] using sum_le_product Finset.univ (fun i ↦ t * w i / (n : ℝ)) hv58  have hP : P ≤ Real.exp x := by59    rw [← hsum, Real.exp_sum]60    dsimp only [P]61    exact Finset.prod_le_prod₀ (fun i _ ↦ by linarith [hv i]) (fun i _ ↦ by62      simpa [add_comm] using Real.add_one_le_exp (t * w i / (n : ℝ)))63  have h1x : 0 < 1 + x := by linarith64  have hPpos : 0 < P := h1x.trans_le hprod65  have hlow : Real.exp (-t) ≤ replicatedFactor w k t := by66    change Real.exp (-t) ≤ P⁻¹ ^ n67    rw [← hnx, ← mul_neg, Real.exp_nat_mul, Real.exp_neg]68    exact pow_le_pow_left₀ (by positivity) (inv_anti₀ hPpos hP) _69  let F := (1 + x)⁻¹ ^ n70  have hF : replicatedFactor w k t ≤ F :=71    pow_le_pow_left₀ (by positivity : 0 ≤ P⁻¹) (inv_anti₀ h1x hprod) n72  have hFpos : 0 < F := by dsimp [F]; positivity73  let D := t - (n : ℝ) * Real.log (1 + x)74  have hid : F * Real.exp (-D) = Real.exp (-t) := by75    have hFexp : F = Real.exp (-((n : ℝ) * Real.log (1 + x))) := by76      dsimp [F]77      rw [Real.exp_neg, Real.exp_nat_mul, Real.exp_log h1x, inv_pow]78    rw [hFexp, ← Real.exp_add]79    congr 180    dsimp [D]81    ring82  have hlog : x - Real.log (1 + x) ≤ x ^ 2 := by83    have hh := Real.one_sub_inv_le_log_of_pos h1x84    have hi : x - x ^ 2 ≤ 1 - (1 + x)⁻¹ := by85      calc86        _ ≤ x / (1 + x) := by87          apply (le_div_iff₀ h1x).288          nlinarith [pow_nonneg hx.le 3]89        _ = _ := by field_simp; ring90    linarith91  have hD : (n : ℝ) * D ≤ t ^ 2 := by92    have h := mul_le_mul_of_nonneg_left hlog (sq_nonneg (n : ℝ))93    dsimp [D]94    rw [← hnx]95    nlinarith only [h]96  have hdiff : F - Real.exp (-t) ≤ F * D := by97    rw [← hid]98    nlinarith only [mul_le_mul_of_nonneg_left (Real.one_sub_le_exp_neg D) hFpos.le]99  have hb : (n : ℝ) * (replicatedFactor w k t - Real.exp (-t)) / t ^ 2 ≤ F := by100    apply (div_le_iff₀ (sq_pos_of_pos ht)).2101    calc102      _ ≤ (n : ℝ) * (F * D) := mul_le_mul_of_nonneg_left ((sub_le_sub_right hF _).trans hdiff) hnpos.le103      _ = F * ((n : ℝ) * D) := by ring104      _ ≤ _ := mul_le_mul_of_nonneg_left hD hFpos.le105  rw [abs_of_nonneg (div_nonneg (mul_nonneg hnpos.le (sub_nonneg.mpr hlow)) (sq_nonneg t))]106  apply hb.trans107  change (1 + x)⁻¹ ^ n ≤ _108  rw [inv_pow, inv_eq_one_div, div_le_div_iff₀ (pow_pos h1x n) (by positivity)]109  simpa only [one_mul] using scalar_envelope t ht n hn110111end SubentropyCertificates.AncillaLimit112

Axioms used

Choose a statement to see which axioms its proof uses.