Pratik Patil

EndpointCurvatureHessian.lean

1module23public import SubentropyCertificates.EndpointCurvatureMoments4public import SubentropyCertificates.EndpointCurvatureGradient5public import SubentropyCertificates.GaussianGradientDefs6import all SubentropyCertificates.EndpointCurvatureGradient7import all SubentropyCertificates.ExponentialSignMoments8import all SubentropyCertificates.GaussianSpatialSign910/-! The mixed partial derivatives of the Gaussian spectral functional at the uniform state. -/11@[expose] public section12noncomputable section13open MeasureTheory ProbabilityTheory Real Set Filter14open scoped BigOperators Topology15namespace SubentropyCertificates.EndpointCurvature16open SubentropyCertificates.ConditionalContinuity17open SubentropyCertificates.Representations18local instance : IsProbabilityMeasure (expMeasure 1) := isProbabilityMeasure_expMeasure one_pos19variable {D : Type*} [Fintype D] [DecidableEq D]2021omit [DecidableEq D] in22/-- On diagonal weights the exponential and circular complex Gaussian expectations agree. -/23theorem spectralGaussianF_eq_circular (w : D → ℝ) :24    spectralGaussianF w = ∫ g, diagonalEnergy w g*log (diagonalEnergy w g) ∂circularGaussian D :=25  (radii_test (fun z ↦ (∑ j, w j*z j)*log (∑ j, w j*z j)) (by fun_prop)).symm2627private theorem derivative_slope (i j : D) :28    let w := fun _ : D ↦ 1/(Fintype.card D : ℝ)29    HasDerivAt (fun h ↦ slope (addCoordinate w j h) i)30      ((Fintype.card D : ℝ)*(1+(if i=j then 1 else 0))/(Fintype.card D+1 : ℝ)) 0 := by31  dsimp only32  let c := 1/(Fintype.card D : ℝ)33  have : Nonempty D := ⟨i⟩34  have hc : 0<c := by dsimp [c]; positivity35  let w := fun _ : D ↦ c36  let T := energy w37  let F := fun h (z : D → ℝ) ↦ z i*(log (T z+h*z j)+1)38  let G := fun h (z : D → ℝ) ↦ z i*z j/(T z+h*z j)39  let b := fun z : D → ℝ ↦ z i*(2/c)40  let s := Ioo (-(c/2)) (c/2)41  have hs : s ∈ 𝓝 (0:ℝ) := Ioo_mem_nhds (by linarith) (by positivity)42  have hb : Integrable b (expLaw D) := (unit_coord_integrable i).mul_const _43  have hT (z : D → ℝ) : T z = c * ∑ k, z k := by simp [T,energy,w,Finset.mul_sum]44  have hlow {z : D → ℝ} (hz : ∀ k, 0<z k) {h : ℝ} (hh : h ∈ s) :45      0 < T z+h*z j ∧ c/2*z j ≤ T z+h*z j := by46    have hj : c*z j ≤ T z :=47      Finset.single_le_sum (fun k _ ↦ (mul_pos hc (hz k)).le) (Finset.mem_univ j)48    have hl := mul_lt_mul_of_pos_right hh.1 (hz j)49    constructor <;> nlinarith [mul_pos hc (hz j)]50  have hi : Integrable (F 0) (expLaw D) := by51    simpa [F,T,energy,mul_add,Pi.add_def] using52      ((exponential_log_integrable w (fun _ ↦ hc) i).2.add (unit_coord_integrable i))53  have hi' := hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ:=expLaw D)54    (F:=F) (F':=G) (bound:=b) hs55    (.of_forall fun _ ↦ by apply Measurable.aestronglyMeasurable; dsimp [F,T,energy]; fun_prop) hi56    (by apply Measurable.aestronglyMeasurable; dsimp [G,T,energy]; fun_prop)57    (exp_coord_pos.mono (fun z hz h hh ↦ by58      obtain ⟨hp,hl⟩ := hlow hz hh59      change ‖z i*z j/(T z+h*z j)‖ ≤ z i*(2/c)60      rw [Real.norm_of_nonneg (div_nonneg (mul_pos (hz i) (hz j)).le hp.le),div_le_iff₀ hp]61      have hh' : z j ≤ 2/c*(T z+h*z j) := by62        field_simp63        nlinarith64      nlinarith [mul_le_mul_of_nonneg_left hh' (hz i).le]))65    hb (exp_coord_pos.mono (fun z hz h hh ↦ by66      have hp := (hlow hz hh).167      have dd : HasDerivAt (fun t : ℝ ↦ T z+t*z j) (z j) h := by68        simpa using ((hasDerivAt_id h).mul_const (z j)).const_add (T z)69      convert ((dd.log hp.ne').add_const 1).const_mul (z i) using 170      dsimp [F,G]71      ring))72  have hval : (∫ z : D → ℝ, G 0 z ∂expLaw D) =73      (Fintype.card D : ℝ)*(1+(if i=j then 1 else 0))/(Fintype.card D+1 : ℝ) := by74    simpa only [G,zero_mul,mul_zero,add_zero,mul_one,one_mul,hT,c,one_div,div_eq_mul_inv,mul_comm] using75      uniform_exponential_hessian_moment i j76  rw [hval] at hi'77  simpa only [slope,shift_energy,F,T,w,c] using hi'.27879/-- The actual iterated coordinate derivative ∂j∂i F, including the diagonal entries. -/80theorem spectralGaussianF_uniform_hessian (i j : D) :81    let w := fun _ : D ↦ 1/(Fintype.card D : ℝ)82    deriv (fun h ↦ deriv (fun t ↦ spectralGaussianF (addCoordinate (addCoordinate w j h) i t)) 0) 0 =83      (Fintype.card D : ℝ)*(1+(if i=j then 1 else 0))/(Fintype.card D+1 : ℝ) := by84  let w := fun _ : D ↦ 1/(Fintype.card D : ℝ)85  have : Nonempty D := ⟨i⟩86  have hp : ∀ᶠ h : ℝ in 𝓝 0, ∀ k, 0 < addCoordinate w j h k := by87    apply eventually_all.mpr88    intro k89    by_cases hh : k=j90    · have hc : 0 < w k+0 := by dsimp [w]; positivity91      simpa [addCoordinate,hh,w] using (continuous_const.add continuous_id).continuousAt.eventually_const_lt hc92    · exact .of_forall (fun _ ↦ by simp [addCoordinate,hh,w]; positivity)93  apply HasDerivAt.deriv94  apply (derivative_slope i j).congr_of_eventuallyEq95  filter_upwards [hp] with h hh96  exact (gaussian_coordinate_derivative _ hh i).deriv9798end SubentropyCertificates.EndpointCurvature

Axioms used

Choose a statement to see which axioms its proof uses.