Lean library · module TopologyByExample.Theorems.SeparatedSets

Uniformly separated sets in metric spaces

Source file

A set s in a metric space is ε-separated if any two of its distinct points are at distance at least ε > 0. Such a set is closed and discrete; if it is infinite, it lies in no compact set; and if it is indexed injectively by the real line, it is a closed discrete set of cardinality 𝔠.

Main statements

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 : Type*} [MetricSpace X]

theorem isDiscrete_of_pairwise_le_dist

TopologyByExample.isDiscrete_of_pairwise_le_dist

A set whose distinct points are at distance at least ε > 0 from each other is discrete.

theorem isDiscrete_of_pairwise_le_dist {s : Set X} {ε : ℝ} (hε : 0 < ε)
    (hs : s.Pairwise fun x y ↦ ε ≤ dist x y) : IsDiscrete s
Proof
:= by
  rw [isDiscrete_iff_discreteTopology, discreteTopology_iff_isOpen_singleton]
  intro x
  refine Metric.isOpen_singleton_iff.2 ⟨ε, hε, fun y hy ↦ ?_⟩
  by_contra hne
  exact (hs y.property x.property (Subtype.coe_ne_coe.2 hne)).not_gt hy

theorem not_subset_isCompact_of_pairwise_le_dist

TopologyByExample.not_subset_isCompact_of_pairwise_le_dist

An infinite set whose distinct points are at distance at least ε > 0 from each other lies in no compact set.

theorem not_subset_isCompact_of_pairwise_le_dist {s K : Set X} {ε : ℝ} (hε : 0 < ε)
    (hs : s.Pairwise fun x y ↦ ε ≤ dist x y) (hinf : s.Infinite) (hK : IsCompact K) :
    ¬s ⊆ K
Proof
:= fun hsK ↦
  hinf ((hK.of_isClosed_subset (Metric.isClosed_of_pairwise_le_dist hε hs) hsK).finite
    (isDiscrete_of_pairwise_le_dist hε hs))

theorem exists_closed_discrete_continuum_le_of_pairwise_le_dist

TopologyByExample.exists_closed_discrete_continuum_le_of_pairwise_le_dist

If f : ℝ → Y is injective and its values are at distance at least ε > 0 from each other, then its range is a closed discrete set of cardinality 𝔠. (The space is in the lowest universe, where 𝔠 is the cardinality of ℝ.)

theorem exists_closed_discrete_continuum_le_of_pairwise_le_dist {Y : Type} [MetricSpace Y]
    {f : ℝ → Y} {ε : ℝ}
    (hε : 0 < ε) (hf : Function.Injective f) (hd : ∀ s t, s ≠ t → ε ≤ dist (f s) (f t)) :
    ∃ s : Set Y, IsClosed s ∧ IsDiscrete s ∧ 𝔠 ≤ #s
Proof
:= by
  have hs : (range f).Pairwise fun x y ↦ ε ≤ dist x y := by
    rintro _ ⟨s, rfl⟩ _ ⟨t, rfl⟩ hst
    exact hd s t fun h ↦ hst (h ▸ rfl)
  refine ⟨range f, Metric.isClosed_of_pairwise_le_dist hε hs,
    isDiscrete_of_pairwise_le_dist hε hs, ?_⟩
  rw [mk_range_eq f hf, mk_real]

Two families of points in the plane

theorem norm_bounds_seq

TopologyByExample.norm_bounds_seq

The points c + (c / (n + 1)) i, for c > 0, have norm between c and 2 c.

theorem norm_bounds_seq {c : ℝ} (hc : 0 < c) (n : ℕ) :
    c ≤ ‖((c : ℂ) + (c / (n + 1) : ℝ) * I)‖ ∧ ‖((c : ℂ) + (c / (n + 1) : ℝ) * I)‖ ≤ 2 * c
Proof
:= by
  have hre := Complex.abs_re_le_norm ((c : ℂ) + (c / (n + 1) : ℝ) * I)
  have hle := Complex.norm_le_abs_re_add_abs_im ((c : ℂ) + (c / (n + 1) : ℝ) * I)
  have h1 : c / (n + 1) ≤ c := div_le_self hc.le (by linarith [n.cast_nonneg (α := ℝ)])
  have h2 : 0 < c / (n + 1) := by positivity
  simp only [add_re, ofReal_re, mul_re, I_re, mul_zero, ofReal_im, I_im, mul_one, sub_self,
    add_zero, add_im, mul_im, zero_add] at hre hle
  rw [abs_of_pos hc] at hre hle
  rw [abs_of_pos h2] at hle
  exact ⟨hre, by linarith⟩

theorem injective_seq

TopologyByExample.injective_seq

The points c + (c / (n + 1)) i, for c > 0, are distinct.

theorem injective_seq {c : ℝ} (hc : 0 < c) :
    Function.Injective fun n : ℕ ↦ ((c : ℂ) + (c / (n + 1) : ℝ) * I)
Proof
:= by
  intro m n h
  have := congrArg Complex.im h
  simp only [add_im, ofReal_im, mul_im, ofReal_re, I_im, mul_one, I_re, mul_zero, add_zero,
    zero_add] at this
  rw [div_eq_div_iff (by positivity) (by positivity)] at this
  have : (m : ℝ) = n := by
    have h3 : c * ((m : ℝ) + 1 - (n + 1)) = 0 := by linarith
    rcases mul_eq_zero.1 h3 with h | h
    · exact absurd h hc.ne'
    · linarith
  exact_mod_cast this

theorem one_le_norm_one_add_mul_I

TopologyByExample.one_le_norm_one_add_mul_I

The points 1 + t i have norm at least 1.

theorem one_le_norm_one_add_mul_I (t : ℝ) : 1 ≤ ‖(1 + t * I : ℂ)‖
Proof
:= by
  have := Complex.abs_re_le_norm (1 + t * I)
  simpa using this

theorem injective_one_add_mul_I

TopologyByExample.injective_one_add_mul_I

The points 1 + t i, for real t, are distinct.

theorem injective_one_add_mul_I : Function.Injective fun t : ℝ ↦ (1 + t * I : ℂ)
Proof
:= fun s t h ↦ by
  have := congrArg Complex.im h
  simpa using this