import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Immersed.CurveComposition import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Smooth.RetractionDifferentials import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Uniqueness.EmbeddedCurve /-! # Smooth fixed labels from an actual smooth anchor slice The actual retraction differential detects immersion of the embedded reference curve. Scalar composition cancellation upgrades the same fixed labels, hence the original normal solution. MT2007 Claim 19.1, p. 437; `2026-09-22-smooth-upgrade-fixed-labels.md`, statement 2. -/ set_option autoImplicit false open Set open scoped Manifold ContDiff universe u v namespace PoincareMT.M63 variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {ΞΉ : Type v} [Fintype ΞΉ] {a b : ℝ} local notation "W" => EuclideanSpace ℝ ΞΉ /-- Both actual anchor slices are retained when the anchor is an included endpoint. The same continuous labels become smooth and transport the reference's joint interior smoothness. MT2007 Claim 19.1, p. 437; fixed-label smooth upgrade derivation, statement 2. -/ theorem smoothShrinkingCurve_of_fixed_relabeling_and_smooth_slice (F : RicciFlow n M (Icc a b)) {e : M β†’ W} (he : ContMDiff (𝓑 n) π“˜(ℝ, W) ∞ e) {U : Set W} (hU : IsOpen U) (heU : range e βŠ† U) {ρ : W β†’ M} (hρ : ContMDiffOn π“˜(ℝ, W) (𝓑 n) ∞ ρ U) (hρe : βˆ€ p, ρ (e p) = p) {J : Set ℝ} {s : ℝ} (hs : s ∈ J) {c d : ℝ β†’ ℝ β†’ M} (hc : M63C2ShrinkingCurveOn F c J) (hd : M63SmoothShrinkingCurveOn F d J) (hcs : ContMDiff π“˜(ℝ, ℝ) (𝓑 n) ∞ (fun x => c x s)) (hds : ContMDiff π“˜(ℝ, ℝ) (𝓑 n) ∞ (fun x => d x s)) {phi : ℝ β†’ ℝ} (hphi : Continuous phi) (hrel : βˆ€ t ∈ J, βˆ€ x, c x t = d (phi x) t) : ContDiff ℝ ∞ phi ∧ M63SmoothShrinkingCurveOn F c J := by let f : ℝ β†’ W := fun y => e (d y s) have hf : ContDiff ℝ ∞ f := (he.comp hds).contDiff have hdata := (c2ShrinkingCurve_embedded_closed_data hd.1 he).2.1 have hleft := (smooth_retraction_differentials he hU heU hρ hρe).2.2 have hne (y : ℝ) : deriv f y β‰  0 := by have hder : HasDerivAt f (mfderiv (𝓑 n) π“˜(ℝ, W) e (d y s) (curveVelocity (n := n) (fun z => d z s) y)) y := hdata s hs y rw [hder.deriv] intro hz have h := hleft (d y s) (curveVelocity (n := n) (fun z => d z s) y) erw [hz, map_zero] at h exact hd.1.immersed s hs y h.symm have hfc : ContDiff ℝ ∞ (f ∘ phi) := by have heq : f ∘ phi = fun x => e (c x s) := funext fun x => congrArg e (hrel s hs x).symm rw [heq] exact (he.comp hcs).contDiff have hphis : ContDiff ℝ ∞ phi := contDiff_iff_contDiffAt.mpr fun x => contDiffAt_of_comp_immersed_curve (by simp) (hphi.continuousAt) hf.contDiffAt (hne (phi x)) hfc.contDiffAt have hmap : ContMDiff π“˜(ℝ, ℝ Γ— ℝ) π“˜(ℝ, ℝ Γ— ℝ) ∞ (fun z : ℝ Γ— ℝ => (phi z.1, z.2)) := ((hphis.comp contDiff_fst).prodMk contDiff_snd).contMDiff refine ⟨hphis, hc, ?_⟩ apply (hd.2.comp hmap.contMDiffOn (fun z hz => ⟨mem_univ _, hz.2⟩)).congr intro z hz exact hrel z.2 (interior_subset hz.2) z.1 end PoincareMT.M63