import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Exponential.InteriorEndpointFamily import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.VelocityChainRules /-! # Real variations through an interior chart direction A fixed-curve specialization of the joint endpoint family preserves the outer endpoints and realizes each inverse-chart tangent direction. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 open scoped Manifold ContDiff Bundle Topology open Filter universe u namespace PoincareMT.ReducedLength variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] local notation "Q" => EuclideanSpace ℝ (Fin n) set_option backward.isDefEq.respectTransparency false in theorem exists_smooth_interior_point_variation (Ξ± : ℝ β†’ M) (D : Set ℝ) (hD : IsOpen D) (hΞ± : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ Ξ± D) (L c : ℝ) (hc : c ∈ Set.Ioo 0 L) (hI : Set.Icc 0 L βŠ† D) (v : Q) : let e := chartAt Q (Ξ± c) βˆƒ (f : ℝ Γ— ℝ β†’ M) (U : Set (ℝ Γ— ℝ)) (ρ : ℝ), IsOpen U ∧ 0 < ρ ∧ Set.Icc 0 L Γ—Λ’ Set.Ioo (-ρ) ρ βŠ† U ∧ ContMDiffOn ((π“˜(ℝ, ℝ)).prod (π“˜(ℝ, ℝ))) (𝓑 n) ∞ f U ∧ (βˆ€ s ∈ Set.Icc 0 L, f (s, 0) = Ξ± s) ∧ (βˆ€ u, f (0, u) = Ξ± 0) ∧ (βˆ€ u, f (L, u) = Ξ± L) ∧ (βˆ€ u, f (c, u) = e.symm (e (Ξ± c) + u β€’ v)) ∧ (curveVelocity (n := n) (fun u ↦ f (c, u)) 0 : Q) = mfderiv (𝓑 n) (𝓑 n) e.symm (e (Ξ± c)) v := by let e := chartAt Q (Ξ± c) let y0 := e (Ξ± c) let base : ℝ Γ— ℝ β†’ M := fun z ↦ Ξ± z.2 have hbase : ContMDiffOn (π“˜(ℝ, ℝ Γ— ℝ)) (𝓑 n) ∞ base (Set.univ Γ—Λ’ D) := hΞ±.comp contDiff_snd.contMDiff.contMDiffOn (fun z hz ↦ hz.2) obtain ⟨Φ, Ξ©, N, hΞ©, hN, h0N, hNΞ©, hΞ¦, _, hleft, hright, hmark, hcenter⟩ := exists_smooth_interior_endpoint_family base (Set.univ Γ—Λ’ D) (isOpen_univ.prod hD) hbase 0 L c hc (fun s hs ↦ ⟨Set.mem_univ _, hI hs⟩) let k : ℝ Γ— ℝ β†’ (ℝ Γ— Q) Γ— ℝ := fun z ↦ ((0, y0 + z.2 β€’ v), z.1) have hk : ContDiff ℝ ∞ k := (contDiff_const.prodMk (contDiff_const.add (contDiff_snd.smul contDiff_const))).prodMk contDiff_fst let f : ℝ Γ— ℝ β†’ M := Ξ¦ ∘ k let U := k ⁻¹' Ξ© have hU : IsOpen U := hΞ©.preimage hk.continuous have hf : ContMDiffOn (π“˜(ℝ, ℝ Γ— ℝ)) (𝓑 n) ∞ f U := hΞ¦.comp hk.contMDiff.contMDiffOn (fun _ hz ↦ hz) have hline : Continuous (fun u : ℝ ↦ ((0 : ℝ), y0 + u β€’ v)) := continuous_const.prodMk (continuous_const.add (continuous_id.smul continuous_const)) have hnear : βˆ€αΆ  u : ℝ in 𝓝 0, ((0 : ℝ), y0 + u β€’ v) ∈ N := by apply hline.continuousAt.preimage_mem_nhds simpa only [zero_smul, add_zero] using hN.mem_nhds h0N obtain ⟨ρ, hρ, hρN⟩ := Metric.mem_nhds_iff.mp hnear have hparam (u : ℝ) (hu : u ∈ Set.Ioo (-ρ) ρ) : ((0 : ℝ), y0 + u β€’ v) ∈ N := by apply hρN simpa only [Real.ball_eq_Ioo, zero_sub, zero_add] using hu refine ⟨f, U, ρ, hU, hρ, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ Β· intro z hz exact hNΞ© ⟨hparam z.2 hz.2, hz.1⟩ Β· convert! hf using 1 <;> simp only [modelWithCornersSelf_prod, chartedSpaceSelf_prod] Β· intro s hs simpa only [f, Function.comp_apply, k, zero_smul, add_zero] using hcenter (0, y0) h0N s hs Β· intro u exact hleft 0 (y0 + u β€’ v) Β· intro u exact hright 0 (y0 + u β€’ v) Β· intro u exact hmark 0 (y0 + u β€’ v) Β· have heq : (fun u ↦ f (c, u)) = fun u ↦ e.symm (y0 + u β€’ v) := funext (fun u ↦ hmark 0 (y0 + u β€’ v)) rw [heq] apply curveVelocity_comp_initial_line have hchart : ContMDiffOn (𝓑 n) (𝓑 n) ∞ e.symm e.target := contMDiffOn_chart_symm exact (hchart.contMDiffAt (e.open_target.mem_nhds (e.map_source (mem_chart_source Q (Ξ± c))))).mdifferentiableAt (by simp) end PoincareMT.ReducedLength