Lean library · module TopologyByExample.Spaces.RationalTangentDisc

The rational tangent disc topology

Source file

In this file we define TopologyByExample.RationalTangentDisc, the subspace of the Niemytzki plane consisting of the open upper half-plane together with the points (q, 0), q rational, of the x-axis. A point (q, 0) has the neighbourhoods {(q, 0)} ∪ D, D an open disc tangent to the x-axis at (q, 0); the other points have their Euclidean neighbourhoods.

Only countably many points have tangent discs, so the space is second countable; it is regular as a subspace of the completely regular Niemytzki plane, hence metrizable by Urysohn's metrization theorem. It is the union of the open upper half-plane, which is homeomorphic to an open subset of the plane, and of the countable discrete set of its points on the x-axis; both are completely metrizable, so the space is completely metrizable. It is σ-compact for the same reason, path connected and locally path connected (the tangent discs, with their points of tangency, are path connected subsets of the space), and no point of the x-axis has a compact neighbourhood.

Main definitions

Main statements

References

  • L. A. Steen and J. A. Seebach, Counterexamples in Topology, 2nd ed., Example 83.

Tags

rational tangent disc topology, Niemytzki plane, completely metrizable space, counterexample

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 carrier

TopologyByExample.RationalTangentDisc.carrier

The points of the Niemytzki plane that lie in the open upper half-plane or at a rational point of the x-axis.

def RationalTangentDisc.carrier : Set Niemytzki
:=
  {p | p.toPlane.2 ≠ 0 ∨ p.toPlane.1 ∈ range ((↑) : ℚ → ℝ)}

definition RationalTangentDisc

TopologyByExample.RationalTangentDisc

The rational tangent disc topology: the subspace of the Niemytzki plane consisting of the open upper half-plane and the rational points of the x-axis.

def RationalTangentDisc : Type
:= RationalTangentDisc.carrier

On this site: Space: Rational tangent disc topology

instance instTopologicalSpace

TopologyByExample.RationalTangentDisc.instTopologicalSpace

The rational tangent disc topology is the subspace topology from the Niemytzki plane.

instance instTopologicalSpace : TopologicalSpace RationalTangentDisc
Proof
:=
  inferInstanceAs (TopologicalSpace carrier)

definition val

TopologyByExample.RationalTangentDisc.val

The point of the Niemytzki plane underlying a point of the space.

def val (p : RationalTangentDisc) : Niemytzki
:= Subtype.val p

theorem isEmbedding_val

TopologyByExample.RationalTangentDisc.isEmbedding_val

The inclusion into the Niemytzki plane is an embedding.

theorem isEmbedding_val : IsEmbedding val
Proof
:= IsEmbedding.subtypeVal

theorem continuous_val

TopologyByExample.RationalTangentDisc.continuous_val

The inclusion into the Niemytzki plane is continuous.

theorem continuous_val : Continuous val
Proof
:= isEmbedding_val.continuous

theorem val_injective

TopologyByExample.RationalTangentDisc.val_injective

Distinct points have distinct images in the Niemytzki plane.

theorem val_injective : Injective val
Proof
:= Subtype.val_injective

theorem val_mem

TopologyByExample.RationalTangentDisc.val_mem

Every point lies in carrier.

theorem val_mem (p : RationalTangentDisc) : p.val ∈ carrier
Proof
:= Subtype.property p

theorem nhds_eq_comap

TopologyByExample.RationalTangentDisc.nhds_eq_comap

The neighbourhoods of a point are the traces of its neighbourhoods in the Niemytzki plane.

theorem nhds_eq_comap (p : RationalTangentDisc) : 𝓝 p = comap val (𝓝 p.val)
Proof
:=
  nhds_subtype (s := carrier) p

instance

The space is Hausdorff.

instance : T2Space RationalTangentDisc
Proof
:= inferInstanceAs (T2Space carrier)

instance

The space is regular, as a subspace of the completely regular Niemytzki plane.

instance : RegularSpace RationalTangentDisc
Proof
:= inferInstanceAs (RegularSpace carrier)

theorem mem_carrier_of_pos

TopologyByExample.RationalTangentDisc.mem_carrier_of_pos

Points of the open upper half-plane lie in carrier.

theorem mem_carrier_of_pos {p : Niemytzki} (hp : 0 < p.toPlane.2) : p ∈ carrier
Proof
:=
  Or.inl hp.ne'

theorem axisPt_mem_carrier

TopologyByExample.RationalTangentDisc.axisPt_mem_carrier

The rational points of the x-axis lie in carrier.

theorem axisPt_mem_carrier (q : ℚ) : axisPt q ∈ carrier
Proof
:= Or.inr ⟨q, by simp⟩

theorem insert_disc_subset_carrier

TopologyByExample.RationalTangentDisc.insert_disc_subset_carrier

A tangent disc at a rational point, with its point of tangency, lies in carrier.

theorem insert_disc_subset_carrier (q : ℚ) (r : ℝ) :
    insert (axisPt q) (disc q r) ⊆ carrier
Proof
:= by
  rintro p (rfl | hp)
  · exact axisPt_mem_carrier q
  · exact mem_carrier_of_pos (pos_of_mem_disc hp)

theorem exists_rat_of_mem_carrier

TopologyByExample.RationalTangentDisc.exists_rat_of_mem_carrier

A point of carrier on the x-axis is a rational point of the axis.

theorem exists_rat_of_mem_carrier {p : Niemytzki} (hp : p ∈ carrier) (h0 : p.toPlane.2 = 0) :
    ∃ q : ℚ, p = axisPt q
Proof
:= by
  rcases hp with hp | ⟨q, hq⟩
  · exact absurd h0 hp
  · exact ⟨q, hq ▸ eq_axisPt h0⟩

definition ofRat

TopologyByExample.RationalTangentDisc.ofRat

The point (q, 0), q rational.

def ofRat (q : ℚ) : RationalTangentDisc
:= ⟨axisPt q, axisPt_mem_carrier q⟩

instance

The space is nonempty.

instance : Nonempty RationalTangentDisc
Proof
:= ⟨ofRat 0⟩

definition ofHalfPlane

TopologyByExample.RationalTangentDisc.ofHalfPlane

The inclusion of the open upper half-plane, with its Euclidean topology.

def ofHalfPlane (q : {q : ℝ × ℝ // 0 < q.2}) : RationalTangentDisc
:=
  ⟨Niemytzki.ofUpper q, mem_carrier_of_pos (by simpa using q.property)⟩

theorem continuous_ofHalfPlane

TopologyByExample.RationalTangentDisc.continuous_ofHalfPlane

The inclusion of the open upper half-plane is continuous.

theorem continuous_ofHalfPlane : Continuous ofHalfPlane
Proof
:=
  isOpenEmbedding_ofUpper.continuous.subtype_mk _

theorem range_ofHalfPlane_union_range_ofRat

TopologyByExample.RationalTangentDisc.range_ofHalfPlane_union_range_ofRat

Every point is in the open upper half-plane or a rational point of the axis.

theorem range_ofHalfPlane_union_range_ofRat : range ofHalfPlane ∪ range ofRat = univ
Proof
:= by
  refine eq_univ_of_forall fun p ↦ ?_
  by_cases h : p.val.toPlane.2 = 0
  · obtain ⟨q, hq⟩ := exists_rat_of_mem_carrier p.val_mem h
    exact Or.inr ⟨q, val_injective hq.symm⟩
  · refine Or.inl ⟨⟨p.val.toPlane, lt_of_le_of_ne p.val.snd_nonneg (Ne.symm h)⟩, ?_⟩
    exact val_injective (by simp [ofHalfPlane, val, Niemytzki.ofUpper])

theorem isEmbedding_val_and_denseRange_val

TopologyByExample.RationalTangentDisc.isEmbedding_val_and_denseRange_val

The space is a dense subspace of the Niemytzki plane: the inclusion is an embedding with dense image.

theorem isEmbedding_val_and_denseRange_val : IsEmbedding val ∧ DenseRange val
Proof
:=
  ⟨isEmbedding_val, Niemytzki.denseRange_ofUpper.mono (by
    rintro _ ⟨q, rfl⟩
    exact ⟨ofHalfPlane q, rfl⟩)⟩

On this site: Rational tangent disc topology: A dense subspace of the Niemytzki plane

Second countability and metrizability

definition countableBase

TopologyByExample.RationalTangentDisc.countableBase

The countable family of open sets used as a base: traces of the preimages of the members of a countable base of the plane that lie in the open upper half-plane, and of the tangent discs of radius 1 / (n + 1) at rational points, with their points of tangency.

def countableBase : Set (Set RationalTangentDisc)
Definition
:=
  (fun v ↦ val ⁻¹' (toPlane ⁻¹' v)) ''
      {v ∈ countableBasis (ℝ × ℝ) | v ⊆ {q : ℝ × ℝ | 0 < q.2}} ∪
    range fun qn : ℚ × ℕ ↦ val ⁻¹' insert (axisPt qn.1) (disc qn.1 (1 / (qn.2 + 1)))

theorem countable_countableBase

TopologyByExample.RationalTangentDisc.countable_countableBase

The family countableBase is countable.

theorem countable_countableBase : countableBase.Countable
Proof
:=
  (((countable_countableBasis (ℝ × ℝ)).mono (sep_subset _ _)).image _).union (countable_range _)

theorem isTopologicalBasis_countableBase

TopologyByExample.RationalTangentDisc.isTopologicalBasis_countableBase

The family countableBase is a base of the topology.

theorem isTopologicalBasis_countableBase : IsTopologicalBasis countableBase
Proof
:= by
  refine isTopologicalBasis_of_isOpen_of_nhds ?_ fun a u hau hu ↦ ?_
  · rintro _ (⟨v, ⟨hv, hvpos⟩, rfl⟩ | ⟨⟨q, n⟩, rfl⟩)
    · exact (isOpen_preimage_toPlane ((isBasis_countableBasis _).isOpen hv) hvpos).preimage
        continuous_val
    · exact (isOpen_insert_disc _ Nat.one_div_pos_of_nat).preimage continuous_val
  obtain ⟨t, ht, htu⟩ := mem_comap.1 (nhds_eq_comap a ▸ hu.mem_nhds hau)
  by_cases h : a.val.toPlane.2 = 0
  · obtain ⟨q, hq⟩ := exists_rat_of_mem_carrier a.val_mem h
    rw [hq] at ht
    obtain ⟨r, hr, hrt⟩ := (hasBasis_nhds_axisPt q).mem_iff.1 ht
    obtain ⟨n, hn⟩ := exists_nat_one_div_lt hr
    refine ⟨_, Or.inr ⟨(q, n), rfl⟩, ?_, fun p hp ↦ htu (hrt (insert_subset_insert
      (disc_mono hn.le) hp))⟩
    rw [mem_preimage, hq]
    exact mem_insert _ _
  · have hpos : 0 < a.val.toPlane.2 := lt_of_le_of_ne a.val.snd_nonneg (Ne.symm h)
    rw [nhds_of_ne_zero h] at ht
    obtain ⟨w, hw, hwt⟩ := mem_comap.1 ht
    have hW : IsOpen (interior w ∩ {q : ℝ × ℝ | 0 < q.2}) :=
      isOpen_interior.inter (isOpen_lt continuous_const continuous_snd)
    obtain ⟨v, hv, hav, hvW⟩ := (isBasis_countableBasis (ℝ × ℝ)).exists_subset_of_mem_open
      (show a.val.toPlane ∈ interior w ∩ {q : ℝ × ℝ | 0 < q.2} from
        ⟨mem_interior_iff_mem_nhds.2 hw, hpos⟩) hW
    have hvmem : v ∈ countableBasis (ℝ × ℝ) ∧ v ⊆ {q : ℝ × ℝ | 0 < q.2} :=
      ⟨hv, fun q hq ↦ (hvW hq).2⟩
    exact ⟨_, Or.inl (mem_image_of_mem _ hvmem), hav, fun p hp ↦
      htu (hwt (show toPlane (val p) ∈ w from interior_subset (hvW hp).1))⟩

instance

The space is second countable: only countably many of its points have tangent discs.

instance : SecondCountableTopology RationalTangentDisc
Proof
:=
  isTopologicalBasis_countableBase.secondCountableTopology countable_countableBase

instance

The space is metrizable, by Urysohn's metrization theorem: it is regular, Hausdorff and second countable.

instance : MetrizableSpace RationalTangentDisc
Proof
:= metrizableSpace_of_t3_secondCountable _

Complete metrizability

definition upper

TopologyByExample.RationalTangentDisc.upper

The points off the x-axis.

def upper : Set RationalTangentDisc
:= {p | p.val.toPlane.2 ≠ 0}

definition axisPart

TopologyByExample.RationalTangentDisc.axisPart

The points on the x-axis.

def axisPart : Set RationalTangentDisc
:= {p | p.val.toPlane.2 = 0}

definition upperToHalfPlane

TopologyByExample.RationalTangentDisc.upperToHalfPlane

The point of the open upper half-plane underlying a point off the x-axis.

def upperToHalfPlane (p : upper) : {q : ℝ × ℝ // 0 < q.2}
:=
  ⟨p.val.val.toPlane, lt_of_le_of_ne p.val.val.snd_nonneg (Ne.symm p.property)⟩

theorem ofHalfPlane_mem_upper

TopologyByExample.RationalTangentDisc.ofHalfPlane_mem_upper

A point of the open upper half-plane is a point of the space off the x-axis.

theorem ofHalfPlane_mem_upper (q : {q : ℝ × ℝ // 0 < q.2}) : ofHalfPlane q ∈ upper
Proof
:= by
  change (Niemytzki.ofUpper q).toPlane.2 ≠ 0
  rw [toPlane_ofUpper]
  exact q.property.ne'

definition upperHomeomorph

TopologyByExample.RationalTangentDisc.upperHomeomorph

The points off the x-axis form a subspace homeomorphic to the open upper half-plane with its Euclidean topology.

def upperHomeomorph : upper ≃ₜ {q : ℝ × ℝ // 0 < q.2}
Definition
where
  toFun := upperToHalfPlane
  invFun q := ⟨ofHalfPlane q, ofHalfPlane_mem_upper q⟩
  left_inv p := Subtype.ext (val_injective (by
    simp [upperToHalfPlane, ofHalfPlane, val, Niemytzki.ofUpper]))
  right_inv q := Subtype.ext (by simp [upperToHalfPlane, ofHalfPlane, val])
  continuous_toFun :=
    ((continuous_toPlane.comp continuous_val).comp continuous_subtypeVal).subtype_mk _
  continuous_invFun := continuous_ofHalfPlane.subtype_mk _

instance

The points on the x-axis form a discrete subspace: they map injectively and continuously into the x-axis of the Niemytzki plane, which is discrete.

instance : DiscreteTopology axisPart
Proof
:=
  DiscreteTopology.of_continuous_injective (f := fun p : axisPart ↦ (⟨p.val.val, p.property⟩ :
    Niemytzki.axis)) ((continuous_val.comp continuous_subtypeVal).subtype_mk _)
    fun p q h ↦ Subtype.ext (val_injective (by have := congrArg Subtype.val h; exact this))

theorem isCompletelyMetrizableSpace

TopologyByExample.RationalTangentDisc.isCompletelyMetrizableSpace

The rational tangent disc topology is completely metrizable: it is metrizable, and the union of the subspace of points off the x-axis, homeomorphic to the open upper half-plane (an open subset of the plane), and of the discrete subspace of points on the axis; both are completely metrizable.

theorem isCompletelyMetrizableSpace : IsCompletelyMetrizableSpace RationalTangentDisc
Proof
:= by
  have : IsCompletelyMetrizableSpace {q : ℝ × ℝ // 0 < q.2} :=
    (isOpen_lt continuous_const continuous_snd :
      IsOpen {q : ℝ × ℝ | 0 < q.2}).isCompletelyMetrizableSpace
  have : IsCompletelyMetrizableSpace upper :=
    (Homeomorph.isCompletelyMetrizableSpace_iff upperHomeomorph).2 this
  refine isCompletelyMetrizableSpace_of_union_eq_univ (A := upper) (B := axisPart) ?_
  refine eq_univ_of_forall fun p ↦ ?_
  by_cases h : p.val.toPlane.2 = 0
  · exact Or.inr h
  · exact Or.inl h

On this site: The rational tangent disc topology is completely metrizable

σ-compactness

instance

The space is σ-compact: it is the union of the open upper half-plane, a locally compact second countable space, and of countably many points.

instance : SigmaCompactSpace RationalTangentDisc
Proof
:= by
  have : LocallyCompactSpace {q : ℝ × ℝ // 0 < q.2} :=
    (isOpen_lt continuous_const continuous_snd : IsOpen {q : ℝ × ℝ | 0 < q.2}).locallyCompactSpace
  have h1 := isSigmaCompact_range continuous_ofHalfPlane
  have h2 : IsSigmaCompact (range ofRat) := by
    rw [← iUnion_singleton_eq_range]
    exact isSigmaCompact_iUnion _ fun q ↦ isCompact_singleton.isSigmaCompact
  rw [← isSigmaCompact_univ_iff, ← range_ofHalfPlane_union_range_ofRat, union_eq_iUnion]
  exact isSigmaCompact_iUnion _ fun b ↦ by cases b <;> assumption

Path connectedness

theorem joinedIn_carrier

TopologyByExample.RationalTangentDisc.joinedIn_carrier

Every point of carrier is joined within carrier to the point (0, 1).

theorem joinedIn_carrier {p : Niemytzki} (hp : p ∈ carrier) :
    JoinedIn carrier p (Niemytzki.ofPlane (0, 1))
Proof
:= by
  have hsub : Niemytzki.ofPlane '' {q : ℝ × ℝ | 0 < q.2} ⊆ carrier := by
    rintro _ ⟨q, hq, rfl⟩
    exact mem_carrier_of_pos (by rwa [toPlane_ofPlane hq.le])
  have h01 : Niemytzki.ofPlane (0, 1) ∈ Niemytzki.ofPlane '' {q : ℝ × ℝ | 0 < q.2} :=
    ⟨(0, 1), by simp, rfl⟩
  have hup : ∀ q : ℝ × ℝ, 0 < q.2 → JoinedIn carrier (Niemytzki.ofPlane q)
      (Niemytzki.ofPlane (0, 1)) := fun q hq ↦
    (isPathConnected_compl_axis.joinedIn _ ⟨q, hq, rfl⟩ _ h01).mono hsub
  by_cases h : p.toPlane.2 = 0
  · obtain ⟨q, rfl⟩ := exists_rat_of_mem_carrier hp h
    have hc : Niemytzki.ofPlane ((q : ℝ), 1) ∈ disc q 1 := ofPlane_mem_disc one_pos (by norm_num)
    exact (((isPathConnected_insert_disc q one_pos).joinedIn _ (mem_insert _ _) _
      (mem_insert_of_mem _ hc)).mono (insert_disc_subset_carrier q 1)).trans (hup _ one_pos)
  · rw [← Niemytzki.ofPlane_toPlane p]
    exact hup _ (lt_of_le_of_ne p.snd_nonneg (Ne.symm h))

instance

The space is path connected.

instance : PathPreconnectedSpace RationalTangentDisc
Proof
:= by
  have h01 : Niemytzki.ofPlane (0, 1) ∈ carrier :=
    mem_carrier_of_pos (by rw [toPlane_ofPlane (by norm_num)]; norm_num)
  refine ⟨fun a b ↦ ?_⟩
  have key : ∀ c : RationalTangentDisc, Joined c ⟨_, h01⟩ := fun c ↦
    (joinedIn_iff_joined c.val_mem h01).1 (joinedIn_carrier c.val_mem)
  exact (key a).trans (key b).symm

theorem exists_isPathConnected_subset

TopologyByExample.RationalTangentDisc.exists_isPathConnected_subset

Every neighbourhood of a point of carrier in the Niemytzki plane contains a path connected neighbourhood of the point lying in carrier.

theorem exists_isPathConnected_subset {p : Niemytzki} (hp : p ∈ carrier) {t : Set Niemytzki}
    (ht : t ∈ 𝓝 p) : ∃ c ∈ 𝓝 p, IsPathConnected c ∧ c ⊆ t ∧ c ⊆ carrier
Proof
:= by
  by_cases h : p.toPlane.2 = 0
  · obtain ⟨q, rfl⟩ := exists_rat_of_mem_carrier hp h
    obtain ⟨r, hr, hrt⟩ := (hasBasis_nhds_axisPt q).mem_iff.1 ht
    exact ⟨_, (hasBasis_nhds_axisPt q).mem_of_mem hr, isPathConnected_insert_disc q hr, hrt,
      insert_disc_subset_carrier q r⟩
  · have hpos : 0 < p.toPlane.2 := lt_of_le_of_ne p.snd_nonneg (Ne.symm h)
    have ht' : t ∈ comap toPlane (𝓝 p.toPlane) := nhds_of_ne_zero h ▸ ht
    obtain ⟨w, hw, hwt⟩ := mem_comap.1 ht'
    obtain ⟨ε, hε, hεw⟩ := Metric.mem_nhds_iff.1 hw
    set δ := min ε p.toPlane.2
    have hδ : 0 < δ := lt_min hε hpos
    have hBpos : ∀ q ∈ Metric.ball p.toPlane δ, 0 < q.2 := fun q hq ↦ by
      rw [Metric.mem_ball, Prod.dist_eq, Real.dist_eq, Real.dist_eq] at hq
      have := abs_sub_lt_iff.1 ((le_max_right _ _).trans_lt hq)
      linarith [min_le_right ε p.toPlane.2]
    refine ⟨Niemytzki.ofPlane '' Metric.ball p.toPlane δ, ?_, ?_, ?_, ?_⟩
    · rw [nhds_of_ne_zero h]
      exact mem_of_superset (preimage_mem_comap (Metric.ball_mem_nhds _ hδ))
        fun z hz ↦ ⟨z.toPlane, hz, Niemytzki.ofPlane_toPlane z⟩
    · exact ((convex_ball _ _).isPathConnected ⟨_, Metric.mem_ball_self hδ⟩).image'
        (continuousOn_ofPlane hBpos)
    · rintro _ ⟨q, hq, rfl⟩
      refine hwt (show toPlane (Niemytzki.ofPlane q) ∈ w from ?_)
      rw [toPlane_ofPlane (hBpos q hq).le]
      exact hεw (Metric.ball_subset_ball (min_le_left _ _) hq)
    · rintro _ ⟨q, hq, rfl⟩
      exact mem_carrier_of_pos (by rw [toPlane_ofPlane (hBpos q hq).le]; exact hBpos q hq)

instance

The space is locally path connected: at a rational point of the x-axis the tangent discs with their point of tangency, and elsewhere small Euclidean balls, are path connected neighbourhoods lying in the space.

instance : LocallyPathConnectedSpace RationalTangentDisc
Proof
:= by
  refine ⟨fun p ↦ ⟨fun s ↦ ⟨fun hs ↦ ?_, fun ⟨t, ⟨ht, _⟩, hts⟩ ↦ mem_of_superset ht hts⟩⟩⟩
  obtain ⟨t, ht, hts⟩ := mem_comap.1 (nhds_eq_comap p ▸ hs)
  obtain ⟨c, hc, hcp, hct, hcs⟩ := exists_isPathConnected_subset p.val_mem ht
  refine ⟨val ⁻¹' c, ⟨?_, hcp.preimage_coe hcs⟩, fun q hq ↦ hts (hct hq)⟩
  rw [nhds_eq_comap]
  exact preimage_mem_comap hc

Local compactness

theorem not_weaklyLocallyCompactSpace

TopologyByExample.RationalTangentDisc.not_weaklyLocallyCompactSpace

The rational tangent disc topology is not weakly locally compact: the point (0, 0) has no compact neighbourhood. If K were one, its image K' in the Niemytzki plane would be compact and contain {(0, 0)} ∪ disc 0 r for some r > 0; then K' \ ({(0, 0)} ∪ disc 0 (r / 2)) would be compact, hence closed in the Euclidean plane, but it contains the points (t, t ^ 2 / r), 0 < t < r, which converge to (0, 0) in the Euclidean plane.

theorem not_weaklyLocallyCompactSpace : ¬WeaklyLocallyCompactSpace RationalTangentDisc
Proof
:= by
  intro h
  obtain ⟨K₀, hK₀, hKn₀⟩ := h.exists_compact_mem_nhds (ofRat 0)
  obtain ⟨u, hu, huK⟩ := mem_comap.1 (nhds_eq_comap (ofRat 0) ▸ hKn₀)
  have hu' : u ∈ 𝓝 (axisPt 0) := by simpa [ofRat, val] using hu
  obtain ⟨r, hr, hru⟩ := (hasBasis_nhds_axisPt 0).mem_iff.1 hu'
  set K := val '' K₀
  have hK : IsCompact K := hK₀.image continuous_val
  have hsub : insert (axisPt 0) (disc 0 r) ⊆ carrier := by
    simpa using insert_disc_subset_carrier 0 r
  have hrK : insert (axisPt 0) (disc 0 r) ⊆ K := fun p hp ↦
    ⟨⟨p, hsub hp⟩, huK (hru hp), rfl⟩
  set U := insert (axisPt 0) (disc 0 (r / 2))
  have hcl : IsClosed (toPlane '' (K \ U)) :=
    ((hK.diff (isOpen_insert_disc 0 (half_pos hr))).image Niemytzki.continuous_toPlane).isClosed
  have hmem : ((0 : ℝ), (0 : ℝ)) ∈ closure (toPlane '' (K \ U)) := by
    refine Metric.mem_closure_iff.2 fun ε hε ↦ ?_
    set t := min (ε / 2) (r / 2)
    have ht : 0 < t := lt_min (half_pos hε) (half_pos hr)
    have htε : t ≤ ε / 2 := min_le_left _ _
    have htr : t ≤ r / 2 := min_le_right _ _
    set b := t ^ 2 / r
    have hbr : b * r = t ^ 2 := div_mul_cancel₀ _ hr.ne'
    have hb : 0 < b := by positivity
    have hbt : b < t := by
      by_contra! h
      nlinarith
    have hq : 0 ≤ (t, b).2 := hb.le
    refine ⟨(t, b), ⟨Niemytzki.ofPlane (t, b), ⟨hrK (Or.inr ((ofPlane_mem_disc_iff hq).2 ?_)),
      ?_⟩, toPlane_ofPlane hq⟩, ?_⟩
    · simp only [planeDisc, mem_ofPred_eq]
      nlinarith
    · rintro (h | h)
      · have := congrArg (fun p ↦ p.toPlane.2) h
        simp [toPlane_ofPlane hq] at this
        linarith
      · rw [ofPlane_mem_disc_iff hq] at h
        simp only [planeDisc, mem_ofPred_eq] at h
        nlinarith
    · rw [Prod.dist_eq, Real.dist_eq, Real.dist_eq]
      simp only [zero_sub, abs_neg, abs_of_pos ht, abs_of_pos hb]
      exact max_lt (by linarith) (by linarith)
  rw [hcl.closure_eq] at hmem
  obtain ⟨p, ⟨-, hpU⟩, hp⟩ := hmem
  refine hpU (Or.inl (Niemytzki.toPlane_injective ?_))
  rw [hp, toPlane_axisPt]

On this site: The rational tangent disc topology is not weakly locally compact