import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Ambient.CurvePreservation import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Ambient.SmoothResponse import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Smooth.SpectralInitialOrbit import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Smooth.SpectralTraceOrbit import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Spectral.ResponseClassical /-! # Actual classical ambient existence from normalized smooth data Smooth Fourier coordinates feed the actual spectral response. Its decoded classical curve stays in the embedded manifold by retraction preservation. MT2007 Claim 19.1, p. 437; `2026-09-22-ambient-curve-preservation-assembly.md`, statement 2. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set open scoped Manifold ContDiff universe u v namespace PoincareMT.M63 open SpectralHeatNative variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {ΞΉ : Type v} [Fintype ΞΉ] {a b : ℝ} local notation "W" => EuclideanSpace ℝ ΞΉ local notation "S" => State ((β„€ Γ— Fin 2) Γ— ΞΉ) /-- Normalized smooth periodic data produce an actual classical curve from the spectral engine, with continuous spatial jets of every order and closed-time retraction preservation. MT2007 Claim 19.1, p. 437; ambient preservation assembly, statement 2. -/ theorem exists_ambient_classical_curve_of_unit_initial (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) {L : ℝ} (hL : 0 < L) (f : C(AddCircle L, W)) (hf : ContDiff ℝ ∞ (fun x : ℝ => f (x : AddCircle L))) (hguard : βˆ€ x : ℝ, f (x : AddCircle L) ∈ U ∧ mfderiv π“˜(ℝ, W) (𝓑 n) ρ (f (x : AddCircle L)) (deriv (fun y : ℝ => f (y : AddCircle L)) x) β‰  0) (hunit : βˆ€ x : ℝ, ambientCurvePrincipal F ρ a (f (x : AddCircle L)) (deriv (fun y : ℝ => f (y : AddCircle L)) x) = 1) (hfixed : βˆ€ x : ℝ, f (x : AddCircle L) = e (ρ (f (x : AddCircle L)))) {Tcap : ℝ} (hTcap : 0 < Tcap) (hTcapb : Tcap < b - a) : βˆƒ T : ℝ, 0 < T ∧ T ≀ Tcap ∧ T ≀ 1 ∧ βˆƒ q : ℝ β†’ ℝ β†’ W, Continuous (Function.uncurry q) ∧ (βˆ€ t, Function.Periodic (q t) L) ∧ (βˆ€ x : ℝ, q 0 x = f (x : AddCircle L)) ∧ (βˆ€ t, ContDiff ℝ ∞ (q t)) ∧ (βˆ€ k : β„•, βˆƒ J : C(Icc (0 : ℝ) T, C(AddCircle L, W)), βˆ€ (t : Icc (0 : ℝ) T) (x : ℝ), iteratedDeriv k (q (t : ℝ)) x = J t (x : AddCircle L)) ∧ (βˆ€ t ∈ Icc (0 : ℝ) T, βˆ€ x, q t x ∈ U ∧ mfderiv π“˜(ℝ, W) (𝓑 n) ρ (q t x) (deriv (q t) x) β‰  0) ∧ (βˆ€ t ∈ Ioo (0 : ℝ) T, βˆ€ x, HasDerivAt (fun s => q s x) (ambientCurvePrincipal F ρ (a + t) (q t x) (deriv (q t) x) β€’ iteratedDeriv 2 (q t) x + ambientCurveLower F e ρ (a + t) (q t x) (deriv (q t) x)) t) ∧ ContDiffOn ℝ 1 (Function.uncurry q) (Ioo (0 : ℝ) T Γ—Λ’ univ) ∧ βˆ€ t ∈ Icc (0 : ℝ) T, βˆ€ x, q t x = e (ρ (q t x)) := by let : Fact (0 < L) := ⟨hL⟩ let E : (ΞΉ β†’ ℝ) ≃L[ℝ] W := (PiLp.continuousLinearEquiv 2 ℝ (fun _ : ΞΉ => ℝ)).symm let f' : C(AddCircle L, ΞΉ β†’ ℝ) := E.symm.toContinuousLinearMap.compLeftContinuous ℝ (AddCircle L) f have hf' : ContDiff ℝ ∞ (fun x : ℝ => f' (x : AddCircle L)) := E.symm.contDiff.comp hf obtain ⟨w, _hcoeff, hrec, _hbase, hw⟩ := exists_smooth_vectorPeriodic_spectral_initial_state f' hf' let jet : S β†’ AddCircle L β†’ W Γ— W := fun v x => (E (vectorPeriodicJet (L := L) 1 0 (by omega) v x), E (vectorPeriodicJet (L := L) 1 1 (by omega) v x)) have hzero (x : AddCircle L) : (jet w x).1 = f x := by change E (vectorPeriodicJet (L := L) 1 0 (by omega) w x) = f x rw [hrec] exact E.apply_symm_apply (f x) have hfirst (x : ℝ) : (jet w (x : AddCircle L)).2 = deriv (fun y : ℝ => f (y : AddCircle L)) x := by have heq : (fun y : ℝ => E (vectorPeriodicJet (L := L) 1 0 (by omega) w (y : AddCircle L))) = (fun y : ℝ => f (y : AddCircle L)) := funext fun y => hzero (y : AddCircle L) have hd := E.toContinuousLinearMap.hasFDerivAt.comp_hasDerivAt x (hasDerivAt_vectorPeriodicJet (L := L) (k := 1) (j := 0) (by omega) w x) change HasDerivAt (fun y : ℝ => E (vectorPeriodicJet (L := L) 1 0 (by omega) w (y : AddCircle L))) ((jet w (x : AddCircle L)).2) x at hd rw [heq] at hd exact hd.deriv.symm let K := range (jet w) have hjetc : Continuous (jet w) := (E.continuous.comp (vectorPeriodicJet (L := L) 1 0 (by omega) w).continuous).prodMk (E.continuous.comp (vectorPeriodicJet (L := L) 1 1 (by omega) w).continuous) have hK : IsCompact K := isCompact_range hjetc have hKsub : K βŠ† {z : W Γ— W | z.1 ∈ U ∧ mfderiv π“˜(ℝ, W) (𝓑 n) ρ z.1 z.2 β‰  0} := by rintro z ⟨x, rfl⟩ obtain ⟨y, rfl⟩ := QuotientAddGroup.mk_surjective x change (jet w (y : AddCircle L)).1 ∈ U ∧ mfderiv π“˜(ℝ, W) (𝓑 n) ρ (jet w (y : AddCircle L)).1 (jet w (y : AddCircle L)).2 β‰  0 rw [hzero, hfirst] exact hguard y have hunitjet (x : AddCircle L) : ambientCurvePrincipal F ρ a (jet w x).1 (jet w x).2 = 1 := by obtain ⟨y, rfl⟩ := QuotientAddGroup.mk_surjective x rw [hzero, hfirst] exact hunit y obtain ⟨T, hT, hTTcap, hT1, F0, u, _huw, _hu, htrace, hbranch, hinside, hsource⟩ := exists_ambient_smooth_response (L := L) F he hU hρ hK hKsub w hTcap hTcapb (fun x => mem_range_self x) hunitjet have hTb : a + T ≀ b := by linarith have horbit := contDiffAt_initialResponseTrace_spectral_orbit (L := L) hT.le w F0 u htrace hw.contDiffAt hbranch let q := initialResponseCurve (L := L) hT.le w F0 obtain ⟨hqc, hper, hqzero, hqd⟩ := initialResponseCurve_spec (L := L) hT.le w F0 obtain ⟨hspace, hjets⟩ := initialResponseCurve_spatial_jets (L := L) hT.le w F0 horbit obtain ⟨htime, hC1⟩ := initialResponseCurve_classical F he hU hρ hT.le hTb w F0 horbit hinside hsource have hqinitial (x : ℝ) : q 0 x = f (x : AddCircle L) := (hqzero x).trans (hzero (x : AddCircle L)) let lambda := fun p : (β„€ Γ— Fin 2) Γ— ΞΉ => periodicSpectrum L p.1 let V := initialResponseTrace lambda w hT.le F0 have hqguard (t : ℝ) (ht : t ∈ Icc (0 : ℝ) T) (x : ℝ) : q t x ∈ U ∧ mfderiv π“˜(ℝ, W) (𝓑 n) ρ (q t x) (deriv (q t) x) β‰  0 := by have hqvalue : q t x = (jet (V ⟨t, ht⟩) (x : AddCircle L)).1 := by dsimp only [q, initialResponseCurve] rw [projIcc_of_mem hT.le ht] rfl have hqderiv : deriv (q t) x = (jet (V ⟨t, ht⟩) (x : AddCircle L)).2 := by have hd := (hqd t x).deriv rw [projIcc_of_mem hT.le ht] at hd exact hd rw [hqvalue, hqderiv] exact hinside ⟨t, ht⟩ (x : AddCircle L) have hqxc : ContinuousOn (fun z : ℝ Γ— ℝ => deriv (q z.1) z.2) (Icc (0 : ℝ) T Γ—Λ’ univ) := by have heq : (fun z : ℝ Γ— ℝ => deriv (q z.1) z.2) = (fun z : ℝ Γ— ℝ => E (vectorPeriodicJet (L := L) 1 1 (by omega) (V (projIcc 0 T hT.le z.1)) (z.2 : AddCircle L))) := funext fun z => (hqd z.1 z.2).deriv rw [heq] exact (E.continuous.comp (continuous_eval.comp (((vectorPeriodicJet (L := L) (ΞΉ := ΞΉ) 1 1 (by omega)).continuous.comp (V.continuous.comp (continuous_projIcc.comp continuous_fst))).prodMk ((AddCircle.continuous_mk' L).comp continuous_snd)))).continuousOn have hpres := ambientCurve_preserves_retraction F he hU heU hρ hρe hL hT hTb q hqc.continuousOn hqxc (fun t _ => hper t) (fun t _ => (hspace t).of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)) hqguard htime (fun x => by rw [hqinitial]; exact hfixed x) exact ⟨T, hT, hTTcap, hT1, q, hqc, hper, hqinitial, hspace, hjets, hqguard, htime, hC1, hpres⟩ end PoincareMT.M63