theoremcoverC1BoundaryAt_physical_patch {A : SetCover} (hA : MeasurableSetA)
{p : Cover} (hp : p ∈ coverEssentialBoundary A) (hC : CoverC1BoundaryAtA p) :
∃ (a n : Cover) (g : Plane→ℝ) (R : ℝ) (U : SetCover),
‖n‖ = 1∧LipschitzWith (1/4) g ∧0 < R∧
(∀ y ∈Metric.closedBall (0 : Plane) R, ContDiffAtℝ1 g y) ∧IsOpenU∧ p ∈U∧U⊆Metric.ball a R∧
(∀ x ∈U, x ∈ coverEssentialBoundary A↔
normalGraph n g (normalPlaneCoordinates n (x-a))=x-a) ∧
((∀ᵐ x : Cover ∂volume, x ∈U→ (x ∈A↔ graphSignedHeight a n g x < 0)) ∨
(∀ᵐ x : Cover ∂volume, x ∈U→ (x ∈A↔0 < graphSignedHeight a n g x))) :=by
proof · 49
lines
obtain ⟨n,b,s,G,hn,hs,hb,hG,hGc,_,hcover⟩ := hC
let a := p+s • b
let g := dilatedGraph s GletR:=3*s/(544*8192)
let r := s/(544*16384)
havehR : 0 < R:=by dsimp only [R]; positivity
havehr : 0 < r :=by dsimp only [r]; positivity
have hg := dilatedGraph_lipschitz hG hs
have hc (y : Plane) (hy : y ∈Metric.closedBall (0 : Plane) R) : ContDiffAtℝ1 g y :=by
apply dilatedGraph_contDiffAt
apply hGc.contDiffAt
apply Metric.isOpen_ball.mem_nhds
simp only [Metric.mem_ball,dist_zero_right,norm_smul,Real.norm_of_nonneg (inv_pos.mpr hs).le]
apply (inv_mul_lt_iff₀ hs).mpr
havehh : ‖y‖ ≤R:=by simpa using hy
dsimp only [R] at hh
nlinarith
havehba : Metric.ball p r ⊆Metric.ball a R:=by
intro x hx
have hd := dist_triangle x p a
havehpa : dist p a = s*‖b‖ :=by simp only [a,dist_eq_norm,sub_add_eq_sub_sub,sub_self,zero_sub,norm_neg,norm_smul,Real.norm_of_nonneg hs.le]
rw [hpa] at hd
havehx' : dist x p < r := hx
change dist x a < R
dsimp only [R,r] at hx' ⊢
nlinarith [mul_le_mul_of_nonneg_left hb hs.le]
have hbd (x : Cover) (hx : x ∈Metric.ball p r) :
x ∈ coverEssentialBoundary A↔ normalGraph n g (normalPlaneCoordinates n (x-a))=x-a :=bylet z := s⁻¹ • (x-p)
havehz : z ∈Metric.ball (0 : Cover) (1/(544*8192)) :=by
simp only [Metric.mem_ball,dist_zero_right,z,norm_smul,Real.norm_of_nonneg (inv_pos.mpr hs).le]
apply (inv_mul_lt_iff₀ hs).mpr
havehh : ‖x-p‖ < r :=by simpa only [Metric.mem_ball,dist_eq_norm] using hx
dsimp only [r] at hh
nlinarith
havehxz : p+s • z=x :=by simp only [z,smul_smul,mul_inv_cancel₀ hs.ne',one_smul,add_sub_cancel]
havehxa : x-a=s • (z-b) :=by
simp only [a,z,smul_sub,smul_smul,mul_inv_cancel₀ hs.ne',one_smul]
abel
havehe : normalGraph n g (normalPlaneCoordinates n (x-a)) =
s • normalGraph n G (normalPlaneCoordinates n (z-b)) :=by
rw [normalGraph_dilated n G hs.ne',hxa,map_smul,smul_smul,inv_mul_cancel₀ hs.ne',one_smul]
rw [he,hxa,smul_right_inj hs.ne']
simpa only [hxz] using hcover z hz
obtain ⟨W,hW,hpW,hWU,hphase⟩ := cover_graph_boundary_phases hA a hn hg.continuous
(Metric.isOpen_ball.mem_nhds (by simpa using hr)) hp (fun x hx hb ↦ (hbd x hx).mp hb)
refine ⟨a,n,g,R,W,hn,hg,hR,hc,hW,hpW,hWU.trans hba,fun x hx ↦ hbd x (hWU hx),?_⟩
exact hphase.symm
lemmagraph_superlevel_compl_ae {AU : SetCover} (a : Cover) {n : Cover} (hn : ‖n‖=1)
{g : Plane→ℝ} (hg : Continuous g)
(hgraph : ∀ᵐ x : Cover ∂volume, x ∈U→ (x ∈A↔ graphHeightExtension a n g x < ⟪n,x-a⟫)) :
∀ᵐ x : Cover ∂volume, x ∈U→ (x ∈Aᶜ ↔ ⟪n,x-a⟫ < graphHeightExtension a n g x) :=by
proof · 6
lines
havehnz : ∀ᵐ x : Cover ∂volume, ⟪n,x-a⟫ ≠ graphHeightExtension a n g x :=by
rw [ae_iff]
simpa only [not_not] using graph_trace_volume_zero a hn hg
filter_upwards [hgraph,hnz] with x hx hne hU
rw [mem_compl_iff,hx hU,not_lt]
exact ⟨fun h ↦ lt_of_le_of_ne h hne,le_of_lt⟩
lemmagraph_vertical_variation (a : Cover) {n : Cover} (hn : ‖n‖=1)
(g : Plane→ℝ) {ψ : Plane→ℝ} (hψ : Differentiableℝ ψ) (y : Plane) :
tangentialDivergence (fun x ↦ graphHeightExtension a n ψ x • n)
(a+normalGraph n g y) (graphSlopeNormal n (gradient g y)) * ‖graphAreaVector n g y‖ =
fderiv ℝ ψ y (gradient g y) / ‖graphAreaVector n g y‖ :=by
proof · 12
lines
havehd : DifferentiableAtℝ (graphHeightExtension a n ψ) (a+normalGraph n g y) :=
((hψ _).comp _ ((normalPlaneCoordinates n).differentiableAt.comp _
(differentiableAt_id.sub_const a)))
havehnz : ‖graphAreaVector n g y‖ ≠0:=byhave hh := graphSlopeVector_norm_ge hn (gradient g y)
exact ne_of_gt (by change 0 < ‖n-normalPlaneEmbedding n (gradient g y)‖; linarith)
rw [tangentialDivergence_smul_const hd,graphHeightExtension_fderiv a n hψ,
ContinuousLinearMap.comp_apply,normalPlaneCoordinates_tangent_graph hn,
add_sub_cancel_left,normalPlaneCoordinates_graph hn,map_smul]
change (‖graphAreaVector n g y‖⁻¹)^2 * fderiv ℝ ψ y (gradient g y) *
‖graphAreaVector n g y‖ = _
field_simp
theoremstationary_graph_weak_equation (a : Cover) {n : Cover} (hn : ‖n‖=1)
(g : Plane→ℝ) {p : Cover} {ρ : ℝ} (hρ : 0<ρ)
(hstat : ∀F : Cover→Cover, ContDiffℝ (⊤ : ℕ∞) F→
tsupport F⊆Metric.closedBall p ρ →
(∫y : Plane, tangentialDivergence F (a+normalGraph n g y)
(graphSlopeNormal n (gradient g y))*‖graphAreaVector n g y‖)=0)
{ψ : Plane→ℝ} (hψ : ContDiffℝ (⊤ : ℕ∞) ψ)
(hsψ : ∀ y ∈ tsupport ψ, a+normalGraph n g y ∈Metric.ball p (ρ/2)) :
(∫y : Plane, fderiv ℝ ψ y (gradient g y)/‖graphAreaVector n g y‖)=0:=by
proof · 50
lines
let ζ := radialHeightCutoff p (ρ/2)
let f := graphHeightExtension a n ψ
letF : Cover→Cover:=fun x ↦ (ζ x*f x) • n
havehζ : ContDiffℝ (⊤ : ℕ∞) ζ := radialDensityWeight_contDiff _ _ _
havehf : ContDiffℝ (⊤ : ℕ∞) f := graphHeightExtension_contDiff a n hψ
havehF : ContDiffℝ (⊤ : ℕ∞) F:= (hζ.mul hf).smul contDiff_const
havehsF : tsupport F⊆Metric.closedBall p ρ :=byhavehsζ : tsupport ζ ⊆Metric.closedBall p ρ :=byhave hh := radialDensityWeight_tsupport (a := p) (r :=2*(ρ/2))
(ε :=3*(ρ/2)^2) (by positivity) (by positivity)
convert hh using1 <;> congr 1; ring
apply Subset.trans _ hsζ
apply closure_mono
intro x hx
by_contra hh
exact hx (by simp [F,Function.notMem_support.mp hh])
have he (y : Plane) : tangentialDivergence F (a+normalGraph n g y)
(graphSlopeNormal n (gradient g y))*‖graphAreaVector n g y‖ =
fderiv ℝ ψ y (gradient g y)/‖graphAreaVector n g y‖ :=bylet x := a+normalGraph n g y
havehxy : normalPlaneCoordinates n (x-a)=y :=by
simp only [x,add_sub_cancel_left,normalPlaneCoordinates_graph hn]
by_cases hy : y ∈ tsupport ψ
· havehz : ζ =ᶠ[𝓝 x] (fun _ ↦ (1 : ℝ)) :=
radialHeightCutoff_eventually_one (by positivity) (hsψ y hy)
havehFe : F =ᶠ[𝓝 x] (fun z ↦ f z • n) :=by
filter_upwards [hz] with z hz
simp only [F,hz,one_mul]
have hde := hFe.fderiv_eq (𝕜:=ℝ)
havehte : tangentialDivergence F x (graphSlopeNormal n (gradient g y)) =
tangentialDivergence (fun z ↦ f z • n) x (graphSlopeNormal n (gradient g y)) :=by
simp only [tangentialDivergence,divergence,hde]
change tangentialDivergence F x _ * _ = _
rw [hte]
exact graph_vertical_variation a hn g (hψ.differentiable (by simp)) y
· havehψ0 : ψ =ᶠ[𝓝 y] (fun _ ↦ (0 : ℝ)) := notMem_tsupport_iff_eventuallyEq.mp hy
havehf0 : f =ᶠ[𝓝 x] (fun _ ↦ (0 : ℝ)) :=byhave hp := ((normalPlaneCoordinates n).continuous.comp (continuous_id.sub (continuous_const (y := a)))).tendsto x
change Tendsto (funz : Cover↦ normalPlaneCoordinates n (z-a)) (𝓝 x)
(𝓝 (normalPlaneCoordinates n (x-a))) at hp
rw [hxy] at hp
exact hp.eventually hψ0havehF0 : F =ᶠ[𝓝 x] (fun _ ↦ (0 : Cover)) :=by
filter_upwards [hf0] with z hz
simp only [F,hz,mul_zero,zero_smul]
have hd0 := hF0.fderiv_eq (𝕜:=ℝ)
have hψd0 := hψ0.fderiv_eq (𝕜:=ℝ)
change tangentialDivergence F x _ * _ = _
simp [tangentialDivergence,divergence,hd0,hψd0]
simpa only [he] using hstat F hF hsF
lemmacover_cone_boundary_smul {A : SetCover}
(hcone : ∀t : ℝ, 1≤ t →∀ᵐ x ∂(volume : MeasureCover), x ∈Metric.ball (0 : Cover) 1→
(t⁻¹ • x ∈A↔ x ∈A))
{x : Cover} (hx : x ∈ coverEssentialBoundary A) (hxb : ‖x‖<1)
{s : ℝ} (hs : 0<s) (hs1 : s≤1) : s • x ∈ coverEssentialBoundary A:=by
proof · 9
lines
havehinv : 1≤ s⁻¹:= (one_le_inv₀ hs).mpr hs1
havehe : ∀ᵐ y : Cover ∂volume, y ∈Metric.ball (0 : Cover) 1→
(y ∈A↔ y ∈ (funz : Cover↦ s • z) ⁻¹' A) :=by
filter_upwards [hcone s⁻¹ hinv] with y hy hb
simpa only [inv_inv,mem_preimage] using (hy hb).symm
have hpre := cover_boundary_local_ae
(Metric.isOpen_ball.mem_nhds (show x ∈Metric.ball (0 : Cover) 1by simpa using hxb)) he hx
exact cover_boundary_preimage_image (Measure.quasiMeasurePreserving_smul volume hs.ne')
(showContinuousAt (funz : Cover↦ s • z) x from (Continuous.const_smul continuous_id s).continuousAt) hpre
theoremcone_graph_radial_derivative {A : SetCover}
(hcone : ∀t : ℝ, 1≤ t →∀ᵐ x ∂(volume : MeasureCover), x ∈Metric.ball (0 : Cover) 1→
(t⁻¹ • x ∈A↔ x ∈A))
{x a n : Cover} (hn : ‖n‖=1) (hx : x ∈ coverEssentialBoundary A) (hxb : ‖x‖<1)
{g : Plane→ℝ}
(hg : DifferentiableAtℝ g (normalPlaneCoordinates n (x-a)))
(hgraph : ∀ᶠ z in 𝓝 x, z ∈ coverEssentialBoundary A→
normalGraph n g (normalPlaneCoordinates n (z-a))=z-a) :
fderiv ℝ g (normalPlaneCoordinates n (x-a)) (normalPlaneCoordinates n x)=⟪n,x⟫ :=by
proof · 27
lines
havehtx : Tendsto (funt : ℝ↦ t • x) (𝓝 (1 : ℝ)) (𝓝 x) :=byhavehh : Continuous (funt : ℝ↦ t • x) := continuous_id.smul continuous_const
simpa only [one_smul] using hh.tendsto (1 : ℝ)
havehe : (funt : ℝ↦ g (normalPlaneCoordinates n (t • x-a))) =ᶠ[𝓝[≤] (1 : ℝ)]
(fun t ↦ ⟪n,t • x-a⟫) :=by
filter_upwards [htx.eventually hgraph |> mem_nhdsWithin_of_mem_nhds,
mem_nhdsWithin_of_mem_nhds (Ioi_mem_nhds (bynorm_num : (0 : ℝ)<1)), self_mem_nhdsWithin] with t ht ht0 ht1
have hb := ht (cover_cone_boundary_smul hcone hx hxb ht0 ht1)
have hh := congrArg (funv : Cover↦ ⟪n,v⟫) hb
simpa only [normalGraph_inner hn] using hh
havehlin : HasDerivAt (funt : ℝ↦ t • x-a) x 1:=by
simpa using (((hasDerivAt_id (1 : ℝ)).smul_const x).sub_const a)
havehdlin : HasDerivAt (funt : ℝ↦ normalPlaneCoordinates n (t • x-a))
(normalPlaneCoordinates n x) 1:=
(normalPlaneCoordinates n).hasFDerivAt.comp_hasDerivAt 1 hlin
havehg' : DifferentiableAtℝ g (normalPlaneCoordinates n ((1 : ℝ) • x-a)) :=by
simpa only [one_smul] using hg
havehdg' : HasDerivAt (funt : ℝ↦ g (normalPlaneCoordinates n (t • x-a)))
(fderiv ℝ g (normalPlaneCoordinates n (x-a)) (normalPlaneCoordinates n x)) 1:=by
simpa only [Function.comp_def,one_smul] using hg'.hasFDerivAt.comp_hasDerivAt 1 hdlin
havehdi : HasDerivAt (funt : ℝ↦ ⟪n,t • x-a⟫) ⟪n,x⟫ 1:=
(innerSL ℝ n).hasFDerivAt.comp_hasDerivAt 1 hlin
havehval : g (normalPlaneCoordinates n ((1 : ℝ) • x-a)) = ⟪n,(1 : ℝ) • x-a⟫ :=
he.self_of_nhdsWithin (bysimp : (1 : ℝ) ∈Iic (1 : ℝ))
exact (hdg'.hasDerivWithinAt.derivWithin (uniqueDiffWithinAt_Iic 1)).symm.trans
((hdi.hasDerivWithinAt.congr_of_eventuallyEq he hval).derivWithin
(uniqueDiffWithinAt_Iic 1))
lemmacone_graph_radial_projection_ne_zero {x n : Cover} (hn : ‖n‖=1)
(hx : x≠0) {L : Plane→L[ℝ] ℝ} (he : L (normalPlaneCoordinates n x)=⟪n,x⟫) :
normalPlaneCoordinates n x ≠0:=by
proof · 8
lines
intro hz
havehi : ⟪n,x⟫=0:=by rw [hz,map_zero] at he; exact he.symm
have hh := normalPlaneCoordinates_reconstruct hn x
rw [hz,hi] at hh
haveh0 : normalPlaneEmbedding n 0=0:=by
apply norm_eq_zero.mp
simpa using normalPlaneEmbedding_norm n (0 : Plane)
exact hx (by simpa only [h0,zero_smul,add_zero] using hh.symm)
lemmacontinuous_angular_smoothing_tendsto {u : ℝ→ℝ} (hu : Continuous u) (x : ℝ) :
Tendsto (fun i ↦∫t : ℝ, u t*(angularMollifier i).normed volume (t-x)) atTop (𝓝 (u x)) :=by
proof · 13
lines
have ht :=ContDiffBump.convolution_tendsto_right_of_continuous
(μ := volume) angularMollifier_radius_tendsto hu x
convert ht using1
funext i
rw [convolution_eq_swap]
simp only [ContinuousLinearMap.lsmul_apply,smul_eq_mul]
apply integral_congr_ae
apply ae_of_all
intro t
change u t*(angularMollifier i).normed volume (t-x) =
(angularMollifier i).normed volume (x-t)*u t
rw [show x-t = -(t-x) by ring,(angularMollifier i).normed_neg]
ring
theoremcontinuous_constant_of_weak_derivative_zero {u : ℝ→ℝ} (hu : Continuous u)
{a b x y : ℝ} (hx : x ∈Ioo a b) (hy : y ∈Ioo a b)
(hweak : ∀ψ : ℝ→ℝ, ContDiffℝ (⊤ : ℕ∞) ψ → tsupport ψ ⊆Ioo a b →
(∫t : ℝ, u t*deriv ψ t)=0) : u x=u y :=by
proof · 24
lines
wlog hxy : x ≤ y generalizing x y
· exact (this hy hx (le_of_not_ge hxy)).symm
havehrad : ∀ᶠ i : ℕin atTop, (angularMollifier i).rOut < min (x-a) (b-y) :=
angularMollifier_radius_tendsto.eventually (gt_mem_nhds (by exact lt_min (by linarith [hx.1]) (by linarith [hy.2])))
havehe : (fun i ↦∫t : ℝ, u t*(angularMollifier i).normed volume (t-x)) =ᶠ[atTop]
(fun i ↦∫t : ℝ, u t*(angularMollifier i).normed volume (t-y)) :=by
filter_upwards [hrad] with i hi
let k := (angularMollifier i).normed volume
havehk : ContDiffℝ (⊤ : ℕ∞) k := (angularMollifier i).contDiff_normed
havehks : tsupport k ⊆Icc (-(angularMollifier i).rOut) (angularMollifier i).rOut :=by
rw [(angularMollifier i).tsupport_normed_eq,Real.closedBall_eq_Icc]
simp only [zero_sub,zero_add,subset_refl]
havehs : tsupport (intervalSmoothHat k x y) ⊆Ioo a b :=by
apply (intervalSmoothHat_support hk.continuous hks hxy).trans
intro t ht
constructor <;> linarith [lt_of_lt_of_le hi (min_le_left _ _),lt_of_lt_of_le hi (min_le_right _ _),ht.1,ht.2]
have hh := hweak (intervalSmoothHat k x y) (intervalSmoothHat_contDiff hk x y) hs
simp_rw [(intervalSmoothHat_hasDerivAt hk.continuous x y _).deriv,mul_sub] at hh
rw [integral_sub (continuous_mul_shift_integrable hu hk.continuous
(angularMollifier i).hasCompactSupport_normed x)
(continuous_mul_shift_integrable hu hk.continuous (angularMollifier i).hasCompactSupport_normed y)] at hh
exact sub_eq_zero.mp hh
exact tendsto_nhds_unique (continuous_angular_smoothing_tendsto hu x)
((continuous_angular_smoothing_tendsto hu y).congr' he.symm)
theoremhasDerivAt_of_continuousOn_weak_derivative {u v : ℝ→ℝ}
{a b : ℝ} (hu : ContinuousOn u (Ioo a b)) (hv : ContinuousOn v (Ioo a b))
(hweak : ∀ψ : ℝ→ℝ, ContDiffℝ (⊤ : ℕ∞) ψ → tsupport ψ ⊆Ioo a b →
(∫t : ℝ, u t*deriv ψ t) = -(∫t : ℝ, v t*ψ t))
{x : ℝ} (hx : x ∈Ioo a b) : HasDerivAt u (v x) x :=by
proof · 33
lines
let c := (a+x)/2let d := (x+b)/2havehcx : c<x :=by dsimp only [c]; linarith [hx.1]
havehxd : x<d :=by dsimp only [d]; linarith [hx.2]
havehsub : Icc c d ⊆Ioo a b :=by
intro t ht
constructor <;> dsimp only [c,d] at ht <;> linarith [ht.1,ht.2,hx.1,hx.2]
letU : C(Icc c d,ℝ) := ⟨fun t ↦ u t,continuousOn_iff_continuous_domRestrict.mp (hu.mono hsub)⟩
letW : C(Icc c d,ℝ) := ⟨fun t ↦ v t,continuousOn_iff_continuous_domRestrict.mp (hv.mono hsub)⟩
obtain ⟨U',hU'⟩ :=U.exists_extension' isClosed_Icc.isClosedEmbedding_subtypeVal
obtain ⟨W',hW'⟩ :=W.exists_extension' isClosed_Icc.isClosedEmbedding_subtypeVal
have heU (t : ℝ) (ht : t ∈Icc c d) : U' t=u t := congrFun hU' ⟨t,ht⟩
have heW (t : ℝ) (ht : t ∈Icc c d) : W' t=v t := congrFun hW' ⟨t,ht⟩
havehw : ∀ψ : ℝ→ℝ, ContDiffℝ (⊤ : ℕ∞) ψ → tsupport ψ ⊆Ioo c d →
(∫t : ℝ, U' t*deriv ψ t) = -(∫t : ℝ, W' t*ψ t) :=by
intro ψ hψ hsψ
havehe₁ : (fun t ↦U' t*deriv ψ t) = (fun t ↦ u t*deriv ψ t) :=by
funext t
by_cases ht : t ∈ tsupport ψ
· rw [heU t (Ioo_subset_Icc_self (hsψ ht))]
· rw [deriv_of_notMem_tsupport ht,mul_zero,mul_zero]
havehe₂ : (fun t ↦W' t*ψ t) = (fun t ↦ v t*ψ t) :=by
funext t
by_cases ht : t ∈ tsupport ψ
· rw [heW t (Ioo_subset_Icc_self (hsψ ht))]
· rw [image_eq_zero_of_notMem_tsupport ht,mul_zero,mul_zero]
rw [he₁,he₂]
exact hweak ψ hψ (hsψ.trans (Ioo_subset_Icc_self.trans hsub))
have hd := hasDerivAt_of_continuous_weak_derivative U'.continuous W'.continuous hw ⟨hcx,hxd⟩
rw [heW x ⟨hcx.le,hxd.le⟩] at hd
apply hd.congr_of_eventuallyEq
filter_upwards [isOpen_Ioo.mem_nhds (show x ∈Ioo c d from ⟨hcx,hxd⟩)] with t ht
exact (heU t (Ioo_subset_Icc_self ht)).symm
theoremcone_slope_ODE_derivative {f q c h : ℝ→ℝ} {a b : ℝ}
(hf : ∀ s ∈Ioo a b, HasDerivAt f (q s) s)
(hc : ContinuousOn c (Ioo a b))
(hpos : ∀ s ∈Ioo a b, 0<c s)
(hmetric : ∀ s ∈Ioo a b, (c s)^2*(1+(f s-s*q s)^2+(q s)^2)=1)
(hflux : ∀ s ∈Ioo a b, h s=(q s-s*(f s-s*q s))*c s)
(hh : ∀ s ∈Ioo a b, HasDerivAt h (-(f s-s*q s)*c s) s)
{x : ℝ} (hx : x ∈Ioo a b) : HasDerivAt q 0 x ∧HasDerivAt c 0 x :=by
proof · 48
lines
have hcx := hpos x hx
have hden (s : ℝ) : 0<1+s^2+(f s)^2:=by positivity
have hid (s : ℝ) (hs : s ∈Ioo a b) :
1+s^2-(h s)^2=(c s)^2*(1+s^2+(f s)^2) :=by
rw [hflux s hs]
linear_combination -(1+s^2)*(hmetric s hs)
havehhnum : 2*x+2*(h x)*(f x-x*q x)*c x = (c x)^2*(2*x+2*f x*q x) :=by
rw [hflux x hx]
linear_combination -(2*x)*(hmetric x hx)
havehdnum : HasDerivAt (fun s ↦1+s^2-(h s)^2)
(2*x+2*(h x)*(f x-x*q x)*c x) x :=by
convert (((hasDerivAt_id x).pow 2).const_add 1).sub ((hh x hx).pow 2) using1 <;> first | rfl | (simp only [id_eq]; ring)
havehdden : HasDerivAt (fun s ↦1+s^2+(f s)^2) (2*x+2*f x*q x) x :=by
convert (((hasDerivAt_id x).pow 2).const_add 1).add ((hf x hx).pow 2) using1 <;> first | rfl | (simp only [id_eq]; ring)
havehdsq : HasDerivAt (fun s ↦ (c s)^2) 0 x :=byhave hd := hdnum.div hdden (hden x).ne'
rw [hhnum,hid x hx] at hd
havehe : (fun s ↦ (c s)^2) =ᶠ[𝓝 x]
(fun s ↦ (1+s^2-(h s)^2)/(1+s^2+(f s)^2)) :=by
filter_upwards [isOpen_Ioo.mem_nhds hx] with s hs
rw [hid s hs,mul_div_cancel_right₀ _ (hden s).ne']
convert hd.congr_of_eventuallyEq he using1
all_goals first | rfl | (field_simp; ring)
havehdc : HasDerivAt c 0 x :=byhave hd := hdsq.sqrt (bypositivity : (c x)^2≠0)
havehe : c =ᶠ[𝓝 x] (fun s ↦Real.sqrt ((c s)^2)) :=by
filter_upwards [(hc.continuousAt (isOpen_Ioo.mem_nhds hx)).eventually
(Ioi_mem_nhds hcx)] with s hs
rw [Real.sqrt_sq hs.le]
simpa only [zero_div] using hd.congr_of_eventuallyEq he
have hqeq (s : ℝ) (hs : s ∈Ioo a b) :
q s=(h s+s*f s*c s)/((1+s^2)*c s) :=by
rw [hflux s hs]
field_simp [(hpos s hs).ne']
ring
havehn : HasDerivAt (fun s ↦ h s+s*f s*c s)
(2*x*q x*c x) x :=by
convert (hh x hx).add ((((hasDerivAt_id x).mul (hf x hx)).mul hdc)) using1 <;> first | rfl | (simp only [id_eq]; ring)
havehd : HasDerivAt (fun s ↦ (1+s^2)*c s) (2*x*c x) x :=by
convert ((((hasDerivAt_id x).pow 2).const_add 1).mul hdc) using1 <;> first | rfl | (simp only [id_eq]; ring)
havehneq : (1+x^2)*c x≠0:=by positivity
have hder := hn.div hd hneq
havehe : q =ᶠ[𝓝 x] (fun s ↦ (h s+s*f s*c s)/((1+s^2)*c s)) :=by
filter_upwards [isOpen_Ioo.mem_nhds hx] with s hs
exact hqeq s hs
refine ⟨?_,hdc⟩
convert hder.congr_of_eventuallyEq he using1
all_goals first | rfl | (rw [hflux x hx]; field_simp; ring)
theoremweak_cone_slope_derivative {f q : ℝ→ℝ} {a b : ℝ}
(hf : ∀ s ∈Ioo a b, HasDerivAt f (q s) s)
(hq : ContinuousOn q (Ioo a b))
(hweak : ∀ψ : ℝ→ℝ, ContDiffℝ (⊤ : ℕ∞) ψ → tsupport ψ ⊆Ioo a b →
(∫s : ℝ, coneSlopeFlux f q s*deriv ψ s) =
(∫s : ℝ, (f s-s*q s)*coneSlopeReciprocalArea f q s*ψ s))
{x : ℝ} (hx : x ∈Ioo a b) : HasDerivAt q 0 x :=by
proof · 15
lines
havehfc : ContinuousOn f (Ioo a b) :=fun s hs ↦ (hf s hs).continuousAt.continuousWithinAt
have hc := coneSlopeReciprocalArea_continuousOn hfc hq
have hu := hfc.sub (continuousOn_id.mul hq)
havehh : ContinuousOn (coneSlopeFlux f q) (Ioo a b) :=
(hq.sub (continuousOn_id.mul hu)).mul hc
have hhder (s : ℝ) (hs : s ∈Ioo a b) :
HasDerivAt (coneSlopeFlux f q) (-(f s-s*q s)*coneSlopeReciprocalArea f q s) s :=by
apply hasDerivAt_of_continuousOn_weak_derivative hh (hu.neg.mul hc) _ hs
intro ψ hψ hsψ
rw [hweak ψ hψ hsψ]
simp only [Pi.mul_apply,Pi.sub_apply,Pi.neg_apply,id_eq,neg_mul,integral_neg,neg_neg]
exact (cone_slope_ODE_derivative hf hc
(fun s _ ↦ coneSlopeReciprocalArea_pos f q s)
(fun s _ ↦ coneSlopeReciprocalArea_metric f q s)
(fun s _ ↦ rfl) hhder hx).1
theoremweak_cone_slope_affine {f q : ℝ→ℝ} {a b : ℝ}
(hf : ∀ s ∈Ioo a b, HasDerivAt f (q s) s)
(hq : ContinuousOn q (Ioo a b))
(hweak : ∀ψ : ℝ→ℝ, ContDiffℝ (⊤ : ℕ∞) ψ → tsupport ψ ⊆Ioo a b →
(∫s : ℝ, coneSlopeFlux f q s*deriv ψ s) =
(∫s : ℝ, (f s-s*q s)*coneSlopeReciprocalArea f q s*ψ s))
{x y : ℝ} (hx : x ∈Ioo a b) (hy : y ∈Ioo a b) :
q y=q x ∧ f y=f x+q x*(y-x) :=by
proof · 12
lines
have hqd (s : ℝ) (hs : s ∈Ioo a b) := weak_cone_slope_derivative hf hq hweak hs
have hqc (s : ℝ) (hs : s ∈Ioo a b) : q s=q x :=
isOpen_Ioo.is_const_of_deriv_eq_zero (convex_Ioo a b).isPreconnected
(fun s hs ↦ (hqd s hs).differentiableAt.differentiableWithinAt)
(fun s hs ↦ (hqd s hs).deriv) hs hx
have hfd (s : ℝ) (hs : s ∈Ioo a b) : HasDerivAt (fun t ↦ f t-q x*t) 0 s :=byhave hd := (hf s hs).sub ((hasDerivAt_id s).const_mul (q x))
convert hd using1 <;> first | rfl | simp only [hqc s hs,mul_one,sub_self]
have he := isOpen_Ioo.is_const_of_deriv_eq_zero (convex_Ioo a b).isPreconnected
(fun s hs ↦ (hfd s hs).differentiableAt.differentiableWithinAt)
(fun s hs ↦ (hfd s hs).deriv) hy hx
exact ⟨hqc y hy,by change f y-q x*y=f x-q x*x at he; linarith⟩
lemmaplane_gradient_coordinates (g : Plane→ℝ) (y : Plane) :
(planeProductCoordinates (gradient g y)).1 = fderiv ℝ g y slopeHorizontalVector ∧
(planeProductCoordinates (gradient g y)).2 = fderiv ℝ g y slopeVerticalVector :=by
lemmaplanarWedgeChart_hasDerivAt_radial (r s : ℝ) :
HasDerivAt (funt : ℝ↦ planarWedgeChart (t,s))
(planeProductCoordinates.symm (1,s)) r :=by
proof · 3
lines
have hd := (hasDerivAt_id r).prodMk ((hasDerivAt_id r).mul_const s)
convert planeProductCoordinates.symm.hasFDerivAt.comp_hasDerivAt r hd using1 <;>
first | rfl | simp only [one_mul,ContinuousLinearEquiv.coe_coe]
lemmaplanarWedgeChart_hasDerivAt_angular (r s : ℝ) :
HasDerivAt (funt : ℝ↦ planarWedgeChart (r,t)) (r • slopeVerticalVector) s :=by
proof · 3
lines
have hd := (hasDerivAt_const s r).prodMk ((hasDerivAt_id s).const_mul r)
have hh := planeProductCoordinates.symm.hasFDerivAt.comp_hasDerivAt s hd
simpa [Function.comp_def,planarWedgeChart,slopeVerticalVector,← map_smul] using hh
theoremeuler_graph_homogeneous {g : Plane→ℝ} {a b c d : ℝ} (ha : 0<a)
(hg : ∀ r ∈Ioo a b, ∀ s ∈Ioo c d, DifferentiableAtℝ g (planarWedgeChart (r,s)))
(he : ∀ r ∈Ioo a b, ∀ s ∈Ioo c d,
fderiv ℝ g (planarWedgeChart (r,s)) (planarWedgeChart (r,s))=g (planarWedgeChart (r,s)))
{r t s : ℝ} (hr : r ∈Ioo a b) (ht : t ∈Ioo a b) (hs : s ∈Ioo c d) :
g (planarWedgeChart (r,s))/r=g (planarWedgeChart (t,s))/t :=by
proof · 17
lines
have hd (v : ℝ) (hv : v ∈Ioo a b) :
HasDerivAt (funw : ℝ↦ g (planarWedgeChart (w,s))/w) 0 v :=byhavehv0 : 0<v := ha.trans hv.1have h := (hg v hv s hs).hasFDerivAt.comp_hasDerivAt v (planarWedgeChart_hasDerivAt_radial v s)
have hh := h.div (hasDerivAt_id v) hv0.ne'
havehmult : fderiv ℝ g (planarWedgeChart (v,s)) (planeProductCoordinates.symm (1,s))*v=
g (planarWedgeChart (v,s)) :=bycalc
_ = fderiv ℝ g (planarWedgeChart (v,s)) (v • planeProductCoordinates.symm (1,s)) :=by
rw [map_smul,smul_eq_mul,mul_comm]
_ = _ :=by
rw [← map_smul]
simpa [planarWedgeChart] using he v hv s hs
convert hh using1 <;> first | rfl | simp only [id_eq,Function.comp_def,hmult,mul_one,sub_self,zero_div]
exact isOpen_Ioo.is_const_of_deriv_eq_zero (convex_Ioo a b).isPreconnected
(fun v hv ↦ (hd v hv).differentiableAt.differentiableWithinAt)
(fun v hv ↦ (hd v hv).deriv) hr ht
lemmagraph_angular_slice_hasDerivAt {g : Plane→ℝ} {r s : ℝ} (hr : r≠0)
(hg : DifferentiableAtℝ g (planarWedgeChart (r,s))) :
HasDerivAt (funt : ℝ↦ g (planarWedgeChart (r,t))/r)
(fderiv ℝ g (planarWedgeChart (r,s)) slopeVerticalVector) s :=by
proof · 3
lines
have hd := (hg.hasFDerivAt.comp_hasDerivAt s
(planarWedgeChart_hasDerivAt_angular r s)).div_const r
simpa only [Function.comp_def,map_smul,smul_eq_mul,mul_div_cancel_left₀ _ hr] using hd
theoremeuler_graph_gradient {g : Plane→ℝ} {a b c d : ℝ} (ha : 0<a)
(hg : ∀ r ∈Ioo a b, ∀ s ∈Ioo c d, DifferentiableAtℝ g (planarWedgeChart (r,s)))
(he : ∀ r ∈Ioo a b, ∀ s ∈Ioo c d,
fderiv ℝ g (planarWedgeChart (r,s)) (planarWedgeChart (r,s))=g (planarWedgeChart (r,s)))
{r r₀ s : ℝ} (hr : r ∈Ioo a b) (hr₀ : r₀ ∈Ioo a b) (hs : s ∈Ioo c d) :
let f := g (planarWedgeChart (r₀,s))/r₀
proof · 32
lines
let q := fderiv ℝ g (planarWedgeChart (r₀,s)) slopeVerticalVector
planeProductCoordinates (gradient g (planarWedgeChart (r,s)))=(f-s*q,q) :=by
dsimp only
havehr0 : r≠0:= (ha.trans hr.1).ne'
havehr₀0 : r₀≠0:= (ha.trans hr₀.1).ne'
havehvs : fderiv ℝ g (planarWedgeChart (r,s)) slopeVerticalVector =
fderiv ℝ g (planarWedgeChart (r₀,s)) slopeVerticalVector :=byhavehfun : (funt : ℝ↦ g (planarWedgeChart (r,t))/r) =ᶠ[𝓝 s]
(funt : ℝ↦ g (planarWedgeChart (r₀,t))/r₀) :=by
filter_upwards [isOpen_Ioo.mem_nhds hs] with t ht
exact euler_graph_homogeneous ha hg he hr hr₀ ht
exact (graph_angular_slice_hasDerivAt hr0 (hg r hr s hs)).unique
((graph_angular_slice_hasDerivAt hr₀0 (hg r₀ hr₀ s hs)).congr_of_eventuallyEq hfun)
have hre := he r hr s hs
havehlin : fderiv ℝ g (planarWedgeChart (r,s)) (planarWedgeChart (r,s)) =
r*fderiv ℝ g (planarWedgeChart (r,s)) slopeHorizontalVector+
(r*s)*fderiv ℝ g (planarWedgeChart (r,s)) slopeVerticalVector :=bycalc
_ = fderiv ℝ g (planarWedgeChart (r,s))
(r • slopeHorizontalVector+(r*s) • slopeVerticalVector) :=
congrArg (fderiv ℝ g (planarWedgeChart (r,s))) (planarWedgeChart_expand r s)
_ = _ :=by simp only [map_add,map_smul,smul_eq_mul]
rw [hlin,hvs] at hre
have hhom := euler_graph_homogeneous ha hg he hr hr₀ hs
havehhom' : g (planarWedgeChart (r,s)) =
(g (planarWedgeChart (r₀,s))/r₀)*r := (div_eq_iff hr0).mp hhom
havehh : fderiv ℝ g (planarWedgeChart (r,s)) slopeHorizontalVector=
g (planarWedgeChart (r₀,s))/r₀-s*fderiv ℝ g (planarWedgeChart (r₀,s)) slopeVerticalVector :=by
apply (mul_right_inj' hr0).mp
nlinarith [hre,hhom']
have hcoord := plane_gradient_coordinates g (planarWedgeChart (r,s))
exact Prod.ext (hcoord.1.trans hh) (hcoord.2.trans hvs)