Pratik Patil

EndpointCurvatureMoments.lean

1module23public import SubentropyCertificates.ExponentialSignMoments4import all SubentropyCertificates.ExponentialSignMoments56/-! The normalized exponential second moments in the uniform Gaussian Hessian. -/7@[expose] public section8noncomputable section9open MeasureTheory ProbabilityTheory Real Set Filter10open scoped BigOperators Topology11namespace SubentropyCertificates.EndpointCurvature12open SubentropyCertificates.ConditionalContinuity SubentropyCertificates.Representations13local instance : IsProbabilityMeasure (expMeasure 1) := isProbabilityMeasure_expMeasure one_pos14variable {D : Type*} [Fintype D] [DecidableEq D]1516private theorem tilted_second (t : ℝ) (ht : 0 ≤ t) :17    (∫ x, x^2*exp (-(t*x)) ∂expMeasure 1) = 2*((1+t)⁻¹)^3 := by18  rw [unit_exponential_integral]19  have hv := integral_rpow_mul_exp_neg_mul_Ioi (by norm_num : (0:ℝ)<3)20    (by linarith : 0<1+t)21  norm_num [one_div] at hv22  calc23    _ = ∫ z in Ioi (0:ℝ), z^2*exp (-((1+t)*z)) := by24      apply setIntegral_congr_fun measurableSet_Ioi25      intro z _26      dsimp only27      rw [mul_left_comm,← exp_add]; ring_nf28    _ = _ := by simpa [inv_pow, mul_comm] using hv2930private theorem tilted_two_coords (i j : D) {t : ℝ} (ht : 0 ≤ t) :31    (∫ z : D → ℝ, z i*z j*exp (-(t*∑ x, z x)) ∂Measure.pi (fun _ ↦ expMeasure 1)) =32      (if i=j then 2 else 1)*((1+t)⁻¹^(Fintype.card D+2)) := by33  let b := (1+t)⁻¹34  let f (k : D) (x : ℝ) := (if k=i then x else 1)*(if k=j then x else 1)*exp (-(t*x))35  have hv (z : D → ℝ) : z i*z j*exp (-(t*∑ x, z x)) = ∏ k, f k (z k) := by36    simp only [f,Finset.prod_mul_distrib,← exp_sum]37    simp [Finset.mul_sum]38  have hm (k : D) : (∫ x, f k x ∂expMeasure 1) =39      (if k=i ∧ k=j then 2 else 1)*(if k=i then b else 1)*(if k=j then b else 1)*b := by40    by_cases hi : k=i <;> by_cases hj : k=j41    · subst i; subst j42      simpa [f,b,sq,pow_succ,mul_assoc] using tilted_second t ht43    · subst i44      simpa [f,hj,b] using exp_radial_first_moment t ht45    · subst j46      simpa [f,hi,b] using exp_radial_first_moment t ht47    · simpa [f,hi,hj,b] using exp_radial_factor t ht48  simp_rw [hv,integral_fintype_prod_eq_prod,hm]49  simp only [Finset.prod_mul_distrib]50  by_cases hij : i=j51  · subst j52    simp [pow_add,← show b = (1+t)⁻¹ from rfl]; ring53  · have hc (k : D) : ¬(k=i ∧ k=j) := fun h ↦ hij (h.1.symm.trans h.2)54    simp [hij,hc,pow_add,← show b = (1+t)⁻¹ from rfl]; ring5556private def mass (z : D → ℝ) := ∑ j, z j57private abbrev law (D : Type*) [Fintype D] := Measure.pi (fun _ : D ↦ expMeasure 1)58private def kernelMass (D : Type*) [Fintype D] := ∫ t in Ioi (0:ℝ), (1+t)⁻¹^(Fintype.card D+2)5960omit [DecidableEq D] in61private theorem coord_integrable (i : D) : Integrable (fun z : D → ℝ ↦ z i) (law D) :=62  integrable_comp_eval (μ := fun _ : D ↦ expMeasure 1) (f := fun x : ℝ ↦ x)63    (Integrable.of_integral_ne_zero (exp_moments.1.trans_ne one_ne_zero))6465omit [DecidableEq D] in66private theorem moment_bound (i j : D) (z : D → ℝ) (hz : ∀ k, 0 ≤ z k) :67    0 ≤ z i*z j/mass z ∧ z i*z j/mass z ≤ z i := by68  have hs : 0 ≤ mass z := Finset.sum_nonneg (fun k _ ↦ hz k)69  have hj : z j ≤ mass z := Finset.single_le_sum (fun k _ ↦ hz k) (Finset.mem_univ j)70  refine ⟨div_nonneg (mul_nonneg (hz i) (hz j)) hs,?_⟩71  by_cases hh : mass z = 072  · simpa [hh] using hz i73  · exact (div_le_iff₀ (lt_of_le_of_ne hs (Ne.symm hh))).mpr74      (mul_le_mul_of_nonneg_left hj (hz i))7576omit [DecidableEq D] in77private theorem moment_integrable (i j : D) :78    Integrable (fun z : D → ℝ ↦ z i*z j/mass z) (law D) := by79  apply (coord_integrable i).mono' (by apply Measurable.aestronglyMeasurable; dsimp [mass]; fun_prop)80  filter_upwards [pi_positive (D:=D)] with z hz81  rw [Real.norm_of_nonneg (moment_bound i j z hz).1]82  exact (moment_bound i j z hz).28384private theorem moment_laplace (i j : D) :85    (∫ z : D → ℝ, z i*z j/mass z ∂law D) = (if i=j then 2 else 1)*kernelMass D := by86  let ν : Measure ℝ := volume.restrict (Ioi 0)87  let F (z : D → ℝ) (t : ℝ) := z i*z j*exp (-(t*mass z))88  have hs (z : D → ℝ) (hz : ∀ k, 0 < z k) : 0 < mass z :=89    (hz i).trans_le (Finset.single_le_sum (fun k _ ↦ (hz k).le) (Finset.mem_univ i))90  have slice (z : D → ℝ) (hz : ∀ k, 0 < z k) :91      Integrable (F z) ν ∧ (∫ t, F z t ∂ν) = z i*z j/mass z := by92    have hp := hs z hz93    refine ⟨by simpa [F,mul_comm] using (exp_neg_integrableOn_Ioi 0 hp).const_mul (z i*z j),?_⟩94    change (∫ t in Ioi (0:ℝ), z i*z j*exp (-(t*mass z))) = _95    simp_rw [show ∀ t : ℝ, -(t*mass z) = (-mass z)*t by intro t; ring]96    rw [integral_const_mul,integral_exp_mul_Ioi (neg_lt_zero.mpr hp)]97    simp [div_eq_mul_inv]98  have hi : Integrable (Function.uncurry F) ((law D).prod ν) := by99    apply (integrable_prod_iff (by dsimp [F,mass,Function.uncurry]; fun_prop)).mpr100    refine ⟨exp_coord_pos.mono fun z hz ↦ (slice z hz).1,?_⟩101    apply (coord_integrable i).mono'102    · exact (show AEStronglyMeasurable (fun p : (D → ℝ) × ℝ ↦ ‖F p.1 p.2‖) ((law D).prod ν) by103        dsimp [F,mass]; fun_prop).integral_prod_right'104    · filter_upwards [exp_coord_pos (D:=D)] with z hz105      have hn (t : ℝ) : ‖F z t‖ = F z t :=106        Real.norm_of_nonneg (mul_nonneg (mul_nonneg (hz i).le (hz j).le) (exp_pos _).le)107      have hb := moment_bound i j z (fun k ↦ (hz k).le)108      change ‖∫ t, ‖F z t‖ ∂ν‖ ≤ z i109      simpa only [hn,(slice z hz).2,Real.norm_of_nonneg hb.1] using hb.2110  calc111    _ = ∫ z, ∫ t, F z t ∂ν ∂law D := integral_congr_ae (exp_coord_pos.mono fun z hz ↦ (slice z hz).2.symm)112    _ = ∫ t, ∫ z, F z t ∂law D ∂ν := integral_integral_swap hi113    _ = ∫ t in Ioi (0:ℝ), (if i=j then 2 else 1)*((1+t)⁻¹^(Fintype.card D+2)) :=114      setIntegral_congr_fun measurableSet_Ioi fun t ht ↦ tilted_two_coords i j ht.le115    _ = _ := integral_const_mul _ _116117/-- For unit exponential coordinates, E[Zi Zj / (Σ Z / d)] is the stated uniform Hessian entry. -/118theorem uniform_exponential_hessian_moment (i j : D) :119    (∫ z : D → ℝ, z i*z j/((∑ k, z k)/(Fintype.card D : ℝ)) ∂Measure.pi (fun _ ↦ expMeasure 1)) =120      (Fintype.card D : ℝ)*(1+(if i=j then 1 else 0))/(Fintype.card D+1 : ℝ) := by121  have hi : (∫ z : D → ℝ, z i ∂law D) = 1 := by122    have eq := integral_map (μ:=law D) (φ:=fun z : D → ℝ ↦ z i) (f:=fun x : ℝ ↦ x)123      (measurable_pi_apply i).aemeasurable measurable_id.aestronglyMeasurable124    rw [(measurePreserving_eval (fun _ : D ↦ expMeasure 1) i).map_eq] at eq125    exact eq.symm.trans exp_moments.1126  have hsum : (∑ k, ∫ z : D → ℝ, z i*z k/mass z ∂law D) = 1 := by127    rw [← integral_finsetSum _ (fun k _ ↦ moment_integrable i k),← hi]128    apply integral_congr_ae129    filter_upwards [exp_coord_pos (D:=D)] with z hz130    have hs : 0 < mass z := (hz i).trans_le (Finset.single_le_sum (fun k _ ↦ (hz k).le) (Finset.mem_univ i))131    rw [← Finset.sum_div,← Finset.mul_sum]132    change z i*mass z/mass z = _133    field_simp134  simp_rw [moment_laplace] at hsum135  have hcount (k : D) : (if i=k then (2:ℝ) else 1) = 1+(if k=i then 1 else 0) := by136    by_cases hh : i=k <;> simp [hh,eq_comm]137    norm_num138  simp_rw [hcount,add_mul,one_mul,ite_mul,one_mul,zero_mul] at hsum139  rw [Finset.sum_add_distrib] at hsum140  simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,Finset.sum_ite_eq',141    Finset.mem_univ,ite_true] at hsum142  have hv : kernelMass D = 1/(Fintype.card D+1 : ℝ) :=143    (eq_div_iff (by positivity)).mpr (by linarith)144  simp_rw [show ∀ z : D → ℝ, z i*z j/((∑ k, z k)/(Fintype.card D : ℝ)) =145      (Fintype.card D : ℝ)*(z i*z j/mass z) by intro z; dsimp [mass]; rw [div_div_eq_mul_div]; ring]146  rw [integral_const_mul,moment_laplace,hv]147  by_cases hh : i=j <;> simp [hh] <;> ring148149end SubentropyCertificates.EndpointCurvature

Axioms used

Choose a statement to see which axioms its proof uses.