Lean library · module TopologyByExample.Theorems.CompletelyMetrizableUnion

Completely metrizable subspaces and unions

Source file

A completely metrizable subspace of a metrizable space is a Gδ set (one direction of Alexandrov's and Mazurkiewicz's characterisation; IsGδ.isCompletelyMetrizableSpace in Mathlib is the other, for a completely metrizable ambient space). We prove it for the range of an embedding: fix a compatible metric on the ambient space and a complete compatible metric on the subspace; the points of the closure of the range having, for every n, a neighbourhood whose trace on the range has diameter less than 1 / (n + 1) in the complete metric form a Gδ set, and it is the range, since a point of it is the limit of a Cauchy sequence of the subspace.

Consequently a metrizable space that is the union of two completely metrizable subspaces is completely metrizable: both are Gδ sets in the completion of a compatible metric, hence so is their union, the space itself.

Main statements

Tags

completely metrizable, topologically complete, Gδ set, completion

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports
variable {X Y Z : Type*} [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]

theorem isGδ_range_of_isEmbedding

TopologyByExample.isGδ_range_of_isEmbedding

The range of an embedding of a completely metrizable space into a metrizable space is a Gδ set.

theorem isGδ_range_of_isEmbedding [MetrizableSpace Y] [IsCompletelyMetrizableSpace Z] {f : Z → Y}
    (hf : IsEmbedding f) : IsGδ (range f)
Proof
:= by
  let := metrizableSpaceMetric Y
  let := upgradeIsCompletelyMetrizable Z
  -- the points with a neighbourhood whose trace on the range is small in the complete metric
  set U : ℕ → Set Y := fun n ↦ {y | ∃ V, IsOpen V ∧ y ∈ V ∧
    ∀ a b, f a ∈ V → f b ∈ V → dist a b < ((n : ℝ) + 1)⁻¹}
  have hUo : ∀ n, IsOpen (U n) := fun n ↦ isOpen_iff_forall_mem_open.2 fun y ⟨V, hVo, hyV, hV⟩ ↦
    ⟨V, fun y' hy' ↦ ⟨V, hVo, hy', hV⟩, hVo, hyV⟩
  have hG : IsGδ (closure (range f) ∩ ⋂ n, U n) :=
    isClosed_closure.isGδ.inter (.iInter_of_isOpen hUo)
  convert hG using 1
  refine Subset.antisymm (subset_inter subset_closure ?_) fun y ⟨hyc, hyU⟩ ↦ ?_
  · rintro _ ⟨z, rfl⟩
    refine mem_iInter.2 fun n ↦ ?_
    set r : ℝ := ((n : ℝ) + 1)⁻¹ / 2
    have hr : 0 < r := by positivity
    obtain ⟨V, hVo, hV⟩ := hf.isInducing.isOpen_iff.1 (isOpen_ball (x := z) (ε := r))
    have hzV : z ∈ f ⁻¹' V := by rw [hV]; exact mem_ball_self hr
    refine ⟨V, hVo, hzV, fun a b ha hb ↦ ?_⟩
    have ha' : a ∈ ball z r := by rw [← hV]; exact ha
    have hb' : b ∈ ball z r := by rw [← hV]; exact hb
    calc dist a b ≤ dist a z + dist b z := dist_triangle_right a b z
      _ < r + r := add_lt_add ha' hb'
      _ = ((n : ℝ) + 1)⁻¹ := add_halves _
  · choose V hVo hyV hV using mem_iInter.1 hyU
    set W : ℕ → Set Y := fun n ↦ (⋂ i ≤ n, V i) ∩ ball y ((n : ℝ) + 1)⁻¹
    have hW : ∀ n, (W n ∩ range f).Nonempty := fun n ↦
      mem_closure_iff.1 hyc _ (((finite_le_nat n).isOpen_biInter fun i _ ↦ hVo i).inter
        isOpen_ball) ⟨mem_iInter₂.2 fun i _ ↦ hyV i, mem_ball_self (by positivity)⟩
    choose w hwW z hz using hW
    have hzW : ∀ n, f (z n) ∈ W n := fun n ↦ (hz n).symm ▸ hwW n
    -- `f ∘ z` tends to `y`
    have hy : Tendsto (f ∘ z) atTop (𝓝 y) := by
      refine tendsto_iff_dist_tendsto_zero.2 (squeeze_zero (fun _ ↦ dist_nonneg)
        (fun n ↦ ?_) tendsto_one_div_add_atTop_nhds_zero_nat)
      simpa [one_div] using (mem_ball.1 (hzW n).2).le
    -- `z` is a Cauchy sequence in the complete metric
    have hcauchy : CauchySeq z := by
      refine Metric.cauchySeq_iff.2 fun ε hε ↦ ?_
      obtain ⟨N, hN⟩ := exists_nat_one_div_lt hε
      refine ⟨N, fun m hm n hn ↦ ?_⟩
      have hVN : ∀ k ≥ N, f (z k) ∈ V N := fun k hk ↦ mem_iInter₂.1 (hzW k).1 N hk
      exact (hV N _ _ (hVN m hm) (hVN n hn)).trans (by simpa using hN)
    obtain ⟨a, ha⟩ := cauchySeq_tendsto_of_complete hcauchy
    exact ⟨a, tendsto_nhds_unique ((hf.continuous.tendsto a).comp ha) hy⟩

On this site: Theorem: A completely metrizable subspace of a metrizable space is a \(G_\delta\) set

theorem isGδ_of_isCompletelyMetrizableSpace

TopologyByExample.isGδ_of_isCompletelyMetrizableSpace

A completely metrizable subspace of a metrizable space is a Gδ set.

theorem isGδ_of_isCompletelyMetrizableSpace [MetrizableSpace Y] {A : Set Y}
    [IsCompletelyMetrizableSpace A] : IsGδ A
Proof
:= by
  simpa using isGδ_range_of_isEmbedding (IsEmbedding.subtypeVal (p := (· ∈ A)))

theorem isCompletelyMetrizableSpace_of_union_eq_univ

TopologyByExample.isCompletelyMetrizableSpace_of_union_eq_univ

A metrizable space that is the union of two completely metrizable subspaces is completely metrizable.

theorem isCompletelyMetrizableSpace_of_union_eq_univ [MetrizableSpace X] {A B : Set X}
    [IsCompletelyMetrizableSpace A] [IsCompletelyMetrizableSpace B] (hAB : A ∪ B = univ) :
    IsCompletelyMetrizableSpace X
Proof
:= by
  let := metrizableSpaceMetric X
  have he : IsEmbedding ((↑) : X → UniformSpace.Completion X) :=
    UniformSpace.Completion.isUniformEmbedding_coe X |>.isEmbedding
  have hG : IsGδ (range ((↑) : X → UniformSpace.Completion X)) := by
    have hA := isGδ_range_of_isEmbedding (he.comp (IsEmbedding.subtypeVal (p := (· ∈ A))))
    have hB := isGδ_range_of_isEmbedding (he.comp (IsEmbedding.subtypeVal (p := (· ∈ B))))
    convert hA.union hB using 1
    rw [range_comp, range_comp, Subtype.range_coe, Subtype.range_coe, ← image_union, hAB,
      image_univ]
  have := hG.isCompletelyMetrizableSpace
  exact (Homeomorph.isCompletelyMetrizableSpace_iff he.toHomeomorph).2 this

On this site: Theorem: A metrizable space that is the union of two completely metrizable subspaces is completely metrizable