import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.GeometryImports import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Limits.SelectedCylinderMetricRays import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Limits.SelectedSphereRadiusBarrier import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Cone.Limits.SelectedChordCompactness import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Coordinates.MetricEndRayEndpoint import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Coordinates.MetricEndRayConeTriangle import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Cone.Geometry.ChordConeAnnulus /-! # One actual selected end and its compact completed chord link The same original open-region metric supplies the missing completion point, selected-wall rays, radius barrier and produced chord metric. All limits and the completed cone triangle belong to those same data. Source: Morgan--Tian Claims 10.13-10.14, Lemma 10.21 and Proposition 10.29, pp. 256-263; M28 derivations 135, 138, 155 and 161c. -/ noncomputable section set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter open scoped Manifold ContDiff Bundle Topology ENNReal universe u namespace PoincareMT.M28 variable {M : Type u} [TopologicalSpace M] [T2Space M] [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓑 3) ∞ M] {g : RiemannianMetric 3 M} {X : Set M} /-- The constructed end, selected-ray function and compact chord link retain one original intrinsic metric and one completion point. No cone or limit existence is assumed by its constructor. Source: Proposition 10.29, pp. 262-263; M28 derivation 161c. -/ structure SelectedEndChordData (T : EpsilonTubeCertificate g X) (A : OpenCylinderModel T.carrier) (U : TopologicalSpace.Opens M) (hfinite : βˆ€ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) β‰  ⊀) where /-- The point constructed by the actual vanishing-tail completion. -/ endPoint : letI := intrinsicOpenMetricSpace g U hfinite UniformSpace.Completion U /-- The constructed endpoint is missing from the original open region. -/ endPoint_missing : letI := intrinsicOpenMetricSpace g U hfinite endPoint βˆ‰ range ((↑) : U β†’ UniformSpace.Completion U) /-- The common positive radius barrier from the actual selected sphere. -/ alpha : ℝ /-- The sphere's minimum completion radius is strictly positive. -/ alpha_pos : 0 < alpha /-- The signed wall retained by the actual common segment/ray producer. -/ wall : M β†’ ℝ /-- Completion radius is continuous in the original intrinsic metric. -/ radius_continuous : letI := intrinsicOpenMetricSpace g U hfinite Continuous (fun x : U => dist (x : UniformSpace.Completion U) endPoint) /-- Every original-region point has strictly positive completion radius. -/ radius_pos : letI := intrinsicOpenMetricSpace g U hfinite βˆ€ x : U, 0 < dist (x : UniformSpace.Completion U) endPoint /-- The same ambient-cylinder tails have uniformly vanishing radius. -/ tail_radius : letI := intrinsicOpenMetricSpace g U hfinite βˆ€ eta : ℝ, 0 < eta β†’ βˆƒ c : ℝ, 1 / 2 < c ∧ c < 1 ∧ βˆ€ x : U, c < (A.inverse x).2 β†’ dist (x : UniformSpace.Completion U) endPoint < eta /-- Every point below the radius barrier lies on the positive wall side. -/ radius_barrier : letI := intrinsicOpenMetricSpace g U hfinite βˆ€ x : U, dist (x : UniformSpace.Completion U) endPoint < alpha β†’ 0 < wall x /-- Every positive-side pair has a segment in the same original region. -/ segments : letI := intrinsicOpenMetricSpace g U hfinite βˆ€ p q : U, 0 < wall p β†’ 0 < wall q β†’ βˆƒ mu : ℝ β†’ U, mu 0 = p ∧ mu 1 = q ∧ Continuous mu ∧ (βˆ€ t : ℝ, (3 / 4 : ℝ) ≀ (A.inverse (mu t)).2) ∧ βˆ€ s ∈ Icc (0 : ℝ) 1, βˆ€ t ∈ Icc (0 : ℝ) 1, (intrinsicOpenMetric g U).edist (mu s) (mu t) = ENNReal.ofReal |s - t| * (intrinsicOpenMetric g U).edist p q /-- The same end has an actual inward metric ray at every positive-side point. -/ inward_rays : letI := intrinsicOpenMetricSpace g U hfinite let r : U β†’ ℝ := fun x => dist (x : UniformSpace.Completion U) endPoint βˆ€ p : U, 0 < wall p β†’ βˆƒ gamma : ℝ β†’ U, gamma 0 = p ∧ Isometry (fun t : Ico (0 : ℝ) (r p) => gamma t.1) ∧ (βˆ€ s ∈ Ico (0 : ℝ) (r p), βˆ€ t ∈ Ico (0 : ℝ) (r p), dist (gamma s) (gamma t) = |s - t|) ∧ (βˆ€ t ∈ Ico (0 : ℝ) (r p), r (gamma t) = r p - t) ∧ βˆ€ t ∈ Ico (0 : ℝ) (r p), (3 / 4 : ℝ) ≀ (A.inverse (gamma t)).2 /-- The chord pseudometric is produced from actual same-end source limits. -/ chordMetric : letI := intrinsicOpenMetricSpace g U hfinite PseudoMetricSpace (MetricEndRay endPoint alpha) /-- Actual selected-sphere packing makes this same completed link compact. -/ chord_compact : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric CompactSpace (UniformSpace.Completion (MetricEndRay endPoint alpha)) /-- All produced ray chords have distance at most two. -/ chord_le_two : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, dist P Q ≀ 2 /-- The joint positive-radius chord-defect limit determines this metric. -/ joint_chord_limit : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, Tendsto (fun p : ℝ Γ— ℝ => chordDefect (fun s t => dist (P.point s) (Q.point t)) p.1 p.2) ((𝓝[>] (0 : ℝ)) Γ—Λ’ (𝓝[>] (0 : ℝ))) (𝓝 (dist P Q ^ 2)) /-- Equal-radius rescaled source distances converge to the same chord distance. -/ equal_radius_limit : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, Tendsto (fun h : ℝ => dist (P.point h) (Q.point h) / h) (𝓝[>] (0 : ℝ)) (𝓝 (dist P Q)) /-- Every pair of fixed positive radii has the full chord-cone distance limit. -/ scaled_distance_limit : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, βˆ€ r s : ℝ, 0 < r β†’ 0 < s β†’ Tendsto (fun h : ℝ => dist (P.point (h * r)) (Q.point (h * s)) / h) (𝓝[>] (0 : ℝ)) (𝓝 (chordConeDistance r s (dist P Q))) /-- The chord-defect bound holds throughout both strict positive ray domains. -/ strict_chord_bound : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, βˆ€ s ∈ Ioo (0 : ℝ) P.length, βˆ€ t ∈ Ioo (0 : ℝ) Q.length, chordDefect (fun u v => dist (P.point u) (Q.point v)) s t ≀ dist P Q ^ 2 /-- Source distances obey the same cone bound at included outer endpoints. -/ endpoint_distance_bound : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, βˆ€ s ∈ Ioc (0 : ℝ) P.length, βˆ€ t ∈ Ioc (0 : ℝ) Q.length, dist (P.point s) (Q.point t) ≀ chordConeDistance s t (dist P Q) /-- Zero chord distance is exactly equality of the actual end germs. -/ zero_iff_sameEndGerm : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ P Q : MetricEndRay endPoint alpha, dist P Q = 0 ↔ MetricEndRay.SameEndGerm P Q /-- The actual three-radius source triangle extends to completed labels. -/ completed_triangle : letI := intrinsicOpenMetricSpace g U hfinite letI := chordMetric βˆ€ x y z : UniformSpace.Completion (MetricEndRay endPoint alpha), βˆ€ r s t : ℝ, 0 < r β†’ 0 < s β†’ 0 < t β†’ chordConeDistance r t (dist x z) ≀ chordConeDistance r s (dist x y) + chordConeDistance s t (dist y z) /-- The actual original recut produces one end, radius barrier, ray function and compact completed chord link. Every field is constructed by the existing geometric producers, with the same completion point and source metric. Source: Proposition 10.29; M28 derivation 161c. -/ theorem exists_selected_end_chord_data [MeasurableSpace M] [BorelSpace M] [T3Space M] (T : EpsilonTubeCertificate g X) (A : OpenCylinderModel T.carrier) (U : TopologicalSpace.Opens M) (hU : (U : Set M) = A.tail true (1 / 2)) (hA : SmoothSphereIsotopicIn T.carrier A.middleSphere T.cylinder.middleSphere) (D0 : LeviCivitaData g) (hR : ContinuousOn D0.scalarCurvature T.carrier) (hratio : βˆ€ i ∈ T.chain.shape.active, βˆ€ y ∈ (T.chain.neck i).carrier, βˆ€ z ∈ (T.chain.neck i).carrier, D0.scalarCurvature y ≀ 2 * D0.scalarCurvature z) (hdiverge : βˆ€ B : ℝ, βˆƒ d : ℝ, 1 / 2 < d ∧ d < 1 ∧ βˆ€ x ∈ T.carrier, d < (A.inverse x).2 β†’ B < D0.scalarCurvature x) {B : ℝ} (hB : 0 < B) (hdiam : intrinsicDiameter g (U : Set M) ≀ ENNReal.ofReal B) (hsmall : T.epsilon ≀ neckShorteningEpsilon) (hfinite : βˆ€ p q : U, intrinsicEDist g (U : Set M) (p : M) (q : M) β‰  ⊀) (DU : LeviCivitaData (intrinsicOpenMetric g U)) (hsec : DU.NonnegativeSectionalCurvature) : Nonempty (SelectedEndChordData T A U hfinite) := by classical let := intrinsicOpenMetricSpace g U hfinite have hpreconnected : IsPreconnected (U : Set M) := by rw [hU] exact A.isPreconnected_tail true (by norm_num) (by norm_num) let : PreconnectedSpace U := Subtype.preconnectedSpace hpreconnected obtain ⟨E, houtside, hcontinuous, hpositive, _htriangle, htail, _hsequences, i, _hi, f, b, _hbhalf, hb1, hf, hzero, hNU, hhigh, hsegments, hrays⟩ := exists_selected_cylinder_metric_rays T A U hU hA D0 hR hratio hdiverge hB hdiam hsmall hfinite obtain ⟨alpha, halpha, _hminimum, _hsphere, _hcross, _hnonpositive, hbarrier⟩ := exists_selected_sphere_radius_barrier T A U hU i f hf hzero hNU (b := b) hb1 hhigh hfinite E houtside htail obtain ⟨m, hm⟩ := exists_compact_selected_end_chord_link T A U hU hA D0.scalarCurvature hR hratio hdiverge f hfinite DU hsec E alpha houtside halpha htail hbarrier hsegments let := m obtain ⟨_htotally, hcompact, hdiameter, hjoint, hequal, hscaled, hupper, hgerm⟩ := hm have hsourceTriangle := metricEndRay_chordConeTriangle hscaled have hcompleted := chordConeTriangle_completion hsourceTriangle exact ⟨{ endPoint := E endPoint_missing := houtside alpha := alpha alpha_pos := halpha wall := f radius_continuous := hcontinuous radius_pos := hpositive tail_radius := htail radius_barrier := hbarrier segments := hsegments inward_rays := hrays chordMetric := m chord_compact := hcompact chord_le_two := hdiameter joint_chord_limit := hjoint equal_radius_limit := hequal scaled_distance_limit := hscaled strict_chord_bound := hupper endpoint_distance_bound := fun P Q s hs t ht => P.dist_le_chordConeDistance Q (hupper P Q) s hs t ht zero_iff_sameEndGerm := hgerm completed_triangle := hcompleted }⟩ end PoincareMT.M28