EndpointCurvature.lean
1module23public import SubentropyCertificates.EndpointCurvatureIntegral4public import SubentropyCertificates.CalibratedInverse5public import SubentropyCertificates.CurveInverse67/-! The quadratic loss from the uniform-error endpoint in Appendix F.1. -/8@[expose] public section9noncomputable section10open Set Filter Asymptotics11open scoped BigOperators Topology12namespace SubentropyCertificates.EndpointCurvature13open SubentropyCertificates.ClassicalCurve14open SubentropyCertificates.AncillaCalibration15open SubentropyCertificates.SpectralContinuity (maximallyMixed)1617private def direction (m : ℕ) : Option (Fin (m+1)) → ℝ18 | none => 119 | some _ => -(1/(m+1 : ℝ))2021private theorem direction_sum (m : ℕ) : ∑ i, direction m i = 0 := by22 simp [Fintype.sum_option,direction,nsmul_eq_mul]23 field_simp24 norm_num2526private theorem direction_energy (m : ℕ) : ∑ i, (direction m i)^2 = (m+2 : ℝ)/(m+1 : ℝ) := by27 simp [Fintype.sum_option,direction,nsmul_eq_mul]28 field_simp29 ring3031private theorem extremal_tangent (m : ℕ) (h : ℝ) (i : Option (Fin (m+1))) :32 extremalVector m (uniformError m-h) i = 1/(m+2 : ℝ)+h*direction m i := by33 cases i <;> simp [extremalVector,uniformError,direction] <;> field_simp <;> ring3435private theorem extremal_center (m : ℕ) (i : Option (Fin (m+1))) :36 extremalVector m (uniformError m) i = 1/(m+2 : ℝ) := by37 simpa using extremal_tangent m 0 i3839/-- For n=m+2 labels the ordinary endpoint coefficient is n²/(2(n²−1)). -/40theorem phi_endpoint_expansion (m : ℕ) :41 (fun h : ℝ ↦ phi m (uniformError m)-phi m (uniformError m-h)-42 ((m+2 : ℝ)^2/(2*((m+2 : ℝ)^2-1)))*h^2) =O[𝓝 0] (fun h ↦ h^3) := by43 have hnorm : ∑ _ : Option (Fin (m+1)), (1/(m+2 : ℝ)) = 1 := by44 simp [nsmul_eq_mul]; field_simp; ring45 have hh := uniform_tangent_expansion (direction m) (direction_sum m) _ (by positivity) hnorm46 rw [direction_energy] at hh47 have hc : (m+2 : ℝ)/(m+1 : ℝ)/2 /48 (1/(m+2 : ℝ)*(Fintype.card (Option (Fin (m+1)))+1 : ℕ)) =49 (m+2 : ℝ)^2/(2*((m+2 : ℝ)^2-1)) := by50 simp51 field_simp [show (m+2 : ℝ)^2-1 ≠ 0 by nlinarith [Nat.cast_nonneg (α:=ℝ) m]]52 ring53 rw [hc] at hh54 simpa only [phi,show extremalVector m (uniformError m) = _ from funext (extremal_center m),55 show ∀ h, extremalVector m (uniformError m-h) = _ from fun h ↦ funext (extremal_tangent m h)] using hh5657/-- For n=m+2 labels and a uniform ancilla of size k the endpoint coefficient58is n²/(2(n−1)(nk+1)). The expansion includes k=1. -/59theorem uniform_calibratedPhi_endpoint_expansion (C : Type*) [Fintype C] [DecidableEq C]60 [Nonempty C] (m : ℕ) :61 (fun h : ℝ ↦ calibratedPhi (maximallyMixed C) m (uniformError m)-62 calibratedPhi (maximallyMixed C) m (uniformError m-h)-63 ((m+2 : ℝ)^2 / (2*(m+1 : ℝ)*((m+2 : ℝ)*(Fintype.card C : ℝ)+1)))*h^2)64 =O[𝓝 0] (fun h ↦ h^3) := by65 let k : ℝ := Fintype.card C66 have hk : 0 < k := Nat.cast_pos.mpr Fintype.card_pos67 let D := C × Option (Fin (m+1))68 let c := 1/(m+2 : ℝ)*(1/k)69 let v := fun z : D ↦ direction m z.2*(1/k)70 have hd : (Fintype.card D : ℝ) = k*(m+2 : ℝ) := by simp [D,k]; ring71 have hv : ∑ z, v z = 0 := by72 dsimp only [D,v]73 rw [Fintype.sum_prod_type]74 simp only [← Finset.sum_mul,direction_sum,zero_mul,Finset.sum_const_zero]75 have hsq : ∑ z, (v z)^2 = (m+2 : ℝ)/(m+1 : ℝ)/k := by76 dsimp only [D,v]77 rw [Fintype.sum_prod_type]78 simp only [mul_pow,← Finset.sum_mul,direction_energy,Finset.sum_const,Finset.card_univ,nsmul_eq_mul]79 change k * _ * _ = _80 field_simp81 have hnorm : ∑ _ : D, c = 1 := by82 simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,hd,c]83 field_simp84 have hh := uniform_tangent_expansion v hv c (by dsimp [c]; positivity) hnorm85 rw [hsq] at hh86 have hc : (m+2 : ℝ)/(m+1 : ℝ)/k/2/(c*(Fintype.card D+1 : ℕ)) =87 (m+2 : ℝ)^2 / (2*(m+1 : ℝ)*((m+2 : ℝ)*(Fintype.card C : ℝ)+1)) := by88 push_cast89 rw [hd]90 change _ = (m+2 : ℝ)^2/(2*(m+1 : ℝ)*((m+2 : ℝ)*k+1))91 dsimp [c]92 rw [mul_comm k (m+2 : ℝ)]93 field_simp94 rw [hc] at hh95 have hcenter : (fun z : D ↦ extremalVector m (uniformError m) z.2*(1/k)) = fun _ ↦ c :=96 funext fun z ↦ by rw [extremal_center]97 have ht (h : ℝ) : (fun z : D ↦ extremalVector m (uniformError m-h) z.2*(1/k)) =98 fun z ↦ c+h*v z := funext fun z ↦ by rw [extremal_tangent]; dsimp [c,v]; ring99 simp only [calibratedPhi,maximallyMixed_calibratedSubentropy_eq_classical,100 sub_sub_sub_cancel_right]101 convert hh using 1102 funext h103 rw [← hcenter,← ht h]104105end SubentropyCertificates.EndpointCurvature
Axioms used
Choose a statement to see which axioms its proof uses.