import PoincareLib.Geometry.RicciFlow.AncientKappa.Compactness.Boundedness.Geometry.NeckLevels.ScalarGraph import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Models import PoincareLib.Geometry.Manifold.InverseFunction.ModelSpaces import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions import Mathlib.Analysis.Normed.Module.Connected /-! # Smooth level graphs on cylinder covers Quantitative axial transversality constructs a unique smooth height over the covering sphere. Antipodal fibers of the covering make that height even. Reference: Kleiner--Lott, Theorem 46.1, pp. 2687-2688. -/ noncomputable section set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Function Filter open scoped Manifold ContDiff Topology namespace PoincareMT private instance : ConnectedSpace UnitTwoSphere := by apply isConnected_iff_connectedSpace.mp exact isConnected_sphere (by rw [← Module.finrank_eq_rank]; norm_num) 0 (by norm_num) private theorem vertical_mfderiv_bijective_at (h : RoundCylinderSpace β†’ ℝ) (p : RoundCylinderSpace) (hh : ContMDiffAt ((𝓑 2).prod π“˜(ℝ, ℝ)) π“˜(ℝ, ℝ) ∞ h p) {a : ℝ} (ha : a β‰  0) (hderiv : HasDerivAt (fun t => h (p.1, t)) a p.2) : Bijective (mfderiv ((𝓑 2).prod π“˜(ℝ, ℝ)) ((𝓑 2).prod π“˜(ℝ, ℝ)) (fun z => (z.1, h z)) p) := by let D : (EuclideanSpace ℝ (Fin 2) Γ— ℝ) β†’L[ℝ] ℝ := mfderiv ((𝓑 2).prod π“˜(ℝ, ℝ)) π“˜(ℝ, ℝ) h p let Q : EuclideanSpace ℝ (Fin 2) β†’L[ℝ] ℝ := mfderiv (𝓑 2) π“˜(ℝ, ℝ) (fun q => h (q, p.2)) p.1 have hvertical (v : EuclideanSpace ℝ (Fin 2) Γ— ℝ) : D v = Q v.1 + a * v.2 := by dsimp only [D, Q] erw [mfderiv_prod_eq_add_apply (hh.mdifferentiableAt (by simp)), mfderiv_eq_fderiv, fderiv_eq_deriv_mul (π•œ := ℝ), hderiv.deriv] rfl have htotal : mfderiv ((𝓑 2).prod π“˜(ℝ, ℝ)) ((𝓑 2).prod π“˜(ℝ, ℝ)) (fun z => (z.1, h z)) p = (ContinuousLinearMap.fst ℝ (EuclideanSpace ℝ (Fin 2)) ℝ).prod D := by rw [mfderiv_prodMk mdifferentiableAt_fst (hh.mdifferentiableAt (by simp)), mfderiv_fst] rfl have hinj : Injective (mfderiv ((𝓑 2).prod π“˜(ℝ, ℝ)) ((𝓑 2).prod π“˜(ℝ, ℝ)) (fun z => (z.1, h z)) p) := by intro v w hvw rw [htotal] at hvw have hfirst := congrArg Prod.fst hvw change v.1 = w.1 at hfirst have hsecond : D v = D w := congrArg Prod.snd hvw rw [hvertical, hvertical, hfirst] at hsecond exact Prod.ext hfirst (mul_left_cancelβ‚€ ha (add_left_cancel hsecond)) let L : (EuclideanSpace ℝ (Fin 2) Γ— ℝ) β†’L[ℝ] (EuclideanSpace ℝ (Fin 2) Γ— ℝ) := mfderiv ((𝓑 2).prod π“˜(ℝ, ℝ)) ((𝓑 2).prod π“˜(ℝ, ℝ)) (fun z : RoundCylinderSpace => (z.1, h z)) p exact ⟨hinj, (LinearMap.injective_iff_surjective (f := L.toLinearMap)).mp hinj⟩ private theorem injOn_of_abs_deriv_ge {F : ℝ β†’ ℝ} {W m : ℝ} (hm : 0 < m) (hF : βˆ€ t ∈ Icc (-W) W, ContDiffAt ℝ ∞ F t) (hd : βˆ€ t ∈ Icc (-W) W, m ≀ |deriv F t|) : InjOn F (Ioo (-W) W) := by have hlt {s t : ℝ} (hs : s ∈ Ioo (-W) W) (ht : t ∈ Ioo (-W) W) (hst : s < t) (heq : F s = F t) : False := by have hc : ContinuousOn F (Icc s t) := fun x hx => (hF x ⟨hs.1.le.trans hx.1, hx.2.trans ht.2.le⟩).continuousAt.continuousWithinAt obtain ⟨x, hx, hzero⟩ := exists_deriv_eq_zero hst hc heq have hb := hd x ⟨hs.1.le.trans hx.1.le, hx.2.le.trans ht.2.le⟩ rw [hzero, abs_zero] at hb exact (not_le_of_gt hm) hb intro s hs t ht heq rcases lt_trichotomy s t with h | h | h Β· exact False.elim (hlt hs ht h heq) Β· exact h Β· exact False.elim (hlt ht hs h heq.symm) variable {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] /-- Axial transversality constructs a smooth graph of the entire level in a cylinder-cover slab. No injectivity of the covering map is needed. -/ theorem exists_smooth_cylinderCover_level_graph (Ξ¦ : RoundCylinderSpace β†’ M) {s : ℝ} (hΞ¦ : ContMDiffOn ((𝓑 2).prod π“˜(ℝ, ℝ)) (𝓑 3) ∞ Ξ¦ (univ Γ—Λ’ Ioo (-s) s)) {f : M β†’ ℝ} (hf : ContMDiff (𝓑 3) π“˜(ℝ, ℝ) ∞ f) {W m c : ℝ} (hW : 0 < W) (hWs : W < s) (hm : 0 < m) (hd : βˆ€ (q : UnitTwoSphere) (t : ℝ), t ∈ Icc (-W) W β†’ m ≀ |deriv (fun a : ℝ => f (Ξ¦ (q, a))) t|) (hcenter : βˆ€ q : UnitTwoSphere, |f (Ξ¦ (q, 0)) - c| < m * W) : βˆƒ h : UnitTwoSphere β†’ ℝ, ContMDiff (𝓑 2) π“˜(ℝ, ℝ) ∞ h ∧ (βˆ€ q, h q ∈ Ioo (-W) W) ∧ (βˆ€ q, f (Ξ¦ (q, h q)) = c) ∧ ContMDiff (𝓑 2) (𝓑 3) ∞ (fun q => Ξ¦ (q, h q)) ∧ {x | x ∈ Ξ¦ '' (univ Γ—Λ’ Ioo (-W) W) ∧ f x = c} = range (fun q => Ξ¦ (q, h q)) ∧ (βˆ€ q t, t ∈ Ioo (-W) W β†’ f (Ξ¦ (q, t)) = c β†’ t = h q) := by let S : Set RoundCylinderSpace := univ Γ—Λ’ Ioo (-W) W let H : RoundCylinderSpace β†’ ℝ := f ∘ Ξ¦ let T : RoundCylinderSpace β†’ RoundCylinderSpace := fun z => (z.1, H z) have hopen : IsOpen S := isOpen_univ.prod isOpen_Ioo have hdom {q : UnitTwoSphere} {t : ℝ} (ht : t ∈ Icc (-W) W) : (q, t) ∈ univ Γ—Λ’ Ioo (-s) s := ⟨mem_univ _, (neg_lt_neg hWs).trans_le ht.1, ht.2.trans_lt hWs⟩ have hHs (q : UnitTwoSphere) (t : ℝ) (ht : t ∈ Icc (-W) W) : ContMDiffAt ((𝓑 2).prod π“˜(ℝ, ℝ)) π“˜(ℝ, ℝ) ∞ H (q, t) := (hf _).comp (q, t) (hΞ¦.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds (hdom ht))) have hF (q : UnitTwoSphere) (t : ℝ) (ht : t ∈ Icc (-W) W) : ContDiffAt ℝ ∞ (fun a : ℝ => f (Ξ¦ (q, a))) t := by apply contMDiffAt_iff_contDiffAt.mp exact (hHs q t ht).comp t (contMDiffAt_const.prodMk contMDiffAt_id) have hroot (q : UnitTwoSphere) : βˆƒ! t : ℝ, t ∈ Ioo (-W) W ∧ f (Ξ¦ (q, t)) = c := Poincare.Analysis.existsUnique_level_of_abs_deriv_ge hW hm (hF q) (hd q) (hcenter q) choose h hhroot hhunique using hroot have hTin : InjOn T S := by rintro ⟨q, a⟩ ha ⟨p, b⟩ hb heq have hq : q = p := congrArg Prod.fst heq subst p exact Prod.ext rfl (injOn_of_abs_deriv_ge hm (hF q) (hd q) ha.2 hb.2 (congrArg Prod.snd heq)) let J := invFunOn T S have hleft : LeftInvOn J T S := hTin.leftInvOn_invFunOn have hinv (q : UnitTwoSphere) : J (q, c) = (q, h q) := by rw [show (q, c) = T (q, h q) from Prod.ext rfl (hhroot q).2.symm] exact hleft ⟨mem_univ _, (hhroot q).1⟩ have hJs (q : UnitTwoSphere) : ContMDiffAt ((𝓑 2).prod π“˜(ℝ, ℝ)) ((𝓑 2).prod π“˜(ℝ, ℝ)) ∞ J (q, c) := by have hp := (hhroot q).1 have ht := hHs q (h q) ⟨hp.1.le, hp.2.le⟩ have hax : deriv (fun t => H (q, t)) (h q) β‰  0 := by intro hz have hb := hd q (h q) ⟨hp.1.le, hp.2.le⟩ change m ≀ |deriv (fun t => H (q, t)) (h q)| at hb rw [hz, abs_zero] at hb exact (not_le_of_gt hm) hb have hder : HasDerivAt (fun t => H (q, t)) (deriv (fun t => H (q, t)) (h q)) (h q) := ((hF q (h q) ⟨hp.1.le, hp.2.le⟩).differentiableAt (by simp)).hasDerivAt have ht' := contMDiffAt_fst.prodMk ht have hd' := vertical_mfderiv_bijective_at H (q, h q) ht hax hder have hl : βˆ€αΆ  z in 𝓝 (q, h q), J (T z) = z := Filter.Eventually.mono (hopen.mem_nhds (show (q, h q) ∈ S from ⟨mem_univ _, hp⟩)) (fun _ hz => hleft hz) let : ChartedSpace (EuclideanSpace ℝ (Fin 2) Γ— ℝ) RoundCylinderSpace := prodChartedSpace _ _ _ _ let : IsManifold π“˜(ℝ, EuclideanSpace ℝ (Fin 2) Γ— ℝ) ∞ RoundCylinderSpace := by rw [modelWithCornersSelf_prod] exact IsManifold.prod (I := 𝓑 2) (I' := π“˜(ℝ, ℝ)) UnitTwoSphere ℝ have heq : T (q, h q) = (q, c) := Prod.ext rfl (hhroot q).2 rw [← modelWithCornersSelf_prod] at ht' hd' ⊒ rw [← heq] exact Poincare.Geometry.Manifold.contMDiffAt_of_local_left_inverse_modelSpaces ht' hd' hl have hsmooth : ContMDiff (𝓑 2) π“˜(ℝ, ℝ) ∞ h := by have heq : h = fun q => (J (q, c)).2 := funext (fun q => (congrArg Prod.snd (hinv q)).symm) rw [heq] intro q exact contMDiffAt_snd.comp q ((hJs q).comp q (contMDiffAt_id.prodMk contMDiffAt_const)) refine ⟨h, hsmooth, fun q => (hhroot q).1, fun q => (hhroot q).2, ?_, ?_, ?_⟩ Β· intro q exact (hΞ¦.contMDiffAt ((isOpen_univ.prod isOpen_Ioo).mem_nhds (hdom ⟨(hhroot q).1.1.le, (hhroot q).1.2.le⟩))).comp q (contMDiffAt_id.prodMk (hsmooth q)) Β· ext x constructor Β· rintro ⟨⟨⟨q, t⟩, ht, rfl⟩, hc⟩ exact ⟨q, congrArg (fun t => Ξ¦ (q, t)) (hhunique q t ⟨ht.2, hc⟩).symm⟩ Β· rintro ⟨q, rfl⟩ exact ⟨⟨(q, h q), ⟨mem_univ _, (hhroot q).1⟩, rfl⟩, (hhroot q).2⟩ Β· intro q t ht hc exact hhunique q t ⟨ht, hc⟩ omit [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] in /-- Uniqueness on every axial fiber makes a projective level height even. -/ theorem cylinderCover_level_height_even (Ξ¦ : RoundCylinderSpace β†’ M) {f : M β†’ ℝ} {h : UnitTwoSphere β†’ ℝ} {W c : ℝ} (hdom : βˆ€ q, h q ∈ Ioo (-W) W) (hlevel : βˆ€ q, f (Ξ¦ (q, h q)) = c) (hunique : βˆ€ q t, t ∈ Ioo (-W) W β†’ f (Ξ¦ (q, t)) = c β†’ t = h q) (hanti : βˆ€ q t, t ∈ Ioo (-W) W β†’ Ξ¦ (-q, t) = Ξ¦ (q, t)) : βˆ€ q, h (-q) = h q := by intro q exact (hunique (-q) (h q) (hdom q) (by rw [hanti q _ (hdom q), hlevel q])).symm end PoincareMT