Pratik Patil

CurveTangent.lean

1module23public import SubentropyCertificates.CurveMonotonicity4public import Mathlib.Analysis.Convex.Deriv5public import Mathlib.MeasureTheory.Integral.DominatedConvergence67/-! The right tangent to the subentropy error curve. In the determinant8integral the derivative at zero is the same inverse square in every dimension.9The coordinate bound for the kernel also dominates its difference quotient. -/10@[expose] public section11noncomputable section12set_option autoImplicit false13set_option backward.isDefEq.respectTransparency false14open Matrix MeasureTheory Set Filter15open scoped BigOperators Topology16namespace SubentropyCertificates.ClassicalCurve17open D5.S3.Quantum.Subentropy.Basic18open D5.S3.Quantum.Subentropy.KernelBounds19open D5.S3.Quantum.Subentropy.DensityKernel20open D5.S3.Quantum.Subentropy.UniformIntegrals2122private def curveKernel (m : ℕ) (t e : ℝ) : ℝ :=23  subentropyKernel (diagonal (fun i => (extremalVector m e i : ℂ))) t2425private theorem curveKernel_formula (m : ℕ) {t : ℝ} (ht : 0 < t) (e : ℝ) :26    curveKernel m t e = t / (1 + t) -27      (t / (t + (1 - e))) * (t / (t + e / (m + 1 : ℕ))) ^ (m + 1) := by28  simp only [curveKernel, kernel_diagonal _ t ht.ne', Fintype.prod_option, extremalVector,29    Finset.prod_const, Finset.card_univ, Fintype.card_fin]3031private theorem curveKernel_zero (m : ℕ) {t : ℝ} (ht : 0 < t) : curveKernel m t 0 = 0 := by32  simp [curveKernel_formula m ht, ht.ne', add_comm]3334private theorem curveKernel_deriv_zero (m : ℕ) {t : ℝ} (ht : 0 < t) :35    HasDerivAt (curveKernel m t) (1 / (1 + t)^2) 0 := by36  let k : ℝ := (m + 1 : ℕ)37  have ht1 : t + 1 ≠ 0 := by linarith38  have hhead := (hasDerivAt_const (0 : ℝ) t).div39    ((hasDerivAt_const 0 t).add ((hasDerivAt_const 0 (1 : ℝ)).sub (hasDerivAt_id 0)))40    (by simpa using ht1)41  have htail := (hasDerivAt_const (0 : ℝ) t).div42    ((hasDerivAt_const 0 t).add ((hasDerivAt_id 0).div_const k)) (by simpa using ht.ne')43  have hd := (hasDerivAt_const (0 : ℝ) (t / (1 + t))).sub (hhead.mul (htail.pow (m + 1)))44  rw [show curveKernel m t = _ from funext (curveKernel_formula m ht)]45  convert hd using 146  all_goals first47    | rfl48    | simp [k, ht.ne']49      field_simp [ht.ne', ht1, show 1 + t ≠ 0 by linarith, show (m : ℝ) + 1 ≠ 0 by positivity]50      ring5152private theorem curveKernel_quotient_limit (m : ℕ) {t : ℝ} (ht : 0 < t) :53    Tendsto (fun e => curveKernel m t e / e) (𝓝[>] 0) (𝓝 (1 / (1 + t)^2)) := by54  simpa only [zero_add, curveKernel_zero m ht, sub_zero, smul_eq_mul, div_eq_inv_mul] using55    (curveKernel_deriv_zero m ht).tendsto_slope_zero_right5657/-- The quotient along the full right neighborhood of zero for n=m+2 labels. -/58theorem phi_div_error_tendsto_one (m : ℕ) :59    Tendsto (fun e => phi m e / e) (𝓝[>] 0) (𝓝 1) := by60  let μ := volume.restrict (Ioi (0 : ℝ))61  let F (e t : ℝ) := curveKernel m t e / e62  let g (t : ℝ) := 1 / (1 + t)^263  have hnear : ∀ᶠ e : ℝ in 𝓝[>] 0, e ∈ Ioo (0 : ℝ) 1 :=64    Ioo_mem_nhdsGT_of_mem ⟨le_rfl, zero_lt_one⟩65  have hg : Integrable g μ ∧ (∫ t, g t ∂μ) = 1 := by66    change IntegrableOn g (Ioi (0 : ℝ)) ∧ (∫ t in Ioi (0 : ℝ), g t) = 167    simpa [g, add_comm] using inverse_power 1 (by norm_num) 068  have hmeas : ∀ᶠ e in 𝓝[>] 0, AEStronglyMeasurable (F e) μ := by69    filter_upwards [hnear] with e he70    have hA := diagonal_density (extremal_probability m ⟨he.1.le, he.2.le⟩)71    exact ((integrable_subentropy_kernel hA.1 hA.2).div_const e).aestronglyMeasurable72  have hbound : ∀ᶠ e in 𝓝[>] 0, ∀ᵐ t ∂μ, ‖F e t‖ ≤ g t := by73    filter_upwards [hnear] with e he74    filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht75    have hp := extremal_probability m ⟨he.1.le, he.2.le⟩76    have h := classical_kernel_bounds (extremalVector m e) hp.1 hp.2 none t ht77    change 0 ≤ curveKernel m t e ∧ curveKernel m t e ≤ (1 - (1 - e)) / (1 + t)^2 at h78    rw [Real.norm_eq_abs, abs_of_nonneg (div_nonneg h.1 he.1.le)]79    apply (div_le_iff₀ he.1).mpr80    calc81      curveKernel m t e ≤ (1 - (1 - e)) / (1 + t)^2 := h.282      _ = g t * e := by dsimp [g]; ring83  have hlim : ∀ᵐ t ∂μ, Tendsto (fun e => F e t) (𝓝[>] 0) (𝓝 (g t)) := by84    filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht85    exact curveKernel_quotient_limit m ht86  have h := tendsto_integral_filter_of_dominated_convergence g hmeas hbound hg.1 hlim87  rw [hg.2] at h88  simpa only [F, μ, curveKernel, integral_div, phi, classicalSubentropy, matrixSubentropy] using h8990theorem phi_hasDerivWithinAt_zero (m : ℕ) :91    HasDerivWithinAt (phi m) 1 (Ioi 0) 0 := by92  apply (hasDerivWithinAt_iff_tendsto_slope' (show (0 : ℝ) ∉ Ioi 0 from lt_irrefl _)).mpr93  simpa only [slope_fun_def_field, phi_zero, sub_zero] using phi_div_error_tendsto_one m9495/-- Every positive chord lies strictly below the right tangent (including96the largest admissible error). The statement extends to the whole interval (0,1]. -/97theorem phi_lt_error (m : ℕ) {e : ℝ} (he : 0 < e) (he1 : e ≤ 1) : phi m e < e := by98  have h := (phi_strictConcave m).slope_lt_of_hasDerivWithinAt_Ioi99    (show (0 : ℝ) ∈ Icc (0 : ℝ) 1 from ⟨le_rfl, zero_le_one⟩) ⟨he.le, he1⟩ he100    (phi_hasDerivWithinAt_zero m)101  simpa only [slope_def_field, phi_zero, sub_zero, div_lt_one he] using h102103end SubentropyCertificates.ClassicalCurve

Axioms used

Choose a statement to see which axioms its proof uses.