Pratik Patil

ClassicalStrongConcavity.lean

1module2public import SubentropyCertificates.KernelStrongConvexity3public import Mathlib.Analysis.SpecialFunctions.ImproperIntegrals45/-! Integration of the pointwise curvature and the corrected concave6spectral functional. The diagonal result also applies directly to posteriors. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10open Matrix MeasureTheory Set Filter11open scoped BigOperators12namespace SubentropyCertificates.StrongConcavity13open SubentropyCertificates.ClassicalCurve14open D5.S3.Quantum.Subentropy.Basic15open D5.S3.Quantum.Subentropy.DensityKernel16variable {D J : Type*} [Fintype D] [DecidableEq D] [Fintype J]1718private def K (p : D → ℝ) := subentropyKernel (diagonal (fun i => (p i:ℂ)))19private def density (d : ℕ) (s : ℝ) := s⁻¹^2 * Real.exp (-(rate d*s⁻¹))2021private theorem density_integral {d : ℕ} (hd : 2 ≤ d) :22    IntegrableOn (density d) (Ioi 0) ∧ (∫ s in Ioi (0:ℝ), density d s) = mu d := by23  let g (t : ℝ) := Real.exp (-(rate d*t))24  have hneg : -rate d < 0 := neg_lt_zero.mpr (rate_pos hd)25  have hi : IntegrableOn g (Ioi 0) := by26    simpa [g,neg_mul] using integrableOn_exp_mul_Ioi (a := -rate d) hneg 027  have hv : (∫ t in Ioi (0:ℝ), g t) = mu d := by28    simpa [g,neg_mul,neg_div,one_div,inv_rate hd] using integral_exp_mul_Ioi (a := -rate d) hneg 029  have he (s : ℝ) (hs : s ∈ Ioi (0:ℝ)) :30      (|(-1:ℝ)| * s^((-1:ℝ)-1)) • g (s^(-1:ℝ)) = density d s := by31    rw [show (-1:ℝ)-1 = -2 by norm_num,Real.rpow_neg hs.le,Real.rpow_two,Real.rpow_neg_one]32    simp [g,density]33  refine ⟨((integrableOn_Ioi_comp_rpow_iff g (p := -1) (by norm_num)).mpr hi).congr_fun he34    measurableSet_Ioi,?_⟩35  rw [← setIntegral_congr_fun measurableSet_Ioi he,integral_comp_rpow_Ioi g (by norm_num : (-1:ℝ) ≠ 0)]36  exact hv3738private theorem kernel_laplace {p : D → ℝ} (hp : p ∈ probabilitySimplex D) {s : ℝ} (hs : 0 < s) :39    K p s = s/(1+s)-laplace s⁻¹ p := by40  rw [K,kernel_diagonal _ _ hs.ne',laplace,Real.exp_neg,Real.exp_sum,← Finset.prod_inv_distrib]41  congr 142  apply Finset.prod_congr rfl43  intro i _44  have hden : 0 < 1+s⁻¹*p i := by have := hp.1 i; positivity45  rw [Real.exp_log hden,show 1+s⁻¹*p i = (s+p i)/s by field_simp]46  simp4748theorem classical_chord (hd : 2 ≤ Fintype.card D) {p q : D → ℝ}49    (hp : p ∈ probabilitySimplex D) (hq : q ∈ probabilitySimplex D)50    {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a+b=1) :51    a*classicalSubentropy p+b*classicalSubentropy q +52      mu (Fintype.card D)/2*a*b*energy (q-p) ≤ classicalSubentropy (a • p+b • q) := by53  let r := a • p+b • q54  have hr : r ∈ probabilitySimplex D := simplex_convex D hp hq ha hb hab55  have hK {v : D → ℝ} (hv : v ∈ probabilitySimplex D) : IntegrableOn (K v) (Ioi 0) :=56    integrable_subentropy_kernel (diagonal_density hv).1 (diagonal_density hv).257  obtain ⟨hi,hv⟩ := density_integral hd58  let c := a*b/2*energy (q-p)59  have hpoint : ∀ᵐ s ∂volume.restrict (Ioi (0:ℝ)),60      a*K p s+b*K q s+c*density (Fintype.card D) s ≤ K r s := by61    filter_upwards [ae_restrict_mem measurableSet_Ioi] with s hs62    rw [kernel_laplace hp hs,kernel_laplace hq hs,kernel_laplace hr hs]63    have h := laplace_chord hd (inv_nonneg.mpr hs.le) hp hq ha hb hab64    have hconst := congrArg (fun x : ℝ => x*(s/(1+s))) hab65    change _ + c*density (Fintype.card D) s ≤ _ at h66    change _ ≤ s/(1+s)-laplace s⁻¹ (a • p+b • q)67    linarith68  have H := integral_mono_ae (((hK hp).const_mul a |>.add ((hK hq).const_mul b)).add (hi.const_mul c))69    (hK hr) hpoint70  have hsum : IntegrableOn (fun x => a*K p x+b*K q x) (Ioi 0) := ((hK hp).const_mul a).add ((hK hq).const_mul b)71  change (∫ x in Ioi (0:ℝ), a*K p x+b*K q x+c*density (Fintype.card D) x) ≤ _ at H72  rw [integral_add hsum (hi.const_mul c),73    integral_add ((hK hp).const_mul a) ((hK hq).const_mul b),integral_const_mul,integral_const_mul,74    integral_const_mul,hv] at H75  change a*classicalSubentropy p+b*classicalSubentropy q+c*mu (Fintype.card D) ≤ classicalSubentropy r at H76  dsimp only [c,r] at H77  linarith7879def corrected (p : D → ℝ) := classicalSubentropy p + mu (Fintype.card D)/2*energy p8081theorem corrected_concave (hd : 2 ≤ Fintype.card D) :82    ConcaveOn ℝ (probabilitySimplex D) corrected := by83  refine ⟨simplex_convex D,?_⟩84  intro p hp q hq a b ha hb hab85  have h := classical_chord hd hp hq ha hb hab86  have hid : energy (a • p+b • q) + a*b*energy (q-p) = a*energy p+b*energy q := by87    unfold energy88    simp only [Finset.mul_sum,← Finset.sum_add_distrib]89    apply Finset.sum_congr rfl90    intro i _91    simp only [Pi.add_apply,Pi.sub_apply,Pi.smul_apply,smul_eq_mul]92    linear_combination (a*(p i)^2+b*(q i)^2)*hab93  simp only [corrected,smul_eq_mul]94  linarith only [h,congrArg (fun x => mu (Fintype.card D)/2*x) hid]9596theorem corrected_perm (p : D → ℝ) (σ : Equiv.Perm D) : corrected (p ∘ σ) = corrected p := by97  unfold corrected98  rw [classical_subentropy_reindex]99  have h : energy (p ∘ σ) = energy p := Equiv.sum_comp σ (fun i => p i^2)100  rw [h]101102end SubentropyCertificates.StrongConcavity

Axioms used

Choose a statement to see which axioms its proof uses.