import Mathlib import OAI.Analysis.BiholderTransport.Regularity.MetricDefinitions import OAI.Analysis.BiholderTransport.LinearAlgebra.ActualRadial import OAI.Analysis.BiholderTransport.Coordinates.SplitAction import OAI.Analysis.BiholderTransport.Regularity.SecondScaled import OAI.Analysis.BiholderTransport.CostGeometry.BranchCost2 import OAI.Analysis.BiholderTransport.Coordinates.ProperPieces namespace OAI section section noncomputable section open Set Filter Manifold Bundle open scoped Topology ContDiff namespace WeakMTWTransport section Crossing variable {n : ℕ} {M : Type*} [MetricSpace M] [CompactSpace M] [ChartedSpace (Model n) M] [IsManifold 𝓘(ℝ,Model n) ∞ M] [RiemannianBundle (fun x : M => TangentSpace 𝓘(ℝ,Model n) x)] [IsContMDiffRiemannianBundle 𝓘(ℝ,Model n) ∞ (Model n) (fun x : M => TangentSpace 𝓘(ℝ,Model n) x)] [IsRiemannianManifold 𝓘(ℝ,Model n) M] local instance (x : M) : FiniteDimensional ℝ (TangentSpace 𝓘(ℝ,Model n) x) := inferInstanceAs (FiniteDimensional ℝ (Model n)) end Crossing end WeakMTWTransport end end section noncomputable section open Set Filter Manifold Bundle open scoped Topology ContDiff namespace WeakMTWTransport section MiddleHessian variable {n : ℕ} {M : Type*} [MetricSpace M] [CompactSpace M] [ChartedSpace (Model n) M] [IsManifold 𝓘(ℝ,Model n) ∞ M] [RiemannianBundle (fun x : M => TangentSpace 𝓘(ℝ,Model n) x)] [IsContMDiffRiemannianBundle 𝓘(ℝ,Model n) ∞ (Model n) (fun x : M => TangentSpace 𝓘(ℝ,Model n) x)] [IsRiemannianManifold 𝓘(ℝ,Model n) M] local instance (x : M) : FiniteDimensional ℝ (TangentSpace 𝓘(ℝ,Model n) x) := inferInstanceAs (FiniteDimensional ℝ (Model n)) omit [IsRiemannianManifold 𝓘(ℝ,Model n) M] in lemma reverseRay_prefix (z : TangentBundle 𝓘(ℝ,Model n) M) (h : ℝ) : reverseRay (tangentScale h z)=tangentScale (-h) (sprayFlow h z) := by rw [reverseRay,sprayFlow_scale,mul_one,tangentScale_mul,neg_one_mul] lemma proper_prefix_reverse_in_injectivityDomain {z : TangentBundle 𝓘(ℝ,Model n) M} (hz : z.2∈minimizingVectors z.1) {h : ℝ} (hh : 0 simp only [cost,div_div,mul_comm] rw [←middle_action_contact hz hh hh1] at H' dsimp only [middleCenteredAction] simp only [sub_self,mul_zero,neg_mul,sub_neg_eq_add,div_eq_mul_inv] at H' ⊢ nlinarith lemma middleCenteredAction_contDiffAt {z : TangentBundle 𝓘(ℝ,Model n) M} (hz : z.2∈minimizingVectors z.1) {h : ℝ} (hh : 0