File: Mathlib/Topology/MetricSpace/Gluing.lean

full_name: Metric.glueDist
code: /-- Define a predistance on `X ⊕ Y`, for which `Φ p` and `Ψ p` are at distance `ε` -/
def glueDist (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : X ⊕ Y → X ⊕ Y → ℝ
  
goal: X ⊕ Y → X ⊕ Y → ℝ

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.glueDist_self
code: private theorem glueDist_self (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : ∀ x, glueDist Φ Ψ ε x x = 0
  
goal: Metric.glueDist Φ Ψ ε x x = 0

full_name: Metric.glueDist_glued_points
code: theorem glueDist_glued_points [Nonempty Z] (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (p : Z) :
    glueDist Φ Ψ ε (.inl (Φ p)) (.inr (Ψ p)) = ε 
goal: Metric.glueDist Φ Ψ ε (Sum.inl (Φ p)) (Sum.inr (Ψ p)) = ε

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.glueDist_comm
code: private theorem glueDist_comm (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) :
    ∀ x y, glueDist Φ Ψ ε x y = glueDist Φ Ψ ε y x
  
goal: Metric.glueDist Φ Ψ ε x y = Metric.glueDist Φ Ψ ε y x

full_name: Metric.glueDist_swap
code: theorem glueDist_swap (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) :
    ∀ x y, glueDist Ψ Φ ε x.swap y.swap = glueDist Φ Ψ ε x y
  
goal: Metric.glueDist Ψ Φ ε x.swap y.swap = Metric.glueDist Φ Ψ ε x y

full_name: Metric.le_glueDist_inl_inr
code: theorem le_glueDist_inl_inr (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x y) :
    ε ≤ glueDist Φ Ψ ε (.inl x) (.inr y) 
goal: ε ≤ Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inr y)

full_name: Metric.le_glueDist_inr_inl
code: theorem le_glueDist_inr_inl (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x y) :
    ε ≤ glueDist Φ Ψ ε (.inr x) (.inl y) 
goal: ε ≤ Metric.glueDist Φ Ψ ε (Sum.inr x) (Sum.inl y)

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.glueDist_triangle_inl_inr_inr
code: private theorem glueDist_triangle_inl_inr_inr (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x : X) (y z : Y) :
    glueDist Φ Ψ ε (.inl x) (.inr z) ≤
      glueDist Φ Ψ ε (.inl x) (.inr y) + glueDist Φ Ψ ε (.inr y) (.inr z) 
goal: Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inr z) ≤
  Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inr y) + Metric.glueDist Φ Ψ ε (Sum.inr y) (Sum.inr z)

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.glueDist_triangle_inl_inr_inl
code: private theorem glueDist_triangle_inl_inr_inl (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
    (H : ∀ p q, |dist (Φ p) (Φ q) - dist (Ψ p) (Ψ q)| ≤ 2 * ε) (x : X) (y : Y) (z : X) :
    glueDist Φ Ψ ε (.inl x) (.inl z) ≤
      glueDist Φ Ψ ε (.inl x) (.inr y) + glueDist Φ Ψ ε (.inr y) (.inl z) 
goal: Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inl z) ≤
  Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inr y) + Metric.glueDist Φ Ψ ε (Sum.inr y) (Sum.inl z)

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.glueDist_triangle
code: private theorem glueDist_triangle (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ)
    (H : ∀ p q, |dist (Φ p) (Φ q) - dist (Ψ p) (Ψ q)| ≤ 2 * ε) :
    ∀ x y z, glueDist Φ Ψ ε x z ≤ glueDist Φ Ψ ε x y + glueDist Φ Ψ ε y z
  
goal: Metric.glueDist Φ Ψ ε x z ≤ Metric.glueDist Φ Ψ ε x y + Metric.glueDist Φ Ψ ε y z

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.eq_of_glueDist_eq_zero
code: private theorem eq_of_glueDist_eq_zero (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε) :
    ∀ p q : X ⊕ Y, glueDist Φ Ψ ε p q = 0 → p = q
  
goal: Metric.glueDist Φ Ψ ε p q = 0 → p = q

full_name: Metric.Sum.mem_uniformity_iff_glueDist
code: theorem Sum.mem_uniformity_iff_glueDist (hε : 0 < ε) (s : Set ((X ⊕ Y) × (X ⊕ Y))) :
    s ∈ 𝓤 (X ⊕ Y) ↔ ∃ δ > 0, ∀ a b, glueDist Φ Ψ ε a b < δ → (a, b) ∈ s 
goal: s ∈ 𝓤 (X ⊕ Y) ↔ ∃ δ > 0, ∀ (a b : X ⊕ Y), Metric.glueDist Φ Ψ ε a b < δ → (a, b) ∈ s

full_name: Metric.glueMetricApprox
code: /-- Given two maps `Φ` and `Ψ` intro metric spaces `X` and `Y` such that the distances between
`Φ p` and `Φ q`, and between `Ψ p` and `Ψ q`, coincide up to `2 ε` where `ε > 0`, one can almost
glue the two spaces `X` and `Y` along the images of `Φ` and `Ψ`, so that `Φ p` and `Ψ p` are
at distance `ε`. -/
def glueMetricApprox (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (ε0 : 0 < ε)
    (H : ∀ p q, |dist (Φ p) (Φ q) - dist (Ψ p) (Ψ q)| ≤ 2 * ε) : MetricSpace (X ⊕ Y) 
goal: MetricSpace (X ⊕ Y)

full_name: Metric.Sum.dist
code: /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
with each factor.
If the two spaces are bounded, one can say for instance that each point in the first is at distance
`diam X + diam Y + 1` of each point in the second.
Instead, we choose a construction that works for unbounded spaces, but requires basepoints,
chosen arbitrarily.
We embed isometrically each factor, set the basepoints at distance 1,
arbitrarily, and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
their respective basepoints, plus the distance 1 between the basepoints.
Since there is an arbitrary choice in this construction, it is not an instance by default. -/
protected def Sum.dist : X ⊕ Y → X ⊕ Y → ℝ
  
goal: X ⊕ Y → X ⊕ Y → ℝ

full_name: Metric.Sum.dist_eq_glueDist
code: theorem Sum.dist_eq_glueDist {p q : X ⊕ Y} (x : X) (y : Y) :
    Sum.dist p q =
      glueDist (fun _ : Unit => Nonempty.some ⟨x⟩) (fun _ : Unit => Nonempty.some ⟨y⟩) 1 p q 
goal: Metric.Sum.dist p q = Metric.glueDist (fun x_1 => ⋯.some) (fun x => ⋯.some) 1 p q

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.Sum.dist_comm
code: private theorem Sum.dist_comm (x y : X ⊕ Y) : Sum.dist x y = Sum.dist y x 
goal: Metric.Sum.dist x y = Metric.Sum.dist y x

full_name: Metric.Sum.one_le_dist_inl_inr
code: theorem Sum.one_le_dist_inl_inr {x : X} {y : Y} : 1 ≤ Sum.dist (.inl x) (.inr y) 
goal: 1 ≤ Metric.Sum.dist (Sum.inl x) (Sum.inr y)

full_name: Metric.Sum.one_le_dist_inr_inl
code: theorem Sum.one_le_dist_inr_inl {x : X} {y : Y} : 1 ≤ Sum.dist (.inr y) (.inl x) 
goal: 1 ≤ Metric.Sum.dist (Sum.inr y) (Sum.inl x)

full_name: _private.Mathlib.Topology.MetricSpace.Gluing.0.Metric.Sum.mem_uniformity
code: private theorem Sum.mem_uniformity (s : Set ((X ⊕ Y) × (X ⊕ Y))) :
    s ∈ 𝓤 (X ⊕ Y) ↔ ∃ ε > 0, ∀ a b, Sum.dist a b < ε → (a, b) ∈ s 
goal: s ∈ 𝓤 (X ⊕ Y) ↔ ∃ ε > 0, ∀ (a b : X ⊕ Y), Metric.Sum.dist a b < ε → (a, b) ∈ s

full_name: Metric.metricSpaceSum
code: /-- The distance on the disjoint union indeed defines a metric space. All the distance properties
follow from our choice of the distance. The harder work is to show that the uniform structure
defined by the distance coincides with the disjoint union uniform structure. -/
def metricSpaceSum : MetricSpace (X ⊕ Y) 
goal: MetricSpace (X ⊕ Y)

full_name: Metric.Sum.dist_eq
code: theorem Sum.dist_eq {x y : X ⊕ Y} : dist x y = Sum.dist x y 
goal: dist x y = Metric.Sum.dist x y

full_name: Metric.isometry_inl
code: /-- The left injection of a space in a disjoint union is an isometry -/
theorem isometry_inl : Isometry (Sum.inl : X → X ⊕ Y) 
goal: Isometry Sum.inl

full_name: Metric.isometry_inr
code: /-- The right injection of a space in a disjoint union is an isometry -/
theorem isometry_inr : Isometry (Sum.inr : Y → X ⊕ Y) 
goal: Isometry Sum.inr

full_name: Metric.Sigma.dist
code: /-- Distance on a disjoint union. There are many (noncanonical) ways to put a distance compatible
with each factor.
We choose a construction that works for unbounded spaces, but requires basepoints,
chosen arbitrarily.
We embed isometrically each factor, set the basepoints at distance 1, arbitrarily,
and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
their respective basepoints, plus the distance 1 between the basepoints.
Since there is an arbitrary choice in this construction, it is not an instance by default. -/
protected def dist : (Σ i, E i) → (Σ i, E i) → ℝ
  
goal: (i : ι) × E i → (i : ι) × E i → ℝ

full_name: Metric.Sigma.instDist
code: /-- A `Dist` instance on the disjoint union `Σ i, E i`.
We embed isometrically each factor, set the basepoints at distance 1, arbitrarily,
and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
their respective basepoints, plus the distance 1 between the basepoints.
Since there is an arbitrary choice in this construction, it is not an instance by default. -/
def instDist : Dist (Σi, E i) 
goal: Dist ((i : ι) × E i)

full_name: Metric.Sigma.dist_same
code: @[simp]
theorem dist_same (i : ι) (x y : E i) : dist (Sigma.mk i x) ⟨i, y⟩ = dist x y 
goal: dist ⟨i, x⟩ ⟨i, y⟩ = dist x y

full_name: Metric.Sigma.dist_ne
code: @[simp]
theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
    dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y 
goal: dist ⟨i, x⟩ ⟨j, y⟩ = dist x ⋯.some + 1 + dist ⋯.some y

full_name: Metric.Sigma.one_le_dist_of_ne
code: theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
    1 ≤ dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ 
goal: 1 ≤ dist ⟨i, x⟩ ⟨j, y⟩

full_name: Metric.Sigma.fst_eq_of_dist_lt_one
code: theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1 
goal: x.fst = y.fst

full_name: Metric.Sigma.dist_triangle
code: protected theorem dist_triangle (x y z : Σi, E i) : dist x z ≤ dist x y + dist y z 
goal: dist x z ≤ dist x y + dist y z

full_name: Metric.Sigma.isOpen_iff
code: protected theorem isOpen_iff (s : Set (Σi, E i)) :
    IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s 
goal: IsOpen s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ (y : (i : ι) × E i), dist x y < ε → y ∈ s

full_name: Metric.Sigma.metricSpace
code: /-- A metric space structure on the disjoint union `Σ i, E i`.
We embed isometrically each factor, set the basepoints at distance 1, arbitrarily,
and say that the distance from `a` to `b` is the sum of the distances of `a` and `b` to
their respective basepoints, plus the distance 1 between the basepoints.
Since there is an arbitrary choice in this construction, it is not an instance by default. -/
protected def metricSpace : MetricSpace (Σi, E i) 
goal: MetricSpace ((i : ι) × E i)

full_name: Metric.Sigma.isometry_mk
code: /-- The injection of a space in a disjoint union is an isometry -/
theorem isometry_mk (i : ι) : Isometry (Sigma.mk i : E i → Σk, E k) 
goal: Isometry (Sigma.mk i)

full_name: Metric.Sigma.completeSpace
code: /-- A disjoint union of complete metric spaces is complete. -/
protected theorem completeSpace [∀ i, CompleteSpace (E i)] : CompleteSpace (Σi, E i) 
goal: CompleteSpace ((i : ι) × E i)

full_name: Metric.gluePremetric
code: /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a pseudo metric space
structure on `X ⊕ Y` by declaring that `Φ x` and `Ψ x` are at distance `0`. -/
def gluePremetric (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : PseudoMetricSpace (X ⊕ Y) 
goal: PseudoMetricSpace (X ⊕ Y)

full_name: Metric.GlueSpace
code: /-- Given two isometric embeddings `Φ : Z → X` and `Ψ : Z → Y`, we define a
space `GlueSpace hΦ hΨ` by identifying in `X ⊕ Y` the points `Φ x` and `Ψ x`. -/
def GlueSpace (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Type _ 
goal: Type (max u v)

full_name: Metric.instMetricSpaceGlueSpace
code: instance (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : MetricSpace (GlueSpace hΦ hΨ) 
goal: MetricSpace (Metric.GlueSpace hΦ hΨ)

full_name: Metric.toGlueL
code: /-- The canonical map from `X` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
def toGlueL (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (x : X) : GlueSpace hΦ hΨ 
goal: Metric.GlueSpace hΦ hΨ

full_name: Metric.toGlueR
code: /-- The canonical map from `Y` to the space obtained by gluing isometric subsets in `X` and `Y`. -/
def toGlueR (hΦ : Isometry Φ) (hΨ : Isometry Ψ) (y : Y) : GlueSpace hΦ hΨ 
goal: Metric.GlueSpace hΦ hΨ

full_name: Metric.inhabitedLeft
code: instance inhabitedLeft (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited X] :
    Inhabited (GlueSpace hΦ hΨ) 
goal: Inhabited (Metric.GlueSpace hΦ hΨ)

full_name: Metric.inhabitedRight
code: instance inhabitedRight (hΦ : Isometry Φ) (hΨ : Isometry Ψ) [Inhabited Y] :
    Inhabited (GlueSpace hΦ hΨ) 
goal: Inhabited (Metric.GlueSpace hΦ hΨ)

full_name: Metric.toGlue_commute
code: theorem toGlue_commute (hΦ : Isometry Φ) (hΨ : Isometry Ψ) :
    toGlueL hΦ hΨ ∘ Φ = toGlueR hΦ hΨ ∘ Ψ 
goal: Metric.toGlueL hΦ hΨ ∘ Φ = Metric.toGlueR hΦ hΨ ∘ Ψ

full_name: Metric.toGlueL_isometry
code: theorem toGlueL_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueL hΦ hΨ) 
goal: Isometry (Metric.toGlueL hΦ hΨ)

full_name: Metric.toGlueR_isometry
code: theorem toGlueR_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueR hΦ hΨ) 
goal: Isometry (Metric.toGlueR hΦ hΨ)

full_name: Metric.inductiveLimitDist
code: /-- Predistance on the disjoint union `Σ n, X n`. -/
def inductiveLimitDist (f : ∀ n, X n → X (n + 1)) (x y : Σn, X n) : ℝ 
goal: ℝ

full_name: Metric.inductiveLimitDist_eq_dist
code: /-- The predistance on the disjoint union `Σ n, X n` can be computed in any `X k` for large
enough `k`. -/
theorem inductiveLimitDist_eq_dist (I : ∀ n, Isometry (f n)) (x y : Σn, X n) :
    ∀ m (hx : x.1 ≤ m) (hy : y.1 ≤ m), inductiveLimitDist f x y =
      dist (leRecOn hx (f _) x.2 : X m) (leRecOn hy (f _) y.2 : X m)
  
goal: Metric.inductiveLimitDist f x y = dist (Nat.leRecOn hx (fun {k} => f k) x.snd) (Nat.leRecOn hy (fun {k} => f k) y.snd)

full_name: Metric.inductivePremetric
code: /-- Premetric space structure on `Σ n, X n`. -/
def inductivePremetric (I : ∀ n, Isometry (f n)) : PseudoMetricSpace (Σn, X n) 
goal: PseudoMetricSpace ((n : ℕ) × X n)

full_name: Metric.InductiveLimit
code: /-- The type giving the inductive limit in a metric space context. -/
def InductiveLimit (I : ∀ n, Isometry (f n)) : Type _ 
goal: Type u

full_name: Metric.instMetricSpaceInductiveLimit
code: instance : MetricSpace (InductiveLimit (f := f) I) 
goal: MetricSpace (Metric.InductiveLimit I)

full_name: Metric.toInductiveLimit
code: /-- Mapping each `X n` to the inductive limit. -/
def toInductiveLimit (I : ∀ n, Isometry (f n)) (n : ℕ) (x : X n) : Metric.InductiveLimit I 
goal: Metric.InductiveLimit I

full_name: Metric.instInhabitedInductiveLimitOfOfNatNat
code: instance (I : ∀ n, Isometry (f n)) [Inhabited (X 0)] : Inhabited (InductiveLimit I) 
goal: Inhabited (Metric.InductiveLimit I)

full_name: Metric.toInductiveLimit_isometry
code: /-- The map `toInductiveLimit n` mapping `X n` to the inductive limit is an isometry. -/
theorem toInductiveLimit_isometry (I : ∀ n, Isometry (f n)) (n : ℕ) :
    Isometry (toInductiveLimit I n) 
goal: Isometry (Metric.toInductiveLimit I n)

full_name: Metric.toInductiveLimit_commute
code: /-- The maps `toInductiveLimit n` are compatible with the maps `f n`. -/
theorem toInductiveLimit_commute (I : ∀ n, Isometry (f n)) (n : ℕ) :
    toInductiveLimit I n.succ ∘ f n = toInductiveLimit I n 
goal: Metric.toInductiveLimit I n.succ ∘ f n = Metric.toInductiveLimit I n