Pratik Patil

AncillaKernelLimit.lean

1module23public import SubentropyCertificates.AncillaReplicatedFactor4import Mathlib.Analysis.Calculus.LHopital5import Mathlib.Analysis.Calculus.DSlope67/-! Pointwise large-ancilla expansion of the reciprocal determinant at a fixed spectrum. -/8@[expose] public section9noncomputable section10open Filter Set11open scoped BigOperators Topology1213namespace SubentropyCertificates.AncillaLimit1415private theorem scaled_log_correction (b : ℝ) (hb : 0 ≤ b) :16    Tendsto (fun x : ℝ ↦ (b*x - Real.log (1+b*x))/x^2) (𝓝[>] 0) (𝓝 (b^2/2)) := by17  have hpos : ∀ᶠ x : ℝ in 𝓝[>] 0, 0 < x := self_mem_nhdsWithin18  apply HasDerivAt.lhopital_zero_nhdsGT (f' := fun x ↦ b - b / (1+b*x))19    (g' := fun x ↦ 2*x)20  · filter_upwards [hpos] with x hx21    have hd : HasDerivAt (fun y : ℝ ↦ b*y) b x := by simpa using (hasDerivAt_id x).const_mul b22    exact hd.sub ((hd.const_add 1).log (by positivity))23  · exact .of_forall fun x ↦ by simpa using hasDerivAt_pow 2 x24  · filter_upwards [hpos] with x hx using ne_of_gt (by positivity)25  · have h : ContinuousAt (fun x : ℝ ↦ b*x - Real.log (1+b*x)) 0 := by fun_prop (disch := norm_num)26    simpa using h.continuousWithinAt (s := Ioi 0) |>.tendsto27  · have h : ContinuousAt (fun x : ℝ ↦ x^2) 0 := by fun_prop28    simpa using (h.continuousWithinAt (s := Ioi 0)).tendsto29  · have h : ContinuousAt (fun x : ℝ ↦ b^2 / (2*(1+b*x))) 0 := by fun_prop (disch := norm_num)30    apply ((show Tendsto (fun x : ℝ ↦ b^2 / (2*(1+b*x))) (𝓝[>] 0) (𝓝 (b^2/2)) by31      simpa using h.continuousWithinAt (s := Ioi 0) |>.tendsto)).congr'32    filter_upwards [hpos] with x hx33    have hden : 0 < 1+b*x := by positivity34    field_simp35    ring3637/-- At fixed positive t, the first finite-ancilla correction is half the spectral purity38times the exponential density after division by t squared. -/39theorem replicatedFactor_centered_tendsto {I : Type*} [Fintype I] (w : I → ℝ)40    (hw : ∀ i, 0 ≤ w i) (hs : ∑ i, w i = 1) {t : ℝ} (ht : 0 < t) :41    Tendsto (fun k : ℕ ↦ ((k+1 : ℕ) : ℝ) * (replicatedFactor w k t - Real.exp (-t)) / t^2)42      atTop (𝓝 ((∑ i, w i ^ 2) / 2 * Real.exp (-t))) := by43  let N := fun k : ℕ ↦ ((k+1 : ℕ) : ℝ)44  let a := fun k ↦ 1 / N k45  let b := fun i ↦ t * w i46  let D := fun k ↦ t - N k * ∑ i, Real.log (1 + b i * a k)47  let P := (∑ i, b i ^ 2) / 248  have hN (k) : 0 < N k := by dsimp [N]; positivity49  have ha : Tendsto a atTop (𝓝 (0 : ℝ)) := by simpa [a,N] using50    (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ))51  have har : Tendsto a atTop (𝓝[>] 0) :=52    tendsto_nhdsWithin_iff.mpr ⟨ha, .of_forall fun k ↦ one_div_pos.mpr (hN k)⟩53  have hb (i) : 0 ≤ b i := mul_nonneg ht.le (hw i)54  have hbs : ∑ i, b i = t := by simp [b, ← Finset.mul_sum, hs]55  have hsum := tendsto_finsetSum Finset.univ (fun i _ ↦ (scaled_log_correction (b i) (hb i)).comp har)56  have hcorr : Tendsto (fun k ↦ N k * D k) atTop (𝓝 P) := by57    rw [← Finset.sum_div] at hsum58    apply hsum.congr'59    apply Eventually.of_forall60    intro k61    simp only [Function.comp_apply, ← Finset.sum_div, Finset.sum_sub_distrib, ← Finset.sum_mul, hbs]62    dsimp only [D,a]63    field_simp [(hN k).ne']64  have hd : Tendsto D atTop (𝓝 0) := by65    have H := hcorr.mul ha66    simp only [mul_zero] at H67    exact H.congr (fun k ↦ by dsimp [a]; field_simp [(hN k).ne'])68  have hsl : Tendsto (fun k ↦ dslope Real.exp 0 (D k)) atTop (𝓝 1) := by69    simpa [Function.comp_def] using ((continuousAt_dslope_same.mpr (Real.hasDerivAt_exp 0).differentiableAt).tendsto.comp hd)70  have hfac (k) : replicatedFactor w k t = Real.exp (-t) * Real.exp (D k) := by71    have H (i) : 0 < 1+b i*a k := by72      have := hb i73      have := one_div_pos.mpr (hN k)74      dsimp [a]; positivity75    rw [← Real.exp_add, show -t + D k = -(N k * ∑ i, Real.log (1+b i*a k)) by dsimp [D]; ring,76      Real.exp_neg, Real.exp_nat_mul, Real.exp_sum]77    have hexp (i) : Real.exp (Real.log (1+b i*a k)) = 1+b i*a k := Real.exp_log (H i)78    simp_rw [hexp]79    simp only [replicatedFactor, inv_pow, b, a, N, mul_one_div]80  have hscaled := ((hcorr.mul hsl).const_mul (Real.exp (-t))).div_const (t^2)81  have htarget : Real.exp (-t) * (P * 1) / t^2 = (∑ i, w i ^ 2)/2 * Real.exp (-t) := by82    simp only [P, b, mul_pow, ← Finset.mul_sum, mul_one]83    field_simp [ht.ne']84  rw [htarget] at hscaled85  apply hscaled.congr86  intro k87  have H := sub_smul_dslope Real.exp 0 (D k)88  simp only [sub_zero, smul_eq_mul, Real.exp_zero] at H89  rw [hfac]90  change Real.exp (-t) * (N k * D k * dslope Real.exp 0 (D k)) / t^2 = _91  rw [mul_assoc (N k), H]92  ring9394end SubentropyCertificates.AncillaLimit

Axioms used

Choose a statement to see which axioms its proof uses.