Lean library · module TopologyByExample.Spaces.NiemytzkiPlane

The Niemytzki plane

Source file

In this file we define TopologyByExample.Niemytzki, the Niemytzki plane (also called the Moore plane, or the tangent disc topology): the closed upper half-plane {(x, y) | 0 ≤ y}, in which a point with y > 0 has its Euclidean neighbourhoods and a point (x, 0) of the x-axis has the neighbourhoods {(x, 0)} ∪ D, where D is an open disc in the open upper half-plane tangent to the x-axis at (x, 0).

The type is a synonym of {p : ℝ × ℝ // 0 ≤ p.2} (Niemytzki.toPlane is the underlying point of the plane), and the topology is TopologicalSpace.mkOfNhds of the filters Niemytzki.nhdsFilter. The disc of radius r tangent at (x, 0) is Niemytzki.disc x r, the set of points (a, b) with (a - x) ^ 2 + b ^ 2 < 2 r b.

The topology is finer than the Euclidean one, so the plane is Hausdorff. The open upper half-plane is an open dense subspace on which the topology is the Euclidean one, so the plane is separable and a Baire space; the discs of radius 1 / (n + 1) show that it is first countable; and the vertical segment from (x, 0) into a tangent disc shows that it is path connected and locally path connected. It is completely regular: the function Niemytzki.tangentFun x r, equal at (a, b), b > 0, to the radius ((a - x) ^ 2 + b ^ 2) / (2 b) of the circle through (a, b) tangent to the x-axis at (x, 0), divided by r and capped at 1, separates (x, 0) from the complement of {(x, 0)} ∪ disc x r.

The x-axis is a closed discrete subset of cardinality 𝔠 in a separable space, so by Jones's lemma the plane is neither normal nor countably paracompact. It is not pseudocompact (the first coordinate is unbounded), 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 82.
  • S. Willard, General Topology, Exercise 4B, 14.11(a) and 15.3(b).

Tags

Niemytzki plane, Moore plane, tangent disc topology, completely regular space, normal 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 Niemytzki

TopologyByExample.Niemytzki

The Niemytzki plane: the closed upper half-plane {(x, y) | 0 ≤ y}, in which a point with y > 0 has its Euclidean neighbourhoods, and a point (x, 0) has the neighbourhoods {(x, 0)} ∪ D, D an open disc in the open upper half-plane tangent to the x-axis at (x, 0).

def Niemytzki : Type
:= {p : ℝ × ℝ // 0 ≤ p.2}

On this site: Space: Niemytzki plane

Points

definition toPlane

TopologyByExample.Niemytzki.toPlane

The point of the plane ℝ × ℝ underlying a point of the Niemytzki plane.

def toPlane (p : Niemytzki) : ℝ × ℝ
:= Subtype.val p

theorem toPlane_injective

TopologyByExample.Niemytzki.toPlane_injective

Distinct points of the Niemytzki plane lie over distinct points of the plane.

theorem toPlane_injective : Injective toPlane
Proof
:= Subtype.val_injective

theorem snd_nonneg

TopologyByExample.Niemytzki.snd_nonneg

Every point of the Niemytzki plane has nonnegative second coordinate.

theorem snd_nonneg (p : Niemytzki) : 0 ≤ p.toPlane.2
Proof
:= Subtype.property p

definition ofPlane

TopologyByExample.Niemytzki.ofPlane

The point of the Niemytzki plane over (q.1, max q.2 0).

def ofPlane (q : ℝ × ℝ) : Niemytzki
:= ⟨(q.1, max q.2 0), le_max_right _ _⟩

theorem toPlane_ofPlane

TopologyByExample.Niemytzki.toPlane_ofPlane

ofPlane is a right inverse of toPlane on the closed upper half-plane.

theorem toPlane_ofPlane {q : ℝ × ℝ} (hq : 0 ≤ q.2) : toPlane (ofPlane q) = q
Proof
:= by
  simp [toPlane, ofPlane, max_eq_left hq]

theorem ofPlane_toPlane

TopologyByExample.Niemytzki.ofPlane_toPlane

ofPlane is a left inverse of toPlane.

@[simp]
theorem ofPlane_toPlane (p : Niemytzki) : ofPlane (toPlane p) = p
Proof
:=
  toPlane_injective (toPlane_ofPlane p.snd_nonneg)

definition axisPt

TopologyByExample.Niemytzki.axisPt

The point (x, 0) of the x-axis.

def axisPt (x : ℝ) : Niemytzki
:= ofPlane (x, 0)

theorem toPlane_axisPt

TopologyByExample.Niemytzki.toPlane_axisPt

The point (x, 0) lies over (x, 0).

@[simp]
theorem toPlane_axisPt (x : ℝ) : toPlane (axisPt x) = (x, 0)
Proof
:= toPlane_ofPlane le_rfl

instance

The Niemytzki plane is nonempty.

instance : Nonempty Niemytzki
Proof
:= ⟨axisPt 0⟩

definition axis

TopologyByExample.Niemytzki.axis

The x-axis {(x, 0) | x ∈ ℝ}.

def axis : Set Niemytzki
:= {p | p.toPlane.2 = 0}

theorem eq_axisPt

TopologyByExample.Niemytzki.eq_axisPt

A point of the x-axis is axisPt of its first coordinate.

theorem eq_axisPt {p : Niemytzki} (hp : p.toPlane.2 = 0) : p = axisPt p.toPlane.1
Proof
:=
  toPlane_injective (by rw [toPlane_axisPt]; exact Prod.ext rfl hp)

definition disc

TopologyByExample.Niemytzki.disc

The open disc of radius r in the open upper half-plane tangent to the x-axis at (x, 0): the points (a, b) with (a - x) ^ 2 + (b - r) ^ 2 < r ^ 2, that is, (a - x) ^ 2 + b ^ 2 < 2 r b. It is empty unless 0 < r.

def disc (x r : ℝ) : Set Niemytzki
:=
  {p | (p.toPlane.1 - x) ^ 2 + p.toPlane.2 ^ 2 < 2 * r * p.toPlane.2}

definition planeDisc

TopologyByExample.Niemytzki.planeDisc

The same disc as a subset of the plane ℝ × ℝ.

def planeDisc (x r : ℝ) : Set (ℝ × ℝ)
:= {q | (q.1 - x) ^ 2 + q.2 ^ 2 < 2 * r * q.2}

theorem disc_eq_preimage

TopologyByExample.Niemytzki.disc_eq_preimage

The tangent disc is the preimage of the disc in the plane.

theorem disc_eq_preimage (x r : ℝ) : disc x r = toPlane ⁻¹' planeDisc x r
Proof
:= rfl

theorem isOpen_planeDisc

TopologyByExample.Niemytzki.isOpen_planeDisc

The disc in the plane is open.

theorem isOpen_planeDisc (x r : ℝ) : IsOpen (planeDisc x r)
Proof
:=
  isOpen_lt (by fun_prop) (by fun_prop)

theorem pos_of_mem_planeDisc

TopologyByExample.Niemytzki.pos_of_mem_planeDisc

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

theorem pos_of_mem_planeDisc {x r : ℝ} {q : ℝ × ℝ} (hq : q ∈ planeDisc x r) (hr : 0 ≤ r) :
    0 < q.2
Proof
:= by
  simp only [planeDisc, mem_ofPred_eq] at hq
  by_contra! h
  nlinarith [sq_nonneg (q.1 - x), sq_nonneg q.2]

theorem pos_of_mem_disc

TopologyByExample.Niemytzki.pos_of_mem_disc

Points of a tangent disc lie in the open upper half-plane.

theorem pos_of_mem_disc {x r : ℝ} {p : Niemytzki} (hp : p ∈ disc x r) : 0 < p.toPlane.2
Proof
:= by
  have h0 := p.snd_nonneg
  simp only [disc, mem_ofPred_eq] at hp
  rcases h0.lt_or_eq with h | h
  · exact h
  · rw [← h] at hp
    nlinarith [sq_nonneg (p.toPlane.1 - x)]

theorem notMem_disc_of_mem_axis

TopologyByExample.Niemytzki.notMem_disc_of_mem_axis

No point of the x-axis lies in a tangent disc.

theorem notMem_disc_of_mem_axis {x r : ℝ} {p : Niemytzki} (hp : p ∈ axis) : p ∉ disc x r
Proof
:=
  fun h ↦ (pos_of_mem_disc h).ne' hp

theorem disc_mono

TopologyByExample.Niemytzki.disc_mono

Tangent discs at the same point increase with the radius.

theorem disc_mono {x r s : ℝ} (h : r ≤ s) : disc x r ⊆ disc x s
Proof
:= fun p hp ↦ by
  have := pos_of_mem_disc hp
  simp only [disc, mem_ofPred_eq] at hp ⊢
  nlinarith

theorem ofPlane_mem_disc

TopologyByExample.Niemytzki.ofPlane_mem_disc

The point (x, t) lies in the disc of radius r tangent at (x, 0) when 0 < t < 2 r.

theorem ofPlane_mem_disc {x r t : ℝ} (ht : 0 < t) (htr : t < 2 * r) :
    ofPlane (x, t) ∈ disc x r
Proof
:= by
  simp only [disc, mem_ofPred_eq, toPlane_ofPlane (show 0 ≤ (x, t).2 from ht.le)]
  nlinarith

theorem lt_of_mem_planeDisc

TopologyByExample.Niemytzki.lt_of_mem_planeDisc

A point (a, b) of the disc of radius r tangent at (x, 0) has b < 2 r and |a - x| < 2 r.

theorem lt_of_mem_planeDisc {x r : ℝ} {q : ℝ × ℝ} (hq : q ∈ planeDisc x r) (hr : 0 ≤ r) :
    q.2 < 2 * r ∧ |q.1 - x| < 2 * r
Proof
:= by
  have hb := pos_of_mem_planeDisc hq hr
  simp only [planeDisc, mem_ofPred_eq] at hq
  have h2 : q.2 < 2 * r := by nlinarith [sq_nonneg (q.1 - x)]
  exact ⟨h2, abs_lt_of_sq_lt_sq (by nlinarith) (by linarith)⟩

The topology

definition nhdsFilter

TopologyByExample.Niemytzki.nhdsFilter

The neighbourhood filter of a point of the Niemytzki plane: the Euclidean neighbourhoods for a point off the x-axis, and the sets containing {p} ∪ disc x r for some r > 0 for a point p = (x, 0) of the x-axis.

def nhdsFilter (p : Niemytzki) : Filter Niemytzki
:=
  if p.toPlane.2 = 0 then ⨅ r ∈ Ioi (0 : ℝ), 𝓟 (insert p (disc p.toPlane.1 r))
  else comap toPlane (𝓝 p.toPlane)

theorem hasBasis_nhdsFilter_axis

TopologyByExample.Niemytzki.hasBasis_nhdsFilter_axis

The neighbourhood basis at a point of the x-axis.

theorem hasBasis_nhdsFilter_axis {p : Niemytzki} (hp : p.toPlane.2 = 0) :
    (nhdsFilter p).HasBasis (fun r : ℝ ↦ 0 < r) fun r ↦ insert p (disc p.toPlane.1 r)
Proof
:= by
  simp only [nhdsFilter, hp, ↓reduceIte]
  refine hasBasis_biInf_principal ?_ ⟨1, one_pos⟩
  intro r hr s hs
  refine ⟨min r s, lt_min hr hs, ?_, ?_⟩ <;>
    exact insert_subset_insert (disc_mono (by simp))

theorem preimage_mem_nhdsFilter

TopologyByExample.Niemytzki.preimage_mem_nhdsFilter

If V is an open set of the plane contained in the open upper half-plane, its preimage is a neighbourhood (in nhdsFilter) of each of its points.

theorem preimage_mem_nhdsFilter {V : Set (ℝ × ℝ)} (hV : IsOpen V) (hVpos : ∀ q ∈ V, 0 < q.2)
    {p : Niemytzki} (hp : p.toPlane ∈ V) : toPlane ⁻¹' V ∈ nhdsFilter p
Proof
:= by
  simp only [nhdsFilter, (hVpos _ hp).ne', ↓reduceIte]
  exact preimage_mem_comap (hV.mem_nhds hp)

instance

The Niemytzki plane: its topology is given by the neighbourhood filters nhdsFilter.

instance : TopologicalSpace Niemytzki
Proof
:= .mkOfNhds nhdsFilter

theorem nhds_eq

TopologyByExample.Niemytzki.nhds_eq

The neighbourhood filters of the Niemytzki plane are the filters nhdsFilter.

theorem nhds_eq (p : Niemytzki) : 𝓝 p = nhdsFilter p
Proof
:= by
  refine nhds_mkOfNhds _ _ (fun a ↦ ?_) fun a s hs ↦ ?_
  · by_cases ha : a.toPlane.2 = 0
    · exact (hasBasis_nhdsFilter_axis ha).ge_iff.2 fun _ _ ↦ mem_insert _ _
    · simp only [nhdsFilter, ha, ↓reduceIte]
      exact pure_le_iff.2 fun s hs ↦ by
        obtain ⟨t, ht, hts⟩ := mem_comap.1 hs
        exact hts (show a.toPlane ∈ t from mem_of_mem_nhds ht)
  · by_cases ha : a.toPlane.2 = 0
    · obtain ⟨r, hr, hrs⟩ := (hasBasis_nhdsFilter_axis ha).mem_iff.1 hs
      refine mem_of_superset ((hasBasis_nhdsFilter_axis ha).mem_of_mem hr) fun y hy ↦ ?_
      rcases hy with rfl | hy
      · exact hs
      · refine mem_of_superset (preimage_mem_nhdsFilter (isOpen_planeDisc _ r)
          (fun q hq ↦ pos_of_mem_planeDisc hq hr.le) hy) fun z hz ↦ hrs (Or.inr hz)
    · have hpos : 0 < a.toPlane.2 := lt_of_le_of_ne a.snd_nonneg (Ne.symm ha)
      simp only [nhdsFilter, ha, ↓reduceIte] at hs ⊢
      obtain ⟨t, ht, hts⟩ := mem_comap.1 hs
      set V := interior t ∩ {q : ℝ × ℝ | 0 < q.2}
      have hV : IsOpen V := isOpen_interior.inter (isOpen_lt continuous_const continuous_snd)
      have haV : a.toPlane ∈ V := ⟨mem_interior_iff_mem_nhds.2 ht, hpos⟩
      filter_upwards [preimage_mem_comap (hV.mem_nhds haV)] with y hy
      exact mem_of_superset (preimage_mem_nhdsFilter hV (fun q hq ↦ hq.2) hy)
        fun z hz ↦ hts (show z.toPlane ∈ t from interior_subset hz.1)

theorem nhds_of_ne_zero

TopologyByExample.Niemytzki.nhds_of_ne_zero

At a point off the x-axis the neighbourhoods are the Euclidean ones.

theorem nhds_of_ne_zero {p : Niemytzki} (hp : p.toPlane.2 ≠ 0) :
    𝓝 p = comap toPlane (𝓝 p.toPlane)
Proof
:= by
  simp only [nhds_eq, nhdsFilter, hp, ↓reduceIte]

theorem nhds_of_pos

TopologyByExample.Niemytzki.nhds_of_pos

At a point off the x-axis the neighbourhoods are the Euclidean ones.

theorem nhds_of_pos {p : Niemytzki} (hp : 0 < p.toPlane.2) :
    𝓝 p = comap toPlane (𝓝 p.toPlane)
Proof
:=
  nhds_of_ne_zero hp.ne'

theorem hasBasis_nhds_axisPt

TopologyByExample.Niemytzki.hasBasis_nhds_axisPt

The neighbourhood basis at a point (x, 0) of the x-axis: the sets {(x, 0)} ∪ disc x r, r > 0.

theorem hasBasis_nhds_axisPt (x : ℝ) :
    (𝓝 (axisPt x)).HasBasis (fun r : ℝ ↦ 0 < r) fun r ↦ insert (axisPt x) (disc x r)
Proof
:= by
  rw [nhds_eq]
  simpa using hasBasis_nhdsFilter_axis (p := axisPt x) (by simp)

theorem isOpen_preimage_toPlane

TopologyByExample.Niemytzki.isOpen_preimage_toPlane

The preimage of an open set of the plane contained in the open upper half-plane is open.

theorem isOpen_preimage_toPlane {V : Set (ℝ × ℝ)} (hV : IsOpen V) (hVpos : ∀ q ∈ V, 0 < q.2) :
    IsOpen (toPlane ⁻¹' V)
Proof
:=
  isOpen_iff_mem_nhds.2 fun _ hp ↦ (nhds_eq _).symm ▸ preimage_mem_nhdsFilter hV hVpos hp

theorem isOpen_disc

TopologyByExample.Niemytzki.isOpen_disc

Every tangent disc is open.

theorem isOpen_disc (x r : ℝ) : IsOpen (disc x r)
Proof
:= by
  rcases le_or_gt 0 r with hr | hr
  · exact isOpen_preimage_toPlane (isOpen_planeDisc x r) fun q hq ↦ pos_of_mem_planeDisc hq hr
  · convert isOpen_empty
    refine eq_empty_of_forall_notMem fun p hp ↦ ?_
    have := pos_of_mem_disc hp
    simp only [disc, mem_ofPred_eq] at hp
    nlinarith [sq_nonneg (p.toPlane.1 - x), sq_nonneg p.toPlane.2]

theorem isOpen_insert_disc

TopologyByExample.Niemytzki.isOpen_insert_disc

A tangent disc of positive radius together with its point of tangency is open.

theorem isOpen_insert_disc (x : ℝ) {r : ℝ} (hr : 0 < r) :
    IsOpen (insert (axisPt x) (disc x r))
Proof
:= by
  refine isOpen_iff_mem_nhds.2 fun p hp ↦ ?_
  rcases hp with rfl | hp
  · exact (hasBasis_nhds_axisPt x).mem_of_mem hr
  · exact mem_of_superset ((isOpen_disc x r).mem_nhds hp) (subset_insert _ _)

theorem isOpen_compl_axis

TopologyByExample.Niemytzki.isOpen_compl_axis

The open upper half-plane is open.

theorem isOpen_compl_axis : IsOpen axisᶜ
Proof
:= by
  convert isOpen_preimage_toPlane (isOpen_lt continuous_const continuous_snd)
    fun (q : ℝ × ℝ) (hq : 0 < q.2) ↦ hq using 1
  ext p
  simp [axis, lt_iff_le_and_ne, p.snd_nonneg, eq_comm]

theorem isClosed_axis

TopologyByExample.Niemytzki.isClosed_axis

The x-axis is closed.

theorem isClosed_axis : IsClosed axis
Proof
:= isOpen_compl_iff.1 isOpen_compl_axis

theorem continuous_toPlane

TopologyByExample.Niemytzki.continuous_toPlane

The map to the plane is continuous: the topology of the Niemytzki plane is finer than the Euclidean one.

theorem continuous_toPlane : Continuous toPlane
Proof
:= by
  refine continuous_iff_continuousAt.2 fun p ↦ ?_
  by_cases hp : p.toPlane.2 = 0
  · rw [eq_axisPt hp]
    refine ((hasBasis_nhds_axisPt _).tendsto_iff Metric.nhds_basis_ball).2 fun ε hε ↦
      ⟨ε / 2, half_pos hε, fun q hq ↦ ?_⟩
    rcases hq with rfl | hq
    · exact Metric.mem_ball_self hε
    · obtain ⟨h1, h2⟩ := lt_of_mem_planeDisc hq (half_pos hε).le
      have h0 := q.snd_nonneg
      rw [Metric.mem_ball, toPlane_axisPt, Prod.dist_eq, Real.dist_eq, Real.dist_eq, sub_zero,
        abs_of_nonneg h0]
      exact max_lt (by linarith) (by linarith)
  · rw [ContinuousAt, nhds_of_ne_zero hp]
    exact tendsto_comap

On this site: Niemytzki plane: The topology is finer than the Euclidean topology

theorem continuousAt_ofPlane

TopologyByExample.Niemytzki.continuousAt_ofPlane

ofPlane is continuous at every point of the open upper half-plane.

theorem continuousAt_ofPlane {q : ℝ × ℝ} (hq : 0 < q.2) : ContinuousAt ofPlane q
Proof
:= by
  have h : (ofPlane q).toPlane.2 ≠ 0 := by rw [toPlane_ofPlane hq.le]; exact hq.ne'
  rw [ContinuousAt, nhds_of_ne_zero h, tendsto_comap_iff, toPlane_ofPlane hq.le]
  have hc : Continuous fun q : ℝ × ℝ ↦ (q.1, max q.2 0) := by fun_prop
  simpa [Function.comp_def, toPlane, ofPlane, max_eq_left hq.le] using hc.tendsto q

instance t2Space

TopologyByExample.Niemytzki.t2Space

The Niemytzki plane is Hausdorff, since its topology is finer than the Euclidean one.

instance t2Space : T2Space Niemytzki
Proof
:=
  .of_injective_continuous toPlane_injective continuous_toPlane

On this site: The Niemytzki plane is Hausdorff

theorem ofPlane_mem_disc_iff

TopologyByExample.Niemytzki.ofPlane_mem_disc_iff

ofPlane q lies in a tangent disc iff q lies in the corresponding disc of the plane.

theorem ofPlane_mem_disc_iff {x r : ℝ} {q : ℝ × ℝ} (hq : 0 ≤ q.2) :
    ofPlane q ∈ disc x r ↔ q ∈ planeDisc x r
Proof
:= by
  rw [disc_eq_preimage, mem_preimage, toPlane_ofPlane hq]

theorem continuousOn_ofPlane

TopologyByExample.Niemytzki.continuousOn_ofPlane

ofPlane is continuous on the open upper half-plane.

theorem continuousOn_ofPlane {V : Set (ℝ × ℝ)} (hV : ∀ q ∈ V, 0 < q.2) : ContinuousOn ofPlane V
Proof
:=
  fun q hq ↦ (continuousAt_ofPlane (hV q hq)).continuousWithinAt

theorem continuous_ofPlane_vertical

TopologyByExample.Niemytzki.continuous_ofPlane_vertical

The vertical line t ↦ (x, max t 0) is continuous: as t decreases to 0, the point (x, t) enters every disc tangent at (x, 0).

theorem continuous_ofPlane_vertical (x : ℝ) : Continuous fun t : ℝ ↦ ofPlane (x, t)
Proof
:= by
  refine continuous_iff_continuousAt.2 fun t ↦ ?_
  rcases lt_trichotomy t 0 with ht | rfl | ht
  · refine continuousAt_const.congr (f := fun _ ↦ axisPt x) ?_
    filter_upwards [Iio_mem_nhds ht] with u hu
    exact toPlane_injective (by simp [toPlane, ofPlane, axisPt, max_eq_right hu.le])
  · refine ((hasBasis_nhds_axisPt x).tendsto_right_iff).2 fun r hr ↦ ?_
    filter_upwards [Iio_mem_nhds (by linarith : (0 : ℝ) < 2 * r)] with u hu
    rcases le_or_gt u 0 with hu0 | hu0
    · left
      exact toPlane_injective (by simp [toPlane, ofPlane, axisPt, max_eq_right hu0])
    · exact Or.inr (ofPlane_mem_disc hu0 hu)
  · exact (continuousAt_ofPlane (q := (x, t)) ht).comp (by fun_prop)

The open upper half-plane

definition ofUpper

TopologyByExample.Niemytzki.ofUpper

The inclusion of the open upper half-plane {q : ℝ × ℝ | 0 < q.2}, with its Euclidean topology, into the Niemytzki plane.

def ofUpper (q : {q : ℝ × ℝ // 0 < q.2}) : Niemytzki
:= ofPlane q.val

theorem toPlane_ofUpper

TopologyByExample.Niemytzki.toPlane_ofUpper

The inclusion of the open upper half-plane lies over the identity.

@[simp]
theorem toPlane_ofUpper (q : {q : ℝ × ℝ // 0 < q.2}) : toPlane (ofUpper q) = q.val
Proof
:=
  toPlane_ofPlane q.property.le

theorem range_ofUpper

TopologyByExample.Niemytzki.range_ofUpper

The image of the open upper half-plane is the complement of the x-axis.

theorem range_ofUpper : range ofUpper = axisᶜ
Proof
:= by
  ext p
  constructor
  · rintro ⟨q, rfl⟩
    simp [axis, q.property.ne']
  · intro hp
    exact ⟨⟨p.toPlane, lt_of_le_of_ne p.snd_nonneg (Ne.symm hp)⟩, by simp [ofUpper]⟩

theorem isOpenEmbedding_ofUpper

TopologyByExample.Niemytzki.isOpenEmbedding_ofUpper

The open upper half-plane is an open Euclidean subspace: the inclusion of the open upper half-plane, with its Euclidean topology, is an open embedding.

theorem isOpenEmbedding_ofUpper : IsOpenEmbedding ofUpper
Proof
:= by
  refine .of_continuous_injective_isOpenMap ?_ ?_ ?_
  · exact continuous_iff_continuousAt.2 fun q ↦
      (continuousAt_ofPlane q.property).comp continuous_subtypeVal.continuousAt
  · intro a b h
    exact Subtype.ext (by simpa using congrArg toPlane h)
  · intro U hU
    obtain ⟨V, hV, rfl⟩ := isOpen_induced_iff.1 hU
    convert isOpen_preimage_toPlane (hV.inter (isOpen_lt continuous_const continuous_snd))
      fun q hq ↦ hq.2 using 1
    ext p
    constructor
    · rintro ⟨q, hq, rfl⟩
      exact ⟨by simpa using hq, by simp⟩
    · rintro ⟨h1, h2⟩
      exact ⟨⟨p.toPlane, h2⟩, h1, by simp [ofUpper]⟩

On this site: Niemytzki plane: The open half-plane is an open Euclidean subspace

theorem denseRange_ofUpper

TopologyByExample.Niemytzki.denseRange_ofUpper

The open upper half-plane is dense.

theorem denseRange_ofUpper : DenseRange ofUpper
Proof
:= by
  refine fun p ↦ ?_
  by_cases hp : p.toPlane.2 = 0
  · obtain ⟨x, rfl⟩ : ∃ x, p = axisPt x := ⟨_, eq_axisPt hp⟩
    refine (mem_closure_iff_nhds_basis' (hasBasis_nhds_axisPt x)).2 fun r hr ↦ ?_
    refine ⟨ofPlane (x, r), Or.inr (ofPlane_mem_disc hr (by linarith)), ?_⟩
    rw [range_ofUpper]
    simp [axis, toPlane_ofPlane (show 0 ≤ (x, r).2 from hr.le), hr.ne']
  · exact subset_closure (range_ofUpper ▸ hp)

Separability and first countability

instance separableSpace

TopologyByExample.Niemytzki.separableSpace

The Niemytzki plane is separable: the open upper half-plane is dense, and separable.

instance separableSpace : SeparableSpace Niemytzki
Proof
:=
  denseRange_ofUpper.separableSpace isOpenEmbedding_ofUpper.continuous

On this site: The Niemytzki plane is separable

instance firstCountableTopology

TopologyByExample.Niemytzki.firstCountableTopology

The Niemytzki plane is first countable: the discs of radius 1 / (n + 1) tangent at a point of the x-axis form a neighbourhood basis there.

instance firstCountableTopology : FirstCountableTopology Niemytzki
Proof
:= by
  refine ⟨fun p ↦ ?_⟩
  by_cases hp : p.toPlane.2 = 0
  · obtain ⟨x, rfl⟩ : ∃ x, p = axisPt x := ⟨_, eq_axisPt hp⟩
    refine ((hasBasis_nhds_axisPt x).to_hasBasis (p' := fun _ : ℕ ↦ True)
      (s' := fun n ↦ insert (axisPt x) (disc x (1 / (n + 1)))) ?_ ?_).isCountablyGenerated
    · intro r hr
      obtain ⟨n, hn⟩ := exists_nat_one_div_lt hr
      exact ⟨n, trivial, insert_subset_insert (disc_mono hn.le)⟩
    · exact fun n _ ↦ ⟨1 / (n + 1), Nat.one_div_pos_of_nat, subset_rfl⟩
  · rw [nhds_of_ne_zero hp]
    infer_instance

On this site: The Niemytzki plane is first countable

Complete regularity

definition tangentFun

TopologyByExample.Niemytzki.tangentFun

The function separating (x, 0) from the complement of {(x, 0)} ∪ disc x r. At a point (a, b) with b > 0 it is the radius ((a - x) ^ 2 + b ^ 2) / (2 b) of the circle tangent to the x-axis at (x, 0) through (a, b), divided by r and capped at 1; it is 0 at (x, 0) and 1 at the other points of the x-axis.

def tangentFun (x r : ℝ) (p : Niemytzki) : ℝ
:=
  if p.toPlane.2 = 0 then (if p.toPlane.1 = x then 0 else 1)
  else min 1 (((p.toPlane.1 - x) ^ 2 + p.toPlane.2 ^ 2) / (2 * r * p.toPlane.2))

theorem tangentFun_axisPt_self

TopologyByExample.Niemytzki.tangentFun_axisPt_self

tangentFun x r vanishes at (x, 0).

theorem tangentFun_axisPt_self (x r : ℝ) : tangentFun x r (axisPt x) = 0
Proof
:= by
  simp [tangentFun]

theorem tangentFun_nonneg

TopologyByExample.Niemytzki.tangentFun_nonneg

tangentFun x r is nonnegative.

theorem tangentFun_nonneg (x : ℝ) {r : ℝ} (hr : 0 < r) (p : Niemytzki) : 0 ≤ tangentFun x r p
Proof
:= by
  unfold tangentFun
  split_ifs with h1 h2
  · exact le_rfl
  · exact zero_le_one
  · have : 0 < p.toPlane.2 := lt_of_le_of_ne p.snd_nonneg (Ne.symm h1)
    exact le_min zero_le_one (by positivity)

theorem tangentFun_le_one

TopologyByExample.Niemytzki.tangentFun_le_one

tangentFun x r is at most 1.

theorem tangentFun_le_one (x r : ℝ) (p : Niemytzki) : tangentFun x r p ≤ 1
Proof
:= by
  unfold tangentFun
  split_ifs
  · exact zero_le_one
  · exact le_rfl
  · exact min_le_left _ _

theorem tangentFun_eq_one

TopologyByExample.Niemytzki.tangentFun_eq_one

tangentFun x r is 1 outside {(x, 0)} ∪ disc x r.

theorem tangentFun_eq_one (x : ℝ) {r : ℝ} (hr : 0 < r) {p : Niemytzki}
    (hp : p ∉ insert (axisPt x) (disc x r)) : tangentFun x r p = 1
Proof
:= by
  unfold tangentFun
  split_ifs with h1 h2
  · exact absurd (by rw [eq_axisPt h1, h2]) fun h ↦ hp (Or.inl h)
  · rfl
  · have hb : 0 < p.toPlane.2 := lt_of_le_of_ne p.snd_nonneg (Ne.symm h1)
    refine min_eq_left ((one_le_div (by positivity)).2 ?_)
    by_contra! h
    exact hp (Or.inr h)

theorem tangentFun_lt

TopologyByExample.Niemytzki.tangentFun_lt

On the disc of radius s tangent at (x, 0), tangentFun x r is less than s / r.

theorem tangentFun_lt (x : ℝ) {r s : ℝ} (hr : 0 < r) {p : Niemytzki} (hp : p ∈ disc x s) :
    tangentFun x r p < s / r
Proof
:= by
  have hb := pos_of_mem_disc hp
  simp only [tangentFun, hb.ne', ↓reduceIte]
  refine (min_le_right _ _).trans_lt ?_
  rw [div_lt_div_iff₀ (by positivity) hr]
  simp only [disc, mem_ofPred_eq] at hp
  nlinarith

theorem notMem_disc_of_mem_disc

TopologyByExample.Niemytzki.notMem_disc_of_mem_disc

Two tangent discs at different points are disjoint once one of them is small enough.

theorem notMem_disc_of_mem_disc {x y r : ℝ} (hr : 0 < r) (hxy : y ≠ x) {p : Niemytzki}
    (hp : p ∈ disc y (min (|y - x| / 4) (|y - x| ^ 2 / (16 * r)))) : p ∉ disc x r
Proof
:= by
  intro hpx
  set d := |y - x|
  have hd : 0 < d := abs_pos.2 (sub_ne_zero.2 hxy)
  set s := min (d / 4) (d ^ 2 / (16 * r))
  have hs1 : s ≤ d / 4 := min_le_left _ _
  have hs2 : s * (16 * r) ≤ d ^ 2 := (le_div_iff₀ (by positivity)).1 (min_le_right _ _)
  have hs : 0 < s := lt_min (by positivity) (by positivity)
  obtain ⟨hb, ha⟩ := lt_of_mem_planeDisc (q := p.toPlane) hp hs.le
  have hb0 := pos_of_mem_disc hp
  have htri : d ≤ |p.toPlane.1 - y| + |p.toPlane.1 - x| := by
    rw [abs_sub_comm p.toPlane.1 y]
    exact abs_sub_le y p.toPlane.1 x
  have h1 : d / 2 < |p.toPlane.1 - x| := by linarith
  have h2 : (d / 2) ^ 2 < (p.toPlane.1 - x) ^ 2 := by
    rw [← sq_abs (p.toPlane.1 - x)]
    exact pow_lt_pow_left₀ h1 (by positivity) two_ne_zero
  simp only [disc, mem_ofPred_eq] at hpx
  nlinarith

theorem continuous_tangentFun

TopologyByExample.Niemytzki.continuous_tangentFun

tangentFun x r is continuous.

theorem continuous_tangentFun (x : ℝ) {r : ℝ} (hr : 0 < r) : Continuous (tangentFun x r)
Proof
:= by
  refine continuous_iff_continuousAt.2 fun p ↦ ?_
  by_cases hp : p.toPlane.2 = 0
  · obtain ⟨y, rfl⟩ : ∃ y, p = axisPt y := ⟨_, eq_axisPt hp⟩
    rcases eq_or_ne y x with rfl | hxy
    · refine ((hasBasis_nhds_axisPt y).tendsto_iff Metric.nhds_basis_ball).2 fun ε hε ↦
        ⟨ε * r / 2, by positivity, fun q hq ↦ ?_⟩
      rw [Metric.mem_ball, tangentFun_axisPt_self, Real.dist_eq, sub_zero,
        abs_of_nonneg (tangentFun_nonneg y hr q)]
      rcases hq with rfl | hq
      · rw [tangentFun_axisPt_self]
        exact hε
      · refine (tangentFun_lt y hr hq).trans_le ?_
        rw [div_le_iff₀ hr]
        linarith [mul_pos hε hr]
    · refine continuousAt_const.congr (f := fun _ ↦ (1 : ℝ)) ?_
      refine (hasBasis_nhds_axisPt y).eventually_iff.2
        ⟨min (|y - x| / 4) (|y - x| ^ 2 / (16 * r)), ?_,
          fun q hq ↦ (tangentFun_eq_one x hr ?_).symm⟩
      · have hd : 0 < |y - x| := abs_pos.2 (sub_ne_zero.2 hxy)
        exact lt_min (by positivity) (by positivity)
      rintro (rfl | hqx)
      · rcases hq with hq | hq
        · exact hxy (by simpa using (congrArg (fun p ↦ p.toPlane.1) hq).symm)
        · exact notMem_disc_of_mem_axis (by simp [axis]) hq
      · rcases hq with rfl | hq
        · exact notMem_disc_of_mem_axis (by simp [axis]) hqx
        · exact notMem_disc_of_mem_disc hr hxy hq hqx
  · have hpos : 0 < p.toPlane.2 := lt_of_le_of_ne p.snd_nonneg (Ne.symm hp)
    let G : ℝ × ℝ → ℝ := fun q ↦ min 1 (((q.1 - x) ^ 2 + q.2 ^ 2) / (2 * r * q.2))
    have hG : ContinuousAt G p.toPlane := by
      refine continuousAt_const.min (ContinuousAt.div (by fun_prop) (by fun_prop) ?_)
      positivity
    refine (hG.comp continuous_toPlane.continuousAt).congr ?_
    filter_upwards [isOpen_compl_axis.mem_nhds hp] with q hq
    simp [G, tangentFun, show q.toPlane.2 ≠ 0 from hq]

instance completelyRegularSpace

TopologyByExample.Niemytzki.completelyRegularSpace

The Niemytzki plane is completely regular. At a point off the x-axis the Euclidean distance gives a separating function; at a point (x, 0) and a basic neighbourhood {(x, 0)} ∪ disc x r, the function tangentFun x r does.

instance completelyRegularSpace : CompletelyRegularSpace Niemytzki
Proof
:= by
  refine completelyRegularSpace_iff_isOpen.2 fun p U hU hpU ↦ ?_
  by_cases hp : p.toPlane.2 = 0
  · obtain ⟨x, rfl⟩ : ∃ x, p = axisPt x := ⟨_, eq_axisPt hp⟩
    obtain ⟨r, hr, hrU⟩ := (hasBasis_nhds_axisPt x).mem_iff.1 (hU.mem_nhds hpU)
    refine ⟨fun q ↦ ⟨tangentFun x r q, tangentFun_nonneg x hr q, tangentFun_le_one x r q⟩,
      (continuous_tangentFun x hr).subtype_mk _, Subtype.ext (tangentFun_axisPt_self x r),
      fun q hq ↦ Subtype.ext (tangentFun_eq_one x hr fun h ↦ hq (hrU h))⟩
  · have hU' : U ∈ comap toPlane (𝓝 p.toPlane) := nhds_of_ne_zero hp ▸ hU.mem_nhds hpU
    obtain ⟨t, ht, hts⟩ := mem_comap.1 hU'
    obtain ⟨ε, hε, hεt⟩ := Metric.mem_nhds_iff.1 ht
    refine ⟨fun q ↦ ⟨min 1 (dist q.toPlane p.toPlane / ε), by positivity, min_le_left _ _⟩,
      ((continuous_const.min ((continuous_toPlane.dist continuous_const).div_const ε))).subtype_mk
        _, Subtype.ext (by simp), fun q hq ↦ Subtype.ext ?_⟩
    have : ε ≤ dist q.toPlane p.toPlane := by
      by_contra! h
      exact hq (hts (hεt h))
    exact min_eq_left ((one_le_div hε).2 this)

On this site: The Niemytzki plane is completely regular

Path connectedness

theorem starConvex_planeDisc

TopologyByExample.Niemytzki.starConvex_planeDisc

A disc in the plane tangent to the x-axis is star-convex about its centre.

theorem starConvex_planeDisc (x r : ℝ) : StarConvex ℝ (x, r) (planeDisc x r)
Proof
:= by
  intro q hq a b ha hb hab
  obtain rfl : a = 1 - b := by linarith
  simp only [planeDisc, mem_ofPred_eq, Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd,
    smul_eq_mul] at hq ⊢
  have hb1 : b ^ 2 ≤ 1 := by nlinarith
  have hk : 0 ≤ (q.1 - x) ^ 2 + (q.2 - r) ^ 2 := by positivity
  nlinarith [mul_le_mul_of_nonneg_right hb1 hk]

theorem isPathConnected_disc

TopologyByExample.Niemytzki.isPathConnected_disc

Every tangent disc of positive radius is path connected.

theorem isPathConnected_disc (x : ℝ) {r : ℝ} (hr : 0 < r) : IsPathConnected (disc x r)
Proof
:= by
  have hc : (x, r) ∈ planeDisc x r := by simp only [planeDisc, mem_ofPred_eq]; nlinarith
  convert ((starConvex_planeDisc x r).isPathConnected hc).image'
    (continuousOn_ofPlane fun q hq ↦ pos_of_mem_planeDisc hq hr.le)
  ext p
  constructor
  · intro hp
    exact ⟨p.toPlane, hp, ofPlane_toPlane p⟩
  · rintro ⟨q, hq, rfl⟩
    exact (ofPlane_mem_disc_iff (pos_of_mem_planeDisc hq hr.le).le).2 hq

theorem isPathConnected_insert_disc

TopologyByExample.Niemytzki.isPathConnected_insert_disc

A tangent disc of positive radius together with its point of tangency is path connected: the vertical segment from (x, 0) to the centre (x, r) lies in it.

theorem isPathConnected_insert_disc (x : ℝ) {r : ℝ} (hr : 0 < r) :
    IsPathConnected (insert (axisPt x) (disc x r))
Proof
:= by
  have hc : ofPlane (x, r) ∈ disc x r := ofPlane_mem_disc hr (by linarith)
  refine ⟨ofPlane (x, r), mem_insert_of_mem _ hc, fun {y} hy ↦ ?_⟩
  rcases hy with rfl | hy
  · let γ : Path (axisPt x) (ofPlane (x, r)) :=
      { toFun := fun t ↦ ofPlane (x, r * t)
        continuous_toFun := (continuous_ofPlane_vertical x).comp (by fun_prop)
        source' := by simp [axisPt]
        target' := by simp }
    refine JoinedIn.symm ⟨γ, fun t ↦ ?_⟩
    change ofPlane (x, r * (t : ℝ)) ∈ insert (axisPt x) (disc x r)
    rcases (unitInterval.nonneg t).eq_or_lt with ht | ht
    · left
      rw [← ht, mul_zero]
      rfl
    · right
      exact ofPlane_mem_disc (by positivity) (by nlinarith [unitInterval.le_one t])
  · exact ((isPathConnected_disc x hr).joinedIn _ hc _ hy).mono (subset_insert _ _)

theorem isPathConnected_compl_axis

TopologyByExample.Niemytzki.isPathConnected_compl_axis

The open upper half-plane is path connected.

theorem isPathConnected_compl_axis : IsPathConnected (ofPlane '' {q : ℝ × ℝ | 0 < q.2})
Proof
:= by
  have hconv : Convex ℝ {q : ℝ × ℝ | 0 < q.2} := by
    intro a ha b hb s t hs ht hst
    simp only [mem_ofPred_eq, Prod.snd_add, Prod.smul_snd, smul_eq_mul] at ha hb ⊢
    rcases hs.eq_or_lt with rfl | hs
    · simp only [zero_add] at hst
      simp [hst, hb]
    · positivity
  exact (hconv.isPathConnected ⟨(0, 1), by simp⟩).image' (continuousOn_ofPlane fun _ h ↦ h)

instance pathPreconnectedSpace

TopologyByExample.Niemytzki.pathPreconnectedSpace

The Niemytzki plane is path connected.

instance pathPreconnectedSpace : PathPreconnectedSpace Niemytzki
Proof
:= by
  have key : ∀ p : Niemytzki, Joined p (ofPlane (0, 1)) := by
    have h01 : ofPlane (0, 1) ∈ ofPlane '' {q : ℝ × ℝ | 0 < q.2} := ⟨(0, 1), by simp, rfl⟩
    have hup : ∀ q : ℝ × ℝ, 0 < q.2 → Joined (ofPlane q) (ofPlane (0, 1)) := fun q hq ↦
      (isPathConnected_compl_axis.joinedIn _ ⟨q, hq, rfl⟩ _ h01).joined
    intro p
    by_cases hp : p.toPlane.2 = 0
    · obtain ⟨x, rfl⟩ : ∃ x, p = axisPt x := ⟨_, eq_axisPt hp⟩
      exact ((isPathConnected_insert_disc x one_pos).joinedIn _ (mem_insert _ _) _
        (mem_insert_of_mem _ (ofPlane_mem_disc one_pos (by norm_num)))).joined.trans
        (hup (x, 1) one_pos)
    · rw [← ofPlane_toPlane p]
      exact hup _ (lt_of_le_of_ne p.snd_nonneg (Ne.symm hp))
  exact ⟨fun p q ↦ (key p).trans (key q).symm⟩

On this site: The Niemytzki plane is path connected

instance locallyPathConnectedSpace

TopologyByExample.Niemytzki.locallyPathConnectedSpace

The Niemytzki plane is locally path connected: the sets {(x, 0)} ∪ disc x r at a point of the x-axis, and small Euclidean balls elsewhere, are path connected.

instance locallyPathConnectedSpace : LocallyPathConnectedSpace Niemytzki
Proof
:= by
  refine ⟨fun p ↦ ⟨fun s ↦ ⟨fun hs ↦ ?_, fun ⟨t, ⟨ht, _⟩, hts⟩ ↦ mem_of_superset ht hts⟩⟩⟩
  by_cases hp : p.toPlane.2 = 0
  · obtain ⟨x, rfl⟩ : ∃ x, p = axisPt x := ⟨_, eq_axisPt hp⟩
    obtain ⟨r, hr, hrs⟩ := (hasBasis_nhds_axisPt x).mem_iff.1 hs
    exact ⟨_, ⟨(hasBasis_nhds_axisPt x).mem_of_mem hr, isPathConnected_insert_disc x hr⟩, hrs⟩
  · have hpos : 0 < p.toPlane.2 := lt_of_le_of_ne p.snd_nonneg (Ne.symm hp)
    have hs' : s ∈ comap toPlane (𝓝 p.toPlane) := nhds_of_ne_zero hp ▸ hs
    obtain ⟨t, ht, hts⟩ := mem_comap.1 hs'
    obtain ⟨ε, hε, hεt⟩ := Metric.mem_nhds_iff.1 ht
    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 ⟨ofPlane '' Metric.ball p.toPlane δ, ⟨?_, ?_⟩, ?_⟩
    · rw [nhds_of_ne_zero hp]
      exact mem_of_superset (preimage_mem_comap (Metric.ball_mem_nhds _ hδ))
        fun z hz ↦ ⟨z.toPlane, hz, ofPlane_toPlane z⟩
    · exact ((convex_ball _ _).isPathConnected ⟨_, Metric.mem_ball_self hδ⟩).image'
        (continuousOn_ofPlane hBpos)
    · rintro _ ⟨q, hq, rfl⟩
      refine hts (show toPlane (ofPlane q) ∈ t from ?_)
      rw [toPlane_ofPlane (hBpos q hq).le]
      exact hεt (Metric.ball_subset_ball (min_le_left _ _) hq)

The Baire property

theorem baireSpace_closedHalfPlane

TopologyByExample.Niemytzki.baireSpace_closedHalfPlane

The closed upper half-plane, with its Euclidean topology, is a Baire space: it is a closed subset of the complete metric space ℝ × ℝ.

theorem baireSpace_closedHalfPlane : BaireSpace {q : ℝ × ℝ // 0 ≤ q.2}
Proof
:= by
  have : CompleteSpace {q : ℝ × ℝ // 0 ≤ q.2} :=
    (isClosed_le continuous_const continuous_snd : IsClosed {q : ℝ × ℝ | 0 ≤ q.2}).completeSpace_coe
  infer_instance

theorem baireSpace

TopologyByExample.Niemytzki.baireSpace

The Niemytzki plane is a Baire space: the identity onto the closed upper half-plane with its Euclidean topology is continuous, and every nonempty open set contains a nonempty Euclidean open set.

theorem baireSpace : BaireSpace Niemytzki
Proof
:= by
  have := baireSpace_closedHalfPlane
  refine baireSpace_of_continuous_of_surjective
    (f := fun p : Niemytzki ↦ (⟨p.toPlane, p.snd_nonneg⟩ : {q : ℝ × ℝ // 0 ≤ q.2}))
    (continuous_toPlane.subtype_mk _) (fun q ↦ ⟨show Niemytzki from q, rfl⟩) fun U hU hne ↦ ?_
  obtain ⟨v, hvU, hv⟩ : ∃ v ∈ U, 0 < v.toPlane.2 := by
    obtain ⟨u, hu⟩ := hne
    by_cases h : u.toPlane.2 = 0
    · obtain ⟨x, rfl⟩ : ∃ x, u = axisPt x := ⟨_, eq_axisPt h⟩
      obtain ⟨r, hr, hrU⟩ := (hasBasis_nhds_axisPt x).mem_iff.1 (hU.mem_nhds hu)
      refine ⟨ofPlane (x, r), hrU (Or.inr (ofPlane_mem_disc hr (by linarith))), ?_⟩
      rw [toPlane_ofPlane (show 0 ≤ (x, r).2 from hr.le)]
      exact hr
    · exact ⟨u, hu, lt_of_le_of_ne u.snd_nonneg (Ne.symm h)⟩
  have hU' : U ∈ comap toPlane (𝓝 v.toPlane) := nhds_of_pos hv ▸ hU.mem_nhds hvU
  obtain ⟨t, ht, hts⟩ := mem_comap.1 hU'
  refine ⟨Subtype.val ⁻¹' interior t, isOpen_interior.preimage continuous_subtypeVal,
    ⟨⟨v.toPlane, v.snd_nonneg⟩, mem_interior_iff_mem_nhds.2 ht⟩, fun p hp ↦ hts ?_⟩
  exact interior_subset (s := t) hp

On this site: The Niemytzki plane is a Baire space

The x-axis

theorem discreteTopology_axis

TopologyByExample.Niemytzki.discreteTopology_axis

The x-axis is discrete: as a subspace of the Niemytzki plane, the x-axis is discrete, since {(x, 0)} ∪ disc x 1 meets it only in (x, 0).

theorem discreteTopology_axis : DiscreteTopology axis
Proof
:= by
  refine discreteTopology_iff_isOpen_singleton.2 fun ⟨p, hp⟩ ↦ ?_
  obtain ⟨x, rfl⟩ : ∃ x, p = axisPt x := ⟨_, eq_axisPt hp⟩
  refine isOpen_induced_iff.2 ⟨_, isOpen_insert_disc x one_pos, ?_⟩
  ext ⟨q, hq⟩
  simp only [mem_preimage, mem_insert_iff, mem_singleton_iff, Subtype.mk.injEq]
  exact or_iff_left (notMem_disc_of_mem_axis hq)

instance

The x-axis is discrete.

instance : DiscreteTopology axis
Proof
:= discreteTopology_axis

theorem cardinal_axis

TopologyByExample.Niemytzki.cardinal_axis

The x-axis has the cardinality of the continuum.

theorem cardinal_axis : #axis = 𝔠
Proof
:= by
  rw [← Cardinal.mk_real]
  refine Equiv.cardinal_eq ⟨fun p ↦ p.val.toPlane.1, fun x ↦ ⟨axisPt x, by simp [axis]⟩, ?_, ?_⟩
  · rintro ⟨p, hp⟩
    exact Subtype.ext (eq_axisPt hp).symm
  · intro x
    simp

theorem isClosed_discreteTopology_mk_axis

TopologyByExample.Niemytzki.isClosed_discreteTopology_mk_axis

The x-axis is a closed discrete subset of cardinality 𝔠.

theorem isClosed_discreteTopology_mk_axis : IsClosed axis ∧ DiscreteTopology axis ∧ #axis = 𝔠
Proof
:=
  ⟨isClosed_axis, discreteTopology_axis, cardinal_axis⟩

On this site: Niemytzki plane: The axis is closed, discrete, of cardinality continuum

theorem exists_closed_discrete_continuum_le

TopologyByExample.Niemytzki.exists_closed_discrete_continuum_le

The Niemytzki plane has a closed discrete subset of cardinality 𝔠: the x-axis.

theorem exists_closed_discrete_continuum_le :
    ∃ s : Set Niemytzki, IsClosed s ∧ IsDiscrete s ∧ 𝔠 ≤ #s
Proof
:=
  ⟨axis, isClosed_axis, isDiscrete_iff_discreteTopology.2 discreteTopology_axis, cardinal_axis.ge⟩

On this site: The Niemytzki plane has a closed discrete subset of cardinality \(\mathfrak{c}\)

Negative properties

theorem not_normalSpace

TopologyByExample.Niemytzki.not_normalSpace

The Niemytzki plane is not normal (Jones's lemma): it is separable, and the x-axis is a closed discrete subset of cardinality 𝔠.

theorem not_normalSpace : ¬NormalSpace Niemytzki
Proof
:=
  isClosed_axis.not_normal_of_continuum_le_mk cardinal_axis.ge

theorem not_countablyParacompactSpace

TopologyByExample.Niemytzki.not_countablyParacompactSpace

The Niemytzki plane is not countably paracompact: it is separable, and the x-axis is a closed discrete subset of cardinality 𝔠.

theorem not_countablyParacompactSpace : ¬CountablyParacompactSpace Niemytzki
Proof
:=
  isClosed_axis.not_countablyParacompactSpace_of_continuum_le_mk cardinal_axis.ge

theorem not_pseudocompactSpace

TopologyByExample.Niemytzki.not_pseudocompactSpace

The Niemytzki plane is not pseudocompact: the first coordinate is a continuous unbounded function.

theorem not_pseudocompactSpace : ¬PseudocompactSpace Niemytzki
Proof
:= by
  intro h
  obtain ⟨⟨M, hM⟩, -⟩ := h.bddAbove_and_bddBelow_range
    ⟨fun p ↦ p.toPlane.1, continuous_fst.comp continuous_toPlane⟩
  have := hM (mem_range_self (axisPt (M + 1)))
  simp only [ContinuousMap.coe_mk, toPlane_axisPt] at this
  linarith

On this site: The Niemytzki plane is not pseudocompact

theorem not_weaklyLocallyCompactSpace

TopologyByExample.Niemytzki.not_weaklyLocallyCompactSpace

The Niemytzki plane is not weakly locally compact: no point of the x-axis has a compact neighbourhood. If K were one at (0, 0), containing {(0, 0)} ∪ disc 0 r, then K \ ({(0, 0)} ∪ disc 0 (r / 2)) would be compact, hence compact and 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 Niemytzki
Proof
:= by
  intro h
  obtain ⟨K, hK, hKn⟩ := h.exists_compact_mem_nhds (axisPt 0)
  obtain ⟨r, hr, hrK⟩ := (hasBasis_nhds_axisPt 0).mem_iff.1 hKn
  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 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), ⟨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 (toPlane_injective ?_))
  rw [hp, toPlane_axisPt]

On this site: The Niemytzki plane is not weakly locally compact