Lean library · module TopologyByExample.Theorems.CompressedRealMetric

The bounded incomplete metric on the real line

Source file

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

Imports

definition intervalHomeomorph

TopologyByExample.CompressedRealMetric.intervalHomeomorph

The real line identified with the bounded open interval by fractional compression.

def intervalHomeomorph : ℝ ≃ₜ Ioo (-1 : ℝ) 1
:= (orderIsoIooNegOneOne ℝ).toHomeomorph

definition compress

TopologyByExample.CompressedRealMetric.compress

The compression map into the real line.

def compress (x : ℝ) : ℝ
:= (intervalHomeomorph x).val

theorem compress_eq

TopologyByExample.CompressedRealMetric.compress_eq

The precise formula of the compression map.

theorem compress_eq (x : ℝ) : compress x = x / (1 + |x|)
Proof
:= by
  unfold compress intervalHomeomorph orderIsoIooNegOneOne
  rfl

theorem isEmbedding_compress

TopologyByExample.CompressedRealMetric.isEmbedding_compress

Compression is a topological embedding.

theorem isEmbedding_compress : IsEmbedding compress
Proof
:=
  IsEmbedding.subtypeVal.comp intervalHomeomorph.isEmbedding

theorem compress_injective

TopologyByExample.CompressedRealMetric.compress_injective

Compression is injective.

theorem compress_injective : Function.Injective compress
Proof
:= isEmbedding_compress.injective

theorem range_compress

TopologyByExample.CompressedRealMetric.range_compress

The image of compression is exactly the open unit interval.

theorem range_compress : range compress = Ioo (-1 : ℝ) 1
Proof
:= by
  ext x
  constructor
  · rintro ⟨y, rfl⟩
    exact (intervalHomeomorph y).property
  · intro hx
    obtain ⟨y, hy⟩ := intervalHomeomorph.surjective ⟨x, hx⟩
    exact ⟨y, congrArg Subtype.val hy⟩

definition metric

TopologyByExample.CompressedRealMetric.metric

Pull back the ordinary distance along compression, retaining the usual real topology.

@[instance_reducible]
def metric : MetricSpace ℝ
:=
  (MetricSpace.induced compress compress_injective inferInstance).replaceTopology
    isEmbedding_compress.isInducing.eq_induced

theorem metric_dist

TopologyByExample.CompressedRealMetric.metric_dist

The metric has the exact distance formula from the bounded-real construction.

theorem metric_dist (x y : ℝ) :
    metric.dist x y = |x / (1 + |x|) - y / (1 + |y|)|
Proof
:= by
  change dist (compress x) (compress y) = _
  rw [Real.dist_eq, compress_eq, compress_eq]

theorem metric_topology

TopologyByExample.CompressedRealMetric.metric_topology

This new metric induces the usual topology on the real line.

theorem metric_topology : metric.toUniformSpace.toTopologicalSpace =
    (inferInstance : TopologicalSpace ℝ)
Proof
:= rfl

definition identityHomeomorph

TopologyByExample.CompressedRealMetric.identityHomeomorph

The identity is a homeomorphism from the compressed metric to the usual real line.

def identityHomeomorph :
    @Homeomorph ℝ ℝ metric.toUniformSpace.toTopologicalSpace inferInstance
:= Homeomorph.refl ℝ

theorem isometry_compress

TopologyByExample.CompressedRealMetric.isometry_compress

Compression is an isometry for the new metric.

theorem isometry_compress :
    @Isometry ℝ ℝ metric.toPseudoMetricSpace.toPseudoEMetricSpace
      inferInstance compress
Proof
:= by
  apply (@isometry_iff_dist_eq ℝ ℝ metric.toPseudoMetricSpace inferInstance compress).mpr
  intro x y
  rfl

theorem not_completeSpace

TopologyByExample.CompressedRealMetric.not_completeSpace

The compressed real metric is incomplete.

theorem not_completeSpace : ¬ @CompleteSpace ℝ metric.toUniformSpace
Proof
:= by
  intro h
  have hc : IsClosed (range compress) :=
    (@Isometry.isClosedEmbedding ℝ ℝ (letI := metric; inferInstance) h
      inferInstance compress isometry_compress).isClosed_range
  rw [range_compress, isClosed_Ioo_iff] at hc
  norm_num at hc

theorem metric_spec

TopologyByExample.CompressedRealMetric.metric_spec

Exact formula, topology identification, and incompleteness of the compressed metric.

theorem metric_spec :
    (∀ x y : ℝ, metric.dist x y = |x / (1 + |x|) - y / (1 + |y|)|) ∧
    metric.toUniformSpace.toTopologicalSpace = (inferInstance : TopologicalSpace ℝ) ∧
    ¬ @CompleteSpace ℝ metric.toUniformSpace
Proof
:=
  ⟨metric_dist, metric_topology, not_completeSpace⟩

On this site: Theorem: An incomplete bounded metric with the usual real topology