Lean library · module TopologyByExample.Spaces.Earring

The Hawaiian earring

Source file

For n : ℕ let Cₙ be the circle in the plane with centre (1 / (n + 1), 0) and radius 1 / (n + 1). All of them pass through the origin. The Hawaiian earring is their union, with the subspace topology of the plane.

Writing a point of Cₙ as (x, ±√(2 r x - x²)) with r = 1 / (n + 1) and 0 ≤ x ≤ 2 r shows that the earring is the image of a compact set, hence compact, and that each point is joined to the origin along a half of its circle on which x only decreases. So the earring is path connected, and the sets of its points with x < δ form a base of path connected neighbourhoods of the origin. Away from the origin, the inversion q ↦ q / ‖q‖² (for the Euclidean norm) carries Cₙ minus the origin onto the vertical line x = (n + 1) / 2, and these lines are at distance at least 1 / 2 from one another; so near any other point the earring is an arc. Hence the earring is locally path connected.

Main definitions

Main statements

Tags

Hawaiian earring, shrinking wedge of circles, locally path connected

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

definition radius

TopologyByExample.Earring.radius

The radius 1 / (n + 1) of the n-th circle.

noncomputable def radius (n : ℕ) : ℝ
:= 1 / ((n : ℝ) + 1)

theorem radius_pos

TopologyByExample.Earring.radius_pos

The radii are positive.

theorem radius_pos (n : ℕ) : 0 < radius n
Proof
:= by unfold radius; positivity

theorem radius_le_one

TopologyByExample.Earring.radius_le_one

The radii are at most 1.

theorem radius_le_one (n : ℕ) : radius n ≤ 1
Proof
:=
  (div_le_one (by positivity)).2 (by linarith [n.cast_nonneg' (α := ℝ)])

theorem radius_mem_teeth

TopologyByExample.Earring.radius_mem_teeth

The radius lies in the set {0} ∪ {1 / (n + 1)} of abscissae of the teeth of the comb.

theorem radius_mem_teeth (n : ℕ) : radius n ∈ CombSpace.teeth
Proof
:= CombSpace.one_div_succ_mem_teeth n

definition circle

TopologyByExample.Earring.circle

The n-th circle: centre (radius n, 0) and radius radius n.

def circle (n : ℕ) : Set (ℝ × ℝ)
:= {p | (p.1 - radius n) ^ 2 + p.2 ^ 2 = radius n ^ 2}

definition earring

TopologyByExample.Earring.earring

The Hawaiian earring: the union of the circles.

def earring : Set (ℝ × ℝ)
:= ⋃ n, circle n

theorem mem_circle_iff

TopologyByExample.Earring.mem_circle_iff

A point lies on the n-th circle if and only if x² + y² = 2 r x.

theorem mem_circle_iff {n : ℕ} {p : ℝ × ℝ} :
    p ∈ circle n ↔ p.1 ^ 2 + p.2 ^ 2 = 2 * radius n * p.1
Proof
:= by
  simp only [circle, mem_ofPred_eq]
  constructor <;> intro h <;> linarith

theorem zero_mem_circle

TopologyByExample.Earring.zero_mem_circle

The origin lies on every circle.

theorem zero_mem_circle (n : ℕ) : ((0 : ℝ), (0 : ℝ)) ∈ circle n
Proof
:= by
  simp [circle]

theorem zero_mem_earring

TopologyByExample.Earring.zero_mem_earring

The origin lies on the earring.

theorem zero_mem_earring : ((0 : ℝ), (0 : ℝ)) ∈ earring
Proof
:= mem_iUnion.2 ⟨0, zero_mem_circle 0⟩

theorem fst_mem_Icc

TopologyByExample.Earring.fst_mem_Icc

The abscissa of a point of the n-th circle lies in [0, 2 r].

theorem fst_mem_Icc {n : ℕ} {p : ℝ × ℝ} (hp : p ∈ circle n) : p.1 ∈ Icc 0 (2 * radius n)
Proof
:= by
  rw [mem_circle_iff] at hp
  have hr := radius_pos n
  constructor <;> nlinarith [sq_nonneg p.2, sq_nonneg p.1]

definition arc

TopologyByExample.Earring.arc

The point of abscissa x on the upper (σ = 1) or lower (σ = -1) half of the circle of radius s through the origin centred on the horizontal axis.

noncomputable def arc (s σ x : ℝ) : ℝ × ℝ
:= (x, σ * √(2 * s * x - x ^ 2))

theorem continuous_arc

TopologyByExample.Earring.continuous_arc

The half-circle map is continuous in x.

theorem continuous_arc (s σ : ℝ) : Continuous (arc s σ)
Proof
:= by
  unfold arc
  fun_prop

theorem continuous_arc_uncurry

TopologyByExample.Earring.continuous_arc_uncurry

The half-circle map is jointly continuous in the radius and the abscissa.

theorem continuous_arc_uncurry (σ : ℝ) : Continuous fun q : ℝ × ℝ ↦ arc q.2 σ q.1
Proof
:= by
  unfold arc
  fun_prop

theorem arc_zero

TopologyByExample.Earring.arc_zero

At abscissa 0 both half-circles are at the origin.

theorem arc_zero (s σ : ℝ) : arc s σ 0 = (0, 0)
Proof
:= by simp [arc]

theorem arc_mem_circle

TopologyByExample.Earring.arc_mem_circle

For x ∈ [0, 2 r] and σ = ±1, the point arc r σ x lies on the circle of radius r.

theorem arc_mem_circle {n : ℕ} {σ x : ℝ} (hσ : σ = 1 ∨ σ = -1) (hx : x ∈ Icc 0 (2 * radius n)) :
    arc (radius n) σ x ∈ circle n
Proof
:= by
  have h0 : 0 ≤ 2 * radius n * x - x ^ 2 := by nlinarith [hx.1, hx.2]
  have hσ2 : σ ^ 2 = 1 := by rcases hσ with rfl | rfl <;> norm_num
  simp only [circle, arc, mem_ofPred_eq, mul_pow, Real.sq_sqrt h0, hσ2]
  ring

theorem exists_arc

TopologyByExample.Earring.exists_arc

Every point of the n-th circle lies on its upper or lower half.

theorem exists_arc {n : ℕ} {p : ℝ × ℝ} (hp : p ∈ circle n) :
    ∃ σ : ℝ, (σ = 1 ∨ σ = -1) ∧ p = arc (radius n) σ p.1
Proof
:= by
  have h : 2 * radius n * p.1 - p.1 ^ 2 = p.2 ^ 2 := by rw [mem_circle_iff] at hp; linarith
  rcases le_total 0 p.2 with h2 | h2
  · refine ⟨1, Or.inl rfl, Prod.ext rfl ?_⟩
    simp [arc, h, Real.sqrt_sq h2]
  · refine ⟨-1, Or.inr rfl, Prod.ext rfl ?_⟩
    simp [arc, h, Real.sqrt_sq_eq_abs, abs_of_nonpos h2]

theorem joinedIn_zero

TopologyByExample.Earring.joinedIn_zero

A point of the n-th circle is joined to the origin, inside the part of the earring to the left of any line x = δ that the point lies to the left of, along a half of its circle.

theorem joinedIn_zero {n : ℕ} {p : ℝ × ℝ} (hp : p ∈ circle n) {δ : ℝ} (hδ : p.1 < δ) :
    JoinedIn (earring ∩ {q | q.1 < δ}) p (0, 0)
Proof
:= by
  obtain ⟨σ, hσ, hpσ⟩ := exists_arc hp
  have hx := fst_mem_Icc hp
  have hA : IsPathConnected (arc (radius n) σ '' Icc 0 p.1) :=
    ((convex_Icc 0 p.1).isPathConnected (nonempty_Icc.2 hx.1)).image (continuous_arc _ _)
  refine (hA.joinedIn p ⟨p.1, ⟨hx.1, le_rfl⟩, hpσ.symm⟩ _ ⟨0, ⟨le_rfl, hx.1⟩, arc_zero _ _⟩).mono ?_
  rintro _ ⟨x, hx', rfl⟩
  exact ⟨mem_iUnion.2 ⟨n, arc_mem_circle hσ ⟨hx'.1, hx'.2.trans hx.2⟩⟩, hx'.2.trans_lt hδ⟩

theorem isPathConnected_inter_lt

TopologyByExample.Earring.isPathConnected_inter_lt

The part of the earring to the left of the line x = δ, for δ > 0, is path connected.

theorem isPathConnected_inter_lt {δ : ℝ} (hδ : 0 < δ) :
    IsPathConnected (earring ∩ {q | q.1 < δ})
Proof
:= by
  have key : ∀ p ∈ earring ∩ {q | q.1 < δ}, JoinedIn (earring ∩ {q | q.1 < δ}) p (0, 0) := by
    rintro p ⟨hp, hpδ⟩
    obtain ⟨n, hn⟩ := mem_iUnion.1 hp
    exact joinedIn_zero hn hpδ
  exact isPathConnected_iff.2 ⟨⟨_, zero_mem_earring, hδ⟩,
    fun x hx y hy ↦ (key x hx).trans (key y hy).symm⟩

theorem isPathConnected_earring

TopologyByExample.Earring.isPathConnected_earring

The earring is path connected: every point is joined to the origin along half of its circle.

theorem isPathConnected_earring : IsPathConnected earring
Proof
:= by
  have key : ∀ p ∈ earring, JoinedIn earring p (0, 0) := by
    intro p hp
    obtain ⟨n, hn⟩ := mem_iUnion.1 hp
    exact (joinedIn_zero hn (lt_add_one p.1)).mono inter_subset_left
  exact isPathConnected_iff.2 ⟨⟨_, zero_mem_earring⟩,
    fun x hx y hy ↦ (key x hx).trans (key y hy).symm⟩

definition params

TopologyByExample.Earring.params

The set of pairs (x, s) with s a radius or 0 and 0 ≤ x ≤ 2 s.

def params : Set (ℝ × ℝ)
:= {q | q.2 ∈ CombSpace.teeth ∧ 0 ≤ q.1 ∧ q.1 ≤ 2 * q.2}

theorem isCompact_params

TopologyByExample.Earring.isCompact_params

The parameter set is compact.

theorem isCompact_params : IsCompact params
Proof
:= by
  refine ((isCompact_Icc (a := (0 : ℝ)) (b := 2)).prod CombSpace.isCompact_teeth).of_isClosed_subset
    ?_ ?_
  · exact (CombSpace.isCompact_teeth.isClosed.preimage continuous_snd).inter
      ((isClosed_le continuous_const continuous_fst).inter
        (isClosed_le continuous_fst (continuous_const.mul continuous_snd)))
  · rintro q ⟨hq2, hq0, hq1⟩
    have := CombSpace.teeth_subset_Icc hq2
    exact ⟨⟨hq0, by linarith [this.2]⟩, hq2⟩

theorem earring_eq

TopologyByExample.Earring.earring_eq

The earring is the union of the images of the parameter set under the two half-circle maps.

theorem earring_eq : earring = (fun q : ℝ × ℝ ↦ arc q.2 1 q.1) '' params ∪
    (fun q : ℝ × ℝ ↦ arc q.2 (-1) q.1) '' params
Proof
:= by
  apply Subset.antisymm
  · intro p hp
    obtain ⟨n, hn⟩ := mem_iUnion.1 hp
    obtain ⟨σ, hσ, hpσ⟩ := exists_arc hn
    have hq : (p.1, radius n) ∈ params :=
      ⟨radius_mem_teeth n, (fst_mem_Icc hn).1, (fst_mem_Icc hn).2⟩
    rcases hσ with rfl | rfl
    · exact Or.inl ⟨_, hq, hpσ.symm⟩
    · exact Or.inr ⟨_, hq, hpσ.symm⟩
  · have h : ∀ σ : ℝ, (σ = 1 ∨ σ = -1) → ∀ q ∈ params, arc q.2 σ q.1 ∈ earring := by
      rintro σ hσ ⟨x, s⟩ ⟨hs, hx0, hx1⟩
      rcases hs with rfl | ⟨n, rfl⟩
      · have hx : x = 0 := le_antisymm (by simpa using hx1) hx0
        subst hx
        rw [arc_zero]
        exact zero_mem_earring
      · exact mem_iUnion.2 ⟨n, arc_mem_circle hσ ⟨hx0, hx1⟩⟩
    rintro _ (⟨q, hq, rfl⟩ | ⟨q, hq, rfl⟩)
    · exact h 1 (Or.inl rfl) q hq
    · exact h (-1) (Or.inr rfl) q hq

theorem isCompact_earring

TopologyByExample.Earring.isCompact_earring

The earring is a compact subset of the plane.

theorem isCompact_earring : IsCompact earring
Proof
:=
  earring_eq ▸ (isCompact_params.image (continuous_arc_uncurry 1)).union
    (isCompact_params.image (continuous_arc_uncurry (-1)))

theorem dist_zero_lt

TopologyByExample.Earring.dist_zero_lt

A point of the earring to the left of x = δ, where δ ≤ ε and 2 δ ≤ ε², lies within distance ε of the origin.

theorem dist_zero_lt {p : ℝ × ℝ} (hp : p ∈ earring) {δ ε : ℝ} (hε : 0 < ε) (hδε : δ ≤ ε)
    (hδε' : 2 * δ ≤ ε ^ 2) (hpδ : p.1 < δ) : dist p (0, 0) < ε
Proof
:= by
  obtain ⟨n, hn⟩ := mem_iUnion.1 hp
  have hx := fst_mem_Icc hn
  have hc := mem_circle_iff.1 hn
  have hr := radius_le_one n
  have hr0 := radius_pos n
  have hy : p.2 ^ 2 < ε ^ 2 := by nlinarith [sq_nonneg p.1]
  rw [Prod.dist_eq, Real.dist_eq, Real.dist_eq, sub_zero, sub_zero]
  exact max_lt (by rw [abs_of_nonneg hx.1]; linarith) (abs_lt_of_sq_lt_sq hy hε.le)

theorem eventually_circle_subset

TopologyByExample.Earring.eventually_circle_subset

The circles converge to the origin: every neighbourhood of the origin in the plane contains all but finitely many of them.

theorem eventually_circle_subset {u : Set (ℝ × ℝ)} (hu : u ∈ 𝓝 ((0 : ℝ), (0 : ℝ))) :
    ∀ᶠ n in atTop, circle n ⊆ u
Proof
:= by
  obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.1 hu
  obtain ⟨N, hN⟩ := exists_nat_one_div_lt (half_pos hε)
  refine eventually_atTop.2 ⟨N, fun n hn p hp ↦ hball ?_⟩
  have hrN : radius n ≤ 1 / ((N : ℝ) + 1) :=
    one_div_le_one_div_of_le (by positivity) (by exact_mod_cast Nat.add_le_add_right hn 1)
  have hx := fst_mem_Icc hp
  have hr0 := radius_pos n
  have hr : radius n < ε / 2 := by linarith
  have hy2 : p.2 ^ 2 ≤ radius n ^ 2 := by
    have := hp
    simp only [circle, mem_ofPred_eq] at this
    nlinarith [sq_nonneg (p.1 - radius n)]
  have hy : p.2 ^ 2 < ε ^ 2 := by nlinarith
  rw [mem_ball, Prod.dist_eq, Real.dist_eq, Real.dist_eq, sub_zero, sub_zero]
  exact max_lt (by rw [abs_of_nonneg hx.1]; linarith [hx.2]) (abs_lt_of_sq_lt_sq hy hε.le)

On this site: Hawaiian earring: The circles converge to the origin

definition inversion

TopologyByExample.Earring.inversion

Inversion in the unit circle, q ↦ q / ‖q‖² for the Euclidean norm (and 0 ↦ 0).

noncomputable def inversion (q : ℝ × ℝ) : ℝ × ℝ
:=
  (q.1 / (q.1 ^ 2 + q.2 ^ 2), q.2 / (q.1 ^ 2 + q.2 ^ 2))

theorem normSq_ne_zero

TopologyByExample.Earring.normSq_ne_zero

A nonzero point has nonzero squared Euclidean norm.

theorem normSq_ne_zero {q : ℝ × ℝ} (hq : q ≠ (0, 0)) : q.1 ^ 2 + q.2 ^ 2 ≠ 0
Proof
:= by
  intro h
  have h1 : q.1 = 0 := by nlinarith [sq_nonneg q.1, sq_nonneg q.2]
  have h2 : q.2 = 0 := by nlinarith [sq_nonneg q.1, sq_nonneg q.2]
  exact hq (Prod.ext h1 h2)

theorem continuousAt_inversion

TopologyByExample.Earring.continuousAt_inversion

Inversion is continuous away from the origin.

theorem continuousAt_inversion {q : ℝ × ℝ} (hq : q ≠ (0, 0)) : ContinuousAt inversion q
Proof
:= by
  have h := normSq_ne_zero hq
  unfold inversion
  exact (continuous_fst.continuousAt.div (by fun_prop) h).prodMk
    (continuous_snd.continuousAt.div (by fun_prop) h)

theorem inversion_inversion

TopologyByExample.Earring.inversion_inversion

Inversion is an involution away from the origin.

theorem inversion_inversion {q : ℝ × ℝ} (hq : q ≠ (0, 0)) : inversion (inversion q) = q
Proof
:= by
  have h := normSq_ne_zero hq
  simp only [inversion]
  ext <;> field_simp

theorem inversion_fst

TopologyByExample.Earring.inversion_fst

Inversion carries a nonzero point of the n-th circle to the line x = (n + 1) / 2.

theorem inversion_fst {n : ℕ} {q : ℝ × ℝ} (hq : q ∈ circle n) (hq0 : q ≠ (0, 0)) :
    (inversion q).1 = ((n : ℝ) + 1) / 2
Proof
:= by
  have h := normSq_ne_zero hq0
  have hc := mem_circle_iff.1 hq
  have h1 : q.1 ≠ 0 := by
    intro h1
    exact h (by rw [hc, h1, mul_zero])
  simp only [inversion, hc, radius]
  field_simp

On this site: Hawaiian earring: Inversion straightens the circles

definition lineMap

TopologyByExample.Earring.lineMap

The point of the n-th circle corresponding under inversion to the point ((n + 1) / 2, y) of the line x = (n + 1) / 2.

noncomputable def lineMap (n : ℕ) (y : ℝ) : ℝ × ℝ
:= inversion (((n : ℝ) + 1) / 2, y)

theorem continuous_lineMap

TopologyByExample.Earring.continuous_lineMap

The map lineMap n is continuous.

theorem continuous_lineMap (n : ℕ) : Continuous (lineMap n)
Proof
:= by
  have h : ∀ y : ℝ, (((n : ℝ) + 1) / 2) ^ 2 + y ^ 2 ≠ 0 := fun y ↦ by positivity
  unfold lineMap inversion
  exact (continuous_const.div (by fun_prop) h).prodMk (continuous_id.div (by fun_prop) h)

theorem lineMap_mem_circle

TopologyByExample.Earring.lineMap_mem_circle

The map lineMap n takes values in the n-th circle.

theorem lineMap_mem_circle (n : ℕ) (y : ℝ) : lineMap n y ∈ circle n
Proof
:= by
  have h : (((n : ℝ) + 1) / 2) ^ 2 + y ^ 2 ≠ 0 := by positivity
  rw [mem_circle_iff]
  simp only [lineMap, inversion, radius]
  field_simp

theorem eq_lineMap

TopologyByExample.Earring.eq_lineMap

A nonzero point of the n-th circle is the image under lineMap n of the second coordinate of its inversion.

theorem eq_lineMap {n : ℕ} {q : ℝ × ℝ} (hq : q ∈ circle n) (hq0 : q ≠ (0, 0)) :
    q = lineMap n (inversion q).2
Proof
:= by
  rw [lineMap, ← inversion_fst hq hq0, ← inversion_inversion hq0]
  simp only [inversion_inversion hq0]

definition HawaiianEarring

TopologyByExample.HawaiianEarring

The Hawaiian earring: the subspace Earring.earring of the plane.

abbrev HawaiianEarring : Type
:= Earring.earring

On this site: Space: Hawaiian earring

definition origin

TopologyByExample.HawaiianEarring.origin

The origin, the common point of the circles.

def origin : HawaiianEarring
:= ⟨(0, 0), zero_mem_earring⟩

instance

The earring is nonempty.

instance : Nonempty HawaiianEarring
Proof
:= ⟨origin⟩

instance instCompactSpace

TopologyByExample.HawaiianEarring.instCompactSpace

The earring is compact.

instance instCompactSpace : CompactSpace HawaiianEarring
Proof
:=
  isCompact_iff_compactSpace.1 isCompact_earring

On this site: The Hawaiian earring is compact

theorem metrizableSpace

TopologyByExample.HawaiianEarring.metrizableSpace

The earring is metrizable.

theorem metrizableSpace : MetrizableSpace HawaiianEarring
Proof
:= inferInstance

On this site: The Hawaiian earring is metrizable

instance instPathConnectedSpace

TopologyByExample.HawaiianEarring.instPathConnectedSpace

The earring is path connected (in Mathlib's sense, which includes nonemptiness).

instance instPathConnectedSpace : PathConnectedSpace HawaiianEarring
Proof
:=
  isPathConnected_iff_pathConnectedSpace.1 isPathConnected_earring

theorem pathPreconnectedSpace

TopologyByExample.HawaiianEarring.pathPreconnectedSpace

Any two points of the earring are joined by a path.

theorem pathPreconnectedSpace : PathPreconnectedSpace HawaiianEarring
Proof
:= inferInstance

On this site: The Hawaiian earring is path connected

instance instLocallyPathConnectedSpace

TopologyByExample.HawaiianEarring.instLocallyPathConnectedSpace

The earring is locally path connected. At the origin, the points with x < δ form a path connected neighbourhood inside any given ball when δ is small. At any other point p, on the n-th circle, inversion carries the earring near p onto the line x = (n + 1) / 2 near the inverse of p, since the other lines are at distance at least 1 / 2; the images of small intervals of that line are path connected neighbourhoods of p.

instance instLocallyPathConnectedSpace : LocallyPathConnectedSpace HawaiianEarring
Proof
:= by
  refine ⟨fun x ↦ hasBasis_self.2 fun t ht ↦ ?_⟩
  obtain ⟨u, hu, hut⟩ := (mem_nhds_subtype _ _ _).1 ht
  by_cases hx : (x : ℝ × ℝ) = (0, 0)
  · rw [hx] at hu
    obtain ⟨ε, hε, hball⟩ := Metric.mem_nhds_iff.1 hu
    set δ := min ε (ε ^ 2 / 2)
    have hδ : 0 < δ := lt_min hε (by positivity)
    refine ⟨((↑) : HawaiianEarring → ℝ × ℝ) ⁻¹' (earring ∩ {q | q.1 < δ}), ?_, ?_, ?_⟩
    · refine (mem_nhds_subtype _ _ _).2 ⟨{q | q.1 < δ}, ?_, fun y hy ↦ ⟨y.property, hy⟩⟩
      exact (isOpen_lt continuous_fst continuous_const).mem_nhds (by simp [hx, hδ])
    · exact (isPathConnected_inter_lt hδ).preimage_coe inter_subset_left
    · rintro y ⟨hy, hyδ⟩
      have h2δ : 2 * δ ≤ ε ^ 2 := by
        have := min_le_right ε (ε ^ 2 / 2)
        linarith
      exact hut (hball (dist_zero_lt hy hε (min_le_left _ _) h2δ hyδ))
  · obtain ⟨n, hn⟩ := mem_iUnion.1 x.property
    set w := inversion x
    obtain ⟨η, hη, hηu⟩ := Metric.mem_nhds_iff.1
      ((continuous_lineMap n).continuousAt.preimage_mem_nhds
        (show u ∈ 𝓝 (lineMap n w.2) from (eq_lineMap hn hx) ▸ hu))
    have hS : lineMap n '' ball w.2 η ⊆ earring := by
      rintro _ ⟨y, -, rfl⟩
      exact mem_iUnion.2 ⟨n, lineMap_mem_circle n y⟩
    refine ⟨((↑) : HawaiianEarring → ℝ × ℝ) ⁻¹' (lineMap n '' ball w.2 η), ?_, ?_, ?_⟩
    · refine (mem_nhds_subtype _ _ _).2 ⟨{q | q ≠ (0, 0)} ∩ inversion ⁻¹' ball w (min η (1 / 4)),
        inter_mem (isOpen_ne.mem_nhds hx)
          ((continuousAt_inversion hx).preimage_mem_nhds
            (ball_mem_nhds _ (lt_min hη (by norm_num)))),
        ?_⟩
      rintro y ⟨hy0, hyw⟩
      obtain ⟨m, hm⟩ := mem_iUnion.1 y.property
      rw [mem_preimage, mem_ball, Prod.dist_eq] at hyw
      have h1 : dist (inversion y).1 w.1 < 1 / 4 := (le_max_left _ _).trans_lt
        (hyw.trans_le (min_le_right _ _))
      have h2 : dist (inversion y).2 w.2 < η := (le_max_right _ _).trans_lt
        (hyw.trans_le (min_le_left _ _))
      rw [inversion_fst hm hy0, show w.1 = ((n : ℝ) + 1) / 2 from inversion_fst hn hx,
        Real.dist_eq, abs_lt] at h1
      have hmn : m = n := by
        have ha : (m : ℝ) < n + 1 := by linarith
        have hb : (n : ℝ) < m + 1 := by linarith
        have ha' : m < n + 1 := by exact_mod_cast ha
        have hb' : n < m + 1 := by exact_mod_cast hb
        omega
      subst hmn
      exact ⟨_, h2, (eq_lineMap hm hy0).symm⟩
    · exact (((convex_ball w.2 η).isPathConnected (nonempty_ball.2 hη)).image
        (continuous_lineMap n)).preimage_coe hS
    · rintro y ⟨z, hz, hzy⟩
      exact hut (show (y : ℝ × ℝ) ∈ u from hzy ▸ hηu hz)

theorem not_finite

TopologyByExample.HawaiianEarring.not_finite

The earring is infinite: the points (2 / (n + 1), 0), the points of the circles farthest from the origin, are distinct.

theorem not_finite : ¬Finite HawaiianEarring
Proof
:= by
  intro h
  have hmem : ∀ n : ℕ, (2 * radius n, (0 : ℝ)) ∈ earring := fun n ↦
    mem_iUnion.2 ⟨n, by rw [mem_circle_iff]; ring⟩
  have hinj : Function.Injective fun n : ℕ ↦ (⟨_, hmem n⟩ : HawaiianEarring) := by
    intro a b hab
    have := congrArg (fun p : HawaiianEarring ↦ (p : ℝ × ℝ).1) hab
    simp only [radius] at this
    have h' : ((a : ℝ) + 1) = (b : ℝ) + 1 := by
      field_simp at this
      linarith
    exact_mod_cast add_right_cancel h'
  exact not_finite_iff_infinite.2 (Infinite.of_injective _ hinj) h

On this site: The Hawaiian earring is not finite