import OAI.Analysis.BernoulliCone.CapCalculus namespace OAI section noncomputable section open Set Filter open scoped Topology ContDiff Laplacian namespace Bernoulli.DeSilvaJerison lemma capH_abs (s:ℝ) : capH |s|=capH s := by rcases le_total 0 s with h|h · rw [abs_of_nonneg h] · rw [abs_of_nonpos h,capH_even] lemma capHP_sq_abs (s:ℝ) : (capHP |s|)^2=(capHP s)^2 := by rcases le_total 0 s with h|h · rw [abs_of_nonneg h] · rw [abs_of_nonpos h,capHP_odd,neg_sq] lemma capH_boundary {s:ℝ} (hs:|s|=3/4) : capH s=0 := by rw [←capH_abs,hs,capH_end] lemma capHP_sq_boundary {s:ℝ} (hs:|s|=3/4) : (capHP s)^2=(capHP (3/4))^2 := by rw [←capHP_sq_abs,hs] lemma capC_pos : 0.differentiableAt (by norm_num)) (CapAlgebra.hasDerivAt_invV hv.ne').differentiableAt (hasDerivAt_capH _).differentiableAt change gradient smoothCap x= _ at hg change gradient smoothCap x= (2*deriv (fun q=>CapAlgebra.Y q capB capC) q*capH (a*(CapAlgebra.V q capB)⁻¹)) • Cylindrical.transverse axis x+ (CapAlgebra.Y q capB capC*deriv capH (a*(CapAlgebra.V q capB)⁻¹)) • ((CapAlgebra.V q capB)⁻¹ • axis+(2*a*deriv (fun q=>(CapAlgebra.V q capB)⁻¹) q) • Cylindrical.transverse axis x) at hg rw [hg] simp only [CapAlgebra.deriv_Y hh,(CapAlgebra.hasDerivAt_invV hv.ne').deriv, (hasDerivAt_capH _).deriv,←div_eq_mul_inv] have he:2*a*(-CapAlgebra.D q capB/(2*CapAlgebra.V q capB^2)) = -a*CapAlgebra.D q capB/CapAlgebra.V q capB^2 := by ring rw [he] /-- Constant free-boundary slope of the actual cylindrical cap, including the transverse axis. The result is for the genuine Euclidean gradient. -/ theorem smoothCap_boundary_gradient {x:Space 7} (hx:Cylindrical.radiusSq axis x≤1) (hs:|Cylindrical.axis axis x/CapAlgebra.V (Cylindrical.radiusSq axis x) capB|=3/4) : ‖gradient smoothCap x‖^2=capC^2*(capHP (3/4))^2 := by let q:=Cylindrical.radiusSq axis x let a:=Cylindrical.axis axis x let V:=CapAlgebra.V q capB let H:=CapAlgebra.H q capB let s:=a/V have hq:0≤q:=Cylindrical.radiusSq_nonneg axis x axis_norm have hv:0