import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Imports import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RadialUnitFieldBound import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.CapGeometry.RadialShapeDerivative import PoincareLib.Geometry.Riemannian.Connection.Pullback /-! # Retaining the oriented radial field through actual metric germs The selected cylinder maps have invertible differential. Pulling the actual outward field back through that differential preserves its unit length and its covariant-derivative estimate for each actual local metric realization. This uses the native Levi-Civita naturality theorem. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Filter VectorField open scoped Manifold ContDiff Bundle Topology namespace PoincareMT.M35.Uniqueness /-- The literal radial field is a smooth tangent section off the original tip. -/ theorem radialUnitField_contMDiffAt (g : RiemannianMetric 3 StandardCapSpace) {x : StandardCapSpace} (hx : x β‰  0) : ContMDiffAt (𝓑 3) ((𝓑 3).prod (𝓑 3)) ∞ (fun y => Bundle.TotalSpace.mk' StandardCapSpace y (E := TangentSpace (𝓑 3)) (radialUnitField g y)) x := by rw [Bundle.contMDiffAt_totalSpace] exact ⟨contMDiffAt_id, by simpa using (radialUnitField_contDiffAt g hx).contMDiffAt⟩ /-- A genuine local metric pullback retains the same outward unit direction and the same actual derivative bound, through the inverse differential. -/ theorem radialUnitField_pullback {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓑 3) ∞ M] {g : RiemannianMetric 3 M} (D : LeviCivitaData g) {G : RiemannianMetric 3 StandardCapSpace} (DG : LeviCivitaData G) (hrotation : βˆ€ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, βˆ€ x u v : StandardCapSpace, G.inner (standardRotation A x) (mfderiv (𝓑 3) (𝓑 3) (standardRotation A) x u) (mfderiv (𝓑 3) (𝓑 3) (standardRotation A) x v) = G.inner x u v) {f : M β†’ StandardCapSpace} {x : M} (hf : ContMDiffAt (𝓑 3) (𝓑 3) ∞ f x) (hinv : βˆ€αΆ  y in 𝓝 x, (mfderiv (𝓑 3) (𝓑 3) f y).IsInvertible) (hmetric : βˆ€αΆ  y in 𝓝 x, βˆ€ u v : TangentSpace (𝓑 3) y, g.inner y u v = G.inner (f y) (mfderiv (𝓑 3) (𝓑 3) f y u) (mfderiv (𝓑 3) (𝓑 3) f y v)) (hzero : f x β‰  0) (b : ℝ) (hbound : βˆ€ w : StandardCapSpace, G.inner (f x) (DG.connection (radialUnitField G) (f x) w) (DG.connection (radialUnitField G) (f x) w) ≀ b ^ 2 * G.inner (f x) w w) : let Z := mpullback (𝓑 3) (𝓑 3) f (radialUnitField G) ContMDiffAt (𝓑 3) ((𝓑 3).prod (𝓑 3)) ∞ (T% Z) x ∧ g.inner x (Z x) (Z x) = 1 ∧ βˆ€ w : TangentSpace (𝓑 3) x, g.inner x (D.connection Z x w) (D.connection Z x w) ≀ b ^ 2 * g.inner x w w := by let Z := mpullback (𝓑 3) (𝓑 3) f (radialUnitField G) have hZ := radialUnitField_contMDiffAt G hzero have hi := hinv.self_of_nhds refine ⟨hZ.mpullback_vectorField_preimage hf hi (by simp), ?_, ?_⟩ Β· rw [hmetric.self_of_nhds] simp only [mpullback, hi.self_apply_inverse] exact radialUnitField_unit G hrotation hzero Β· intro w have hc := D.connection_mpullback_of_metric_pullback DG hf hinv hmetric (hZ.mdifferentiableAt (by simp)) w change D.connection Z x w = _ at hc rw [hc, hmetric.self_of_nhds, hmetric.self_of_nhds] simp only [hi.self_apply_inverse] exact hbound (mfderiv (𝓑 3) (𝓑 3) f x w) /-- The full shape-operator equation retains the orientation through the actual inverse differential, with the pulled-back metric pairing. -/ theorem radialUnitField_pullback_connection {g G : RiemannianMetric 3 StandardCapSpace} (D : LeviCivitaData g) (DG : LeviCivitaData G) (hrotation : βˆ€ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, βˆ€ x u v : StandardCapSpace, G.inner (standardRotation A x) (mfderiv (𝓑 3) (𝓑 3) (standardRotation A) x u) (mfderiv (𝓑 3) (𝓑 3) (standardRotation A) x v) = G.inner x u v) {f : StandardCapSpace β†’ StandardCapSpace} {x : StandardCapSpace} (hf : ContMDiffAt (𝓑 3) (𝓑 3) ∞ f x) (hinv : βˆ€αΆ  y in 𝓝 x, (mfderiv (𝓑 3) (𝓑 3) f y).IsInvertible) (hmetric : βˆ€αΆ  y in 𝓝 x, βˆ€ u v : StandardCapSpace, g.inner y u v = G.inner (f y) (mfderiv (𝓑 3) (𝓑 3) f y u) (mfderiv (𝓑 3) (𝓑 3) f y v)) (hzero : f x β‰  0) (w : StandardCapSpace) : let Z : StandardCapSpace β†’ StandardCapSpace := fun y => (fderiv ℝ f y).inverse (radialUnitField G (f y)) D.connection Z x w = (axisWarpingSlope G β€–f xβ€– / axisWarpingRadius G β€–f xβ€–) β€’ (w - g.inner x (Z x) w β€’ Z x) := by have hi := hinv.self_of_nhds have hZ := (radialUnitField_contMDiffAt G hzero).mdifferentiableAt (by simp) have hc := D.connection_mpullback_of_metric_pullback DG hf hinv hmetric hZ w rw [radialUnitField_connection DG hrotation hzero] at hc let Z := mpullback (𝓑 3) (𝓑 3) f (radialUnitField G) have he : D.connection Z x w = (axisWarpingSlope G β€–f xβ€– / axisWarpingRadius G β€–f xβ€–) β€’ (@Sub.sub (TangentSpace (𝓑 3) x) _ w (g.inner x (Z x) w β€’ Z x)) := by rw [hc, hmetric.self_of_nhds] simp only [Z, mpullback, map_smul, map_sub, hi.self_apply_inverse, hi.inverse_apply_self] rfl simpa only [Z, mpullback_eq_pullback, VectorField.pullback] using! he /-- The scalar shape equation pulls back through the same actual metric germ. Its ordinary differential uses the pulled-back unit covector. -/ theorem radial_shape_pullback_hasFDerivAt {g G : RiemannianMetric 3 StandardCapSpace} (hrotation : βˆ€ A : Matrix.specialOrthogonalGroup (Fin 3) ℝ, βˆ€ x u v : StandardCapSpace, G.inner (standardRotation A x) (mfderiv (𝓑 3) (𝓑 3) (standardRotation A) x u) (mfderiv (𝓑 3) (𝓑 3) (standardRotation A) x v) = G.inner x u v) {f : StandardCapSpace β†’ StandardCapSpace} {x : StandardCapSpace} (hf : DifferentiableAt ℝ f x) (hinv : (mfderiv (𝓑 3) (𝓑 3) f x).IsInvertible) (hmetric : βˆ€ u v : StandardCapSpace, g.inner x u v = G.inner (f x) (mfderiv (𝓑 3) (𝓑 3) f x u) (mfderiv (𝓑 3) (𝓑 3) f x v)) (hzero : f x β‰  0) : let Z : StandardCapSpace β†’ StandardCapSpace := fun y => (fderiv ℝ f y).inverse (radialUnitField G (f y)) HasFDerivAt (fun y => axisWarpingSlope G β€–f yβ€– / axisWarpingRadius G β€–f yβ€–) (-(radialMixedCurvatureFactor G β€–f xβ€– / axisRadialCoefficient G β€–f xβ€– + (axisWarpingSlope G β€–f xβ€– / axisWarpingRadius G β€–f xβ€–) ^ 2) β€’ g.euclideanCoefficients x (Z x)) x := by have h := (radial_shape_hasFDerivAt G hrotation hzero).comp x hf.hasFDerivAt dsimp only apply h.congr_fderiv ext w simp only [smul_apply, ContinuousLinearMap.comp_apply, smul_eq_mul] change _ = -(radialMixedCurvatureFactor G β€–f xβ€– / axisRadialCoefficient G β€–f xβ€– + (axisWarpingSlope G β€–f xβ€– / axisWarpingRadius G β€–f xβ€–) ^ 2) * g.euclideanCoefficients x ((fderiv ℝ f x).inverse (radialUnitField G (f x))) w have hm (u v : StandardCapSpace) : g.euclideanCoefficients x u v = G.euclideanCoefficients (f x) (fderiv ℝ f x u) (fderiv ℝ f x v) := by simpa only [mfderiv_eq_fderiv, RiemannianMetric.euclideanCoefficients] using! hmetric u v rw [hm] have hi : (fderiv ℝ f x).IsInvertible := by simpa only [mfderiv_eq_fderiv] using hinv rw [hi.self_apply_inverse] end PoincareMT.M35.Uniqueness