import Mathlib import OAI.Geometry.CubicTorus.Profiles.SiblingCmcSecant namespace OAI section section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem sibling_normalGraph_regraph_normal {n m : Cover} (hn : ‖n‖=1) (hm : ‖m‖=1) {g h : Plane → ℝ} (hg : ContDiff ℝ (⊤ : ℕ∞) g) (hh : ContDiff ℝ (⊤ : ℕ∞) h) (_hg0 : g 0=0) (hh0 : h 0=0) {I : Plane → Plane} (hIc : ContinuousAt I 0) (hI0 : I 0=0) (he : ∀ᶠ y in 𝓝 (0 : Plane),normalGraph m h y=normalGraph n g (I y)) {a : Cover} {N : Cover → Cover} (hN : Continuous N) (hNm : N a=m) {σ : ℝ} (hσ : σ=1 ∨ σ= -1) (hmatch : ∀ᶠ y in 𝓝 (0 : Plane),N (a+normalGraph n g y)=σ • graphSlopeNormal n (gradient g y)) : gradient h 0=0 ∧ ∀ᶠ y in 𝓝 (0 : Plane),N (a+normalGraph m h y)=graphSlopeNormal m (gradient h y) := by let G := normalGraph n g let K := normalGraph m h have hG := normalGraph_contDiff hg (n := n) have hK := normalGraph_contDiff hh (n := m) have hK0 : K 0=0 := by change (normalPlaneLinearIsometry m) 0+h 0 • m=0 rw [map_zero,hh0,zero_smul,add_zero] have hi : Tendsto I (𝓝 (0 : Plane)) (𝓝 (0 : Plane)) := by simpa only [hI0] using hIc.tendsto have he' : ∀ᶠ y in 𝓝 (0 : Plane),G (normalPlaneCoordinates n (K y))=K y := by filter_upwards [he] with y hy change normalGraph n g (normalPlaneCoordinates n (normalGraph m h y))=normalGraph m h y rw [hy,normalPlaneCoordinates_graph hn] have hmt : ∀ᶠ y in 𝓝 (0 : Plane),‖N (a+K y)‖=1 ∧ ∀ w : Plane,⟪N (a+K y),fderiv ℝ K y w⟫=0 := by filter_upwards [he,hi.eventually hmatch,he'.eventually_nhds] with y hy hmy hye have hNy : N (a+K y)=σ • graphSlopeNormal n (gradient g (I y)) := by change N (a+normalGraph m h y)=_; rw [hy]; exact hmy refine ⟨?_,?_⟩ · rw [hNy]; rcases hσ with rfl|rfl <;> simpa only [one_smul,neg_one_smul,norm_neg] using graphSlopeNormal_unit hn _ · intro w have hye' : (fun z ↦ G (normalPlaneCoordinates n (K z)))=ᶠ[𝓝 y] K := hye have hd := hye'.fderiv_eq (𝕜 := ℝ) have hdP := (normalPlaneCoordinates n).hasFDerivAt.comp y (hK.differentiable (by simp) y).hasFDerivAt have hdG := ((hG.differentiable (by simp) _).hasFDerivAt.comp y hdP).fderiv change fderiv ℝ (normalGraph n g ∘ normalPlaneCoordinates n ∘ normalGraph m h) y=fderiv ℝ K y at hd rw [hdG] at hd have hc : normalPlaneCoordinates n (K y)=I y := by change normalPlaneCoordinates n (normalGraph m h y)=_; rw [hy,normalPlaneCoordinates_graph hn] change (fderiv ℝ G (normalPlaneCoordinates n (K y))).comp ((normalPlaneCoordinates n).comp (fderiv ℝ K y)) = fderiv ℝ K y at hd rw [← hd,ContinuousLinearMap.comp_apply,hc,hNy,real_inner_smul_left] rw [normalGraph_tangent_normal hn hg,mul_zero] have htan0 := hmt.self_of_nhds.2 rw [hK0,add_zero,hNm] at htan0 have hgrad := normalGraph_gradient_zero_of_normal hm hh 0 htan0 have hnormal0 : graphSlopeNormal m (gradient h 0)=m := by rw [hgrad,graphSlopeNormal_weight hm] change (cmcWeight 0)⁻¹ • (m-(normalPlaneLinearIsometry m) 0)=m simp [cmcWeight] have hpos : ∀ᶠ y in 𝓝 (0 : Plane),0<⟪graphSlopeNormal m (gradient h y),N (a+K y)⟫ := by have hc : Continuous (fun y : Plane ↦ ⟪graphSlopeNormal m (gradient h y),N (a+K y)⟫) := (((graphSlopeNormal_contDiff hm).comp (plane_gradient_contDiff hh)).continuous.inner (hN.comp (continuous_const.add hK.continuous))) apply hc.continuousAt.eventually (lt_mem_nhds ?_) change 0 < ⟪graphSlopeNormal m (gradient h 0),N (a+K 0)⟫ rw [hK0,add_zero,hNm,hnormal0,real_inner_self_eq_norm_sq,hm,one_pow]; norm_num refine ⟨hgrad,?_⟩ filter_upwards [hmt,hpos] with y hy hpy exact graph_normal_tangent_positive hm hh y hy.1 hy.2 hpy end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isMinimizerAt_normalized_CMC_chart {V : ℝ} (hV : V∈Ioo 0 1) {E : Set Torus} (hE : MeasurableSet E) (hmin : IsMinimizerAt V E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {N : Cover → Cover} (hN : ContDiff ℝ (⊤ : ℕ∞) N) (hp : ∀ m x,N (x+latticeVector m)=N x) (hae : ∀ᵐ z ∂(μ : Measure NormalBundle),N z.1=(z.2 : Cover)) {H : ℝ} (hboundary : ∀ x : Cover,quotientMap x∈frontier (openRepresentative E) → (∀ᶠ y in 𝓝 x,‖N y‖=1) ∧ divergence N x=H) (a : Cover) (ha : quotientMap a∈frontier (openRepresentative E)) : ∃ f : Plane → ℝ,ContDiff ℝ (⊤ : ℕ∞) f ∧ f 0=0 ∧ gradient f 0=0 ∧ (∀ᶠ y in 𝓝 (0 : Plane), N (a+normalGraph (N a) f y)=graphSlopeNormal (N a) (gradient f y) ∧ quotientMap (a+normalGraph (N a) f y)∈frontier (openRepresentative E) ∧ planeCMC f y= -H) ∧ ∀ᶠ v in 𝓝 (0 : Cover),quotientMap (a+v)∈frontier (openRepresentative E) ↔ normalGraph (N a) f (normalPlaneCoordinates (N a) v)=v := by obtain ⟨n,g,σ,hn,hg,hg0,hσ,hmatch,hcover⟩ := isMinimizerAt_normal_graph_chart hV hE hmin hμ hN hp hae a ha have hm : ‖N a‖=1 := (hboundary a ha).1.self_of_nhds have hgG0 : normalGraph n g 0=0 := by change (normalPlaneLinearIsometry n) 0+g 0 • n=0 rw [map_zero,hg0,zero_smul,add_zero] have hNa : N a=σ • graphSlopeNormal n (gradient g 0) := by simpa only [hgG0,add_zero] using hmatch.self_of_nhds.1 have ht : ⟪graphSlopeNormal n (gradient g 0),N a⟫≠0 := by rw [hNa,real_inner_smul_right,real_inner_self_eq_norm_sq,graphSlopeNormal_unit hn, one_pow,mul_one] rcases hσ with rfl|rfl <;> norm_num obtain ⟨f,I,hf,hf0,hIc,hI0,heq,hcov⟩ := sibling_normalGraph_regraph hn hm hg hg0 ht have hnorm := sibling_normalGraph_regraph_normal hn hm hg hf hg0 hf0 hIc hI0 heq hN.continuous rfl hσ (hmatch.mono (fun _ hy ↦ hy.1)) have hi : Tendsto I (𝓝 (0 : Plane)) (𝓝 (0 : Plane)) := by simpa only [hI0] using hIc.tendsto have hmem : ∀ᶠ y in 𝓝 (0 : Plane), quotientMap (a+normalGraph (N a) f y)∈frontier (openRepresentative E) := by filter_upwards [heq,hi.eventually hmatch] with y hy hm rw [hy] exact hm.2 refine ⟨f,hf,hf0,hnorm.1,?_,?_⟩ · filter_upwards [hnorm.2,hmem,hnorm.2.eventually_nhds] with y hy hmy hny refine ⟨hy,hmy,?_⟩ have hny' : ∀ᶠ z in 𝓝 y,N (a+normalGraph (N a) f z)= (1 : ℝ) • graphSlopeNormal (N a) (gradient f z) := by simpa only [one_smul] using hny have hd := graph_normal_extension_divergence a hm hf y (Or.inl rfl) hN (hboundary _ hmy).1 hny' rw [(hboundary _ hmy).2] at hd change H= -(1 : ℝ)*planeCMC f y at hd linarith · filter_upwards [hcover,hcov] with v hv hc exact hv.trans hc.symm end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma normalGraph_injective {m : Cover} (hm : ‖m‖=1) (g : Plane → ℝ) : Function.Injective (normalGraph m g) := by intro x y he have hh := congrArg (normalPlaneCoordinates m) he simpa only [normalPlaneCoordinates_graph hm] using hh lemma normalGraph_height_eq {m : Cover} (hm : ‖m‖=1) {f g : Plane → ℝ} {y : Plane} (he : normalGraph m f y=normalGraph m g y) : f y=g y := by have hh := congrArg (fun v : Cover ↦ ⟪m,v⟫) he simp only [normalGraph,inner_add_right,normalPlaneEmbedding_inner hm, real_inner_smul_right,real_inner_self_eq_norm_sq,hm,one_pow,mul_one,zero_add] at hh exact hh theorem normal_graph_germ_coincidence {m : Cover} (hm : ‖m‖=1) {f g : Plane → ℝ} (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hg : ContDiff ℝ (⊤ : ℕ∞) g) (hf0 : f 0=0) (hg0 : g 0=0) {B C : Set Cover} (hB : ∀ᶠ v in 𝓝 (0 : Cover),v∈B ↔ normalGraph m f (normalPlaneCoordinates m v)=v) (hC : ∀ᶠ v in 𝓝 (0 : Cover),v∈C ↔ normalGraph m g (normalPlaneCoordinates m v)=v) (hcmc : ∀ᶠ y in 𝓝 (0 : Plane),planeCMC f y=planeCMC g y) (hcl : (0 : Cover)∈closure (B∩{v | ∀ᶠ w in 𝓝 v,w∈B ↔ w∈C})) : f=ᶠ[𝓝 (0 : Plane)]g := by have hF := normalGraph_contDiff hf (n := m) have hG := normalGraph_contDiff hg (n := m) have hF0 : normalGraph m f 0=0 := by change (normalPlaneLinearIsometry m) 0+f 0 • m=0 rw [map_zero,hf0,zero_smul,add_zero] have hG0 : normalGraph m g 0=0 := by change (normalPlaneLinearIsometry m) 0+g 0 • m=0 rw [map_zero,hg0,zero_smul,add_zero] have hFt : Tendsto (normalGraph m f) (𝓝 0) (𝓝 0) := by simpa only [hF0] using (hF.continuous.continuousAt (x := 0)).tendsto have hBC : ∀ᶠ y in 𝓝 (0 : Plane),normalGraph m f y∈B ∧ (normalGraph m f y∈C ↔ normalGraph m g y=normalGraph m f y) := by filter_upwards [hFt.eventually hB,hFt.eventually hC] with y hyB hyC rw [normalPlaneCoordinates_graph hm] at hyB hyC exact ⟨hyB.mpr rfl,hyC⟩ obtain ⟨r,hr,hball⟩ := Metric.mem_nhds_iff.mp (hcmc.and hBC) have hP0 : normalPlaneCoordinates m (0 : Cover)=0 := map_zero _ have hnh : {v : Cover | normalPlaneCoordinates m v∈Metric.ball (0 : Plane) r}∈𝓝 0 := by exact (normalPlaneCoordinates m).continuous.continuousAt.preimage_mem_nhds (by simpa only [hP0] using Metric.ball_mem_nhds (normalPlaneCoordinates m 0) hr) have hex : ((B∩{v | ∀ᶠ w in 𝓝 v,w∈B ↔ w∈C})∩ {v | (v∈B ↔ normalGraph m f (normalPlaneCoordinates m v)=v) ∧ normalPlaneCoordinates m v∈Metric.ball (0 : Plane) r}).Nonempty := by obtain ⟨v,hv₁,hv₂⟩ := mem_closure_iff_nhds.mp hcl _ (hB.and hnh) exact ⟨v,hv₂,hv₁⟩ obtain ⟨v,⟨hvB,hvag⟩,hvch,hvy⟩ := hex let y := normalPlaneCoordinates m v have hFy : normalGraph m f y=v := hvch.mp hvB have hev : ∀ᶠ z in 𝓝 y,normalGraph m f z∈B ↔ normalGraph m f z∈C := (show Tendsto (normalGraph m f) (𝓝 y) (𝓝 v) from by simpa only [hFy] using (hF.continuous.continuousAt (x := y)).tendsto).eventually hvag have hyeq : y∈interior {z | f z=g z} := by apply mem_interior_iff_mem_nhds.mpr filter_upwards [hev,Metric.isOpen_ball.mem_nhds hvy] with z hz hzball have hmem := (hball hzball).2 apply normalGraph_height_eq hm exact ((hmem.2.mp (hz.mp hmem.1))).symm have heq := smooth_CMC_graph_coincidence hf hg Metric.isOpen_ball (convex_ball (0 : Plane) r).isPreconnected (fun _ hz ↦ (hball hz).1) ⟨y,hvy,hyeq⟩ exact Filter.mem_of_superset (Metric.ball_mem_nhds 0 hr) heq end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma isOpenMap_quotientMap : IsOpenMap quotientMap := by have ho : IsOpenMap (Pi.map (fun _ : Fin 3 ↦ fun t : ℝ ↦ (t : AddCircle (1 : ℝ)))) := IsOpenMap.piMap (fun _ ↦ QuotientAddGroup.isOpenMap_coe) (Eventually.of_forall (fun _ ↦ QuotientAddGroup.mk_surjective)) exact (PiLp.homeomorph 2 (fun _ : Fin 3 ↦ AddCircle (1 : ℝ))).symm.isOpenMap.comp (ho.comp (PiLp.homeomorph 2 (fun _ : Fin 3 ↦ ℝ)).isOpenMap) lemma isOpenMap_shiftedQuotient (a : Cover) : IsOpenMap (fun v ↦ quotientMap (a+v)) := isOpenMap_quotientMap.comp (Homeomorph.addLeft a).isOpenMap lemma shiftedQuotient_nhds (a : Cover) : Filter.map (fun v ↦ quotientMap (a+v)) (𝓝 (0 : Cover))=𝓝 (quotientMap a) := by simpa only [add_zero] using (isOpenMap_shiftedQuotient a).map_nhds_eq ((continuous_quotientMap.comp (continuous_const.add continuous_id)).continuousAt (x := 0)) def HasNormalizedCMCCharts (B : Set Torus) (N : Cover → Cover) (H : ℝ) : Prop := ∀ a : Cover,quotientMap a∈B → ‖N a‖=1 ∧ ∃ f : Plane → ℝ,ContDiff ℝ (⊤ : ℕ∞) f ∧ f 0=0 ∧ gradient f 0=0 ∧ (∀ᶠ y in 𝓝 (0 : Plane), N (a+normalGraph (N a) f y)=graphSlopeNormal (N a) (gradient f y) ∧ quotientMap (a+normalGraph (N a) f y)∈B ∧ planeCMC f y= -H) ∧ ∀ᶠ v in 𝓝 (0 : Cover),quotientMap (a+v)∈B ↔ normalGraph (N a) f (normalPlaneCoordinates (N a) v)=v lemma isMinimizerAt_hasNormalizedCMCCharts {V : ℝ} (hV : V∈Ioo 0 1) {E : Set Torus} (hE : MeasurableSet E) (hmin : IsMinimizerAt V E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {N : Cover → Cover} (hN : ContDiff ℝ (⊤ : ℕ∞) N) (hp : ∀ m x,N (x+latticeVector m)=N x) (hae : ∀ᵐ z ∂(μ : Measure NormalBundle),N z.1=(z.2 : Cover)) {H : ℝ} (hboundary : ∀ x : Cover,quotientMap x∈frontier (openRepresentative E) → (∀ᶠ y in 𝓝 x,‖N y‖=1) ∧ divergence N x=H) : HasNormalizedCMCCharts (frontier (openRepresentative E)) N H := by intro a ha exact ⟨(hboundary a ha).1.self_of_nhds, isMinimizerAt_normalized_CMC_chart hV hE hmin hμ hN hp hae hboundary a ha⟩ def orientedSurfaceAgreement (B C : Set Torus) (N M : Cover → Cover) : Set Torus := {x | ∀ᶠ y in 𝓝 x,(y∈B ↔ y∈C) ∧ (y∈B → N (representative y)=M (representative y))} lemma isOpen_orientedSurfaceAgreement (B C : Set Torus) (N M : Cover → Cover) : IsOpen (orientedSurfaceAgreement B C N M) := isOpen_setOfPred_eventually_nhds end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem cmc_strong_minimum {p : Plane → Plane} {f : Plane → ℝ} (hp : ContDiff ℝ (⊤ : ℕ∞) p) (hf : ContDiff ℝ (⊤ : ℕ∞) f) {Ω : Set Plane} (hΩ : IsOpen Ω) (hc : IsPreconnected Ω) (hpb : ∀ y∈Ω,‖p y‖≤1) (hpos : ∀ y∈Ω,0≤f y) (hL : ∀ y∈Ω,planeDivergence (fun z ↦ cmcJacobian (p z) (gradient f z)) y=0) {z : Plane} (hz : z∈Ω) (hfz : f z=0) : ∀ y∈Ω,f y=0 := by let O : Set Plane := Ω∩{x | 0