Lean library · module TopologyByExample.Spaces.HalfDisc

The half-disc topology

Source file

In this file we define TopologyByExample.HalfDisc, the half-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 the part in the open upper half-plane of an open disc centred at (x, 0).

The type is a synonym of {p : ℝ × ℝ // 0 ≤ p.2} (HalfDisc.toPlane is the underlying point of the plane), and the topology is TopologicalSpace.mkOfNhds of the filters HalfDisc.nhdsFilter. The open half-disc of radius r at (x, 0) is HalfDisc.disc x r, the set of points (a, b) with (a - x) ^ 2 + b ^ 2 < r ^ 2 and b > 0. The development follows that of the Niemytzki plane (TopologyByExample.Spaces.NiemytzkiPlane), with half-discs in place of tangent discs.

The topology is finer than the Euclidean one, so the space is submetrizable, hence Hausdorff. The open upper half-plane is an open dense subspace with its Euclidean topology, so the space is separable and a Baire space; the half-discs of radius 1 / (n + 1) show that it is first countable; vertical segments from the x-axis show that it is path connected and locally path connected. The x-axis is a closed discrete subset of cardinality 𝔠. The closure of a basic neighbourhood of (x, 0) contains the whole diameter of its half-disc, so the space is not semiregular, and the first coordinate is an unbounded continuous function, so it is not pseudocompact.

Main definitions

Main statements

References

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

Tags

half-disc topology, 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 HalfDisc

TopologyByExample.HalfDisc

The half-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) has the neighbourhoods {(x, 0)} ∪ D, D the part in the open upper half-plane of an open disc centred at (x, 0).

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

On this site: Space: Half-disc topology

Points

definition toPlane

TopologyByExample.HalfDisc.toPlane

The point of the plane ℝ × ℝ underlying a point of the half-disc space.

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

theorem toPlane_injective

TopologyByExample.HalfDisc.toPlane_injective

Distinct points of the half-disc space lie over distinct points of the plane.

theorem toPlane_injective : Injective toPlane
Proof
:= Subtype.val_injective

theorem snd_nonneg

TopologyByExample.HalfDisc.snd_nonneg

Every point of the half-disc space has nonnegative second coordinate.

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

definition ofPlane

TopologyByExample.HalfDisc.ofPlane

The point of the half-disc space over (q.1, max q.2 0).

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

theorem toPlane_ofPlane

TopologyByExample.HalfDisc.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.HalfDisc.ofPlane_toPlane

ofPlane is a left inverse of toPlane.

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

definition axisPt

TopologyByExample.HalfDisc.axisPt

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

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

theorem toPlane_axisPt

TopologyByExample.HalfDisc.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 half-disc space is nonempty.

instance : Nonempty HalfDisc
Proof
:= ⟨axisPt 0⟩

definition axis

TopologyByExample.HalfDisc.axis

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

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

theorem eq_axisPt

TopologyByExample.HalfDisc.eq_axisPt

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

theorem eq_axisPt {p : HalfDisc} (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.HalfDisc.disc

The open half-disc of radius r at (x, 0): the points (a, b) with (a - x) ^ 2 + b ^ 2 < r ^ 2 and b > 0.

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

definition planeDisc

TopologyByExample.HalfDisc.planeDisc

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

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

theorem disc_eq_preimage

TopologyByExample.HalfDisc.disc_eq_preimage

The half-disc is the preimage of the half-disc in the plane.

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

theorem isOpen_planeDisc

TopologyByExample.HalfDisc.isOpen_planeDisc

The half-disc in the plane is open.

theorem isOpen_planeDisc (x r : ℝ) : IsOpen (planeDisc x r)
Proof
:=
  (isOpen_lt (f := fun q : ℝ × ℝ ↦ (q.1 - x) ^ 2 + q.2 ^ 2) (by fun_prop) continuous_const).inter
    (isOpen_lt continuous_const continuous_snd)

theorem pos_of_mem_disc

TopologyByExample.HalfDisc.pos_of_mem_disc

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

theorem pos_of_mem_disc {x r : ℝ} {p : HalfDisc} (hp : p ∈ disc x r) : 0 < p.toPlane.2
Proof
:= hp.2

theorem notMem_disc_of_mem_axis

TopologyByExample.HalfDisc.notMem_disc_of_mem_axis

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

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

theorem disc_mono

TopologyByExample.HalfDisc.disc_mono

Half-discs at the same point increase with the radius.

theorem disc_mono {x r s : ℝ} (hr : 0 ≤ r) (h : r ≤ s) : disc x r ⊆ disc x s
Proof
:= fun p hp ↦ by
  refine ⟨?_, hp.2⟩
  have := hp.1
  nlinarith

theorem ofPlane_mem_disc

TopologyByExample.HalfDisc.ofPlane_mem_disc

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

theorem ofPlane_mem_disc {x r t : ℝ} (ht : 0 < t) (htr : t < 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)]
  exact ⟨by nlinarith, ht⟩

theorem lt_of_mem_planeDisc

TopologyByExample.HalfDisc.lt_of_mem_planeDisc

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

theorem lt_of_mem_planeDisc {x r : ℝ} {q : ℝ × ℝ} (hq : q ∈ planeDisc x r) (hr : 0 ≤ r) :
    q.2 < r ∧ |q.1 - x| < r
Proof
:= by
  obtain ⟨h, hb⟩ := hq
  exact ⟨abs_lt_of_sq_lt_sq (by nlinarith [sq_nonneg (q.1 - x)]) hr |>.trans_le' (le_abs_self _),
    abs_lt_of_sq_lt_sq (by nlinarith [sq_nonneg q.2]) hr⟩

The topology

definition nhdsFilter

TopologyByExample.HalfDisc.nhdsFilter

The neighbourhood filter of a point of the half-disc space: 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 : HalfDisc) : Filter HalfDisc
:=
  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.HalfDisc.hasBasis_nhdsFilter_axis

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

theorem hasBasis_nhdsFilter_axis {p : HalfDisc} (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 (le_min hr.le hs.le) (by simp))

theorem preimage_mem_nhdsFilter

TopologyByExample.HalfDisc.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 : HalfDisc} (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 half-disc topology: its neighbourhood filters are the filters nhdsFilter.

instance : TopologicalSpace HalfDisc
Proof
:= .mkOfNhds nhdsFilter

theorem nhds_eq

TopologyByExample.HalfDisc.nhds_eq

The neighbourhood filters of the half-disc space are the filters nhdsFilter.

theorem nhds_eq (p : HalfDisc) : 𝓝 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 ↦ hq.2) 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.HalfDisc.nhds_of_ne_zero

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

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

theorem nhds_of_pos

TopologyByExample.HalfDisc.nhds_of_pos

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

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

theorem hasBasis_nhds_axisPt

TopologyByExample.HalfDisc.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.HalfDisc.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.HalfDisc.isOpen_disc

Every half-disc is open.

theorem isOpen_disc (x r : ℝ) : IsOpen (disc x r)
Proof
:=
  isOpen_preimage_toPlane (isOpen_planeDisc x r) fun _ hq ↦ hq.2

theorem isOpen_insert_disc

TopologyByExample.HalfDisc.isOpen_insert_disc

A half-disc of positive radius together with its centre 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.HalfDisc.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.HalfDisc.isClosed_axis

The x-axis is closed.

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

theorem continuous_toPlane

TopologyByExample.HalfDisc.continuous_toPlane

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

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ε ↦
      ⟨ε, hε, fun q hq ↦ ?_⟩
    rcases hq with rfl | hq
    · exact Metric.mem_ball_self hε
    · obtain ⟨h1, h2⟩ := lt_of_mem_planeDisc hq 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 h2 h1
  · rw [ContinuousAt, nhds_of_ne_zero hp]
    exact tendsto_comap

On this site: Half-disc topology: The topology is finer than the Euclidean topology

theorem continuousAt_ofPlane

TopologyByExample.HalfDisc.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.HalfDisc.t2Space

The half-disc space is Hausdorff, since its topology is finer than the Euclidean one.

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

theorem submetrizableSpace

TopologyByExample.HalfDisc.submetrizableSpace

The half-disc topology is submetrizable: it is finer than the Euclidean topology of the closed upper half-plane.

theorem submetrizableSpace : SubmetrizableSpace HalfDisc
Proof
:=
  @SubmetrizableSpace.of_le HalfDisc _ (instTopologicalSpaceSubtype : TopologicalSpace
    {p : ℝ × ℝ // 0 ≤ p.2}) (continuous_id_iff_le.1 (continuous_toPlane.subtype_mk _))
    (inferInstanceAs (SubmetrizableSpace {p : ℝ × ℝ // 0 ≤ p.2}))

On this site: Half-disc topology is submetrizable

theorem ofPlane_mem_disc_iff

TopologyByExample.HalfDisc.ofPlane_mem_disc_iff

ofPlane q lies in a half-disc iff q lies in the corresponding half-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.HalfDisc.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.HalfDisc.continuous_ofPlane_vertical

The vertical line t ↦ (x, max t 0) is continuous: as t decreases to 0, the point (x, t) enters every half-disc 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 hr] 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.HalfDisc.ofUpper

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

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

theorem toPlane_ofUpper

TopologyByExample.HalfDisc.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.HalfDisc.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.HalfDisc.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: Half-disc topology: The open half-plane is an open Euclidean subspace

theorem denseRange_ofUpper

TopologyByExample.HalfDisc.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 / 2), Or.inr (ofPlane_mem_disc (half_pos hr) (by linarith)), ?_⟩
    rw [range_ofUpper]
    simp [axis, toPlane_ofPlane (show 0 ≤ (x, r / 2).2 from (half_pos hr).le), hr.ne']
  · exact subset_closure (range_ofUpper ▸ hp)

Separability and first countability

theorem separableSpace

TopologyByExample.HalfDisc.separableSpace

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

theorem separableSpace : SeparableSpace HalfDisc
Proof
:=
  denseRange_ofUpper.separableSpace isOpenEmbedding_ofUpper.continuous

On this site: Half-disc topology is separable

theorem firstCountableTopology

TopologyByExample.HalfDisc.firstCountableTopology

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

theorem firstCountableTopology : FirstCountableTopology HalfDisc
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 (by positivity) 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: Half-disc topology is first countable

Path connectedness

theorem starConvex_planeDisc

TopologyByExample.HalfDisc.starConvex_planeDisc

A half-disc in the plane is star-convex about the point (x, r / 2).

theorem starConvex_planeDisc (x : ℝ) {r : ℝ} (hr : 0 < r) :
    StarConvex ℝ (x, r / 2) (planeDisc x r)
Proof
:= by
  intro q hq a b ha hb hab
  obtain rfl : a = 1 - b := by linarith
  obtain ⟨hq, hq2⟩ := hq
  have hc : (x - x) ^ 2 + (r / 2) ^ 2 ≤ r ^ 2 := by nlinarith
  simp only [planeDisc, mem_ofPred_eq, Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd,
    smul_eq_mul]
  refine ⟨?_, ?_⟩
  · rcases hb.eq_or_lt with rfl | hb'
    · simp only [sub_zero, one_mul, zero_mul, add_zero]
      nlinarith
    · nlinarith [mul_nonneg (mul_nonneg ha hb) (sq_nonneg (q.1 - x)),
        mul_nonneg (mul_nonneg ha hb) (sq_nonneg (q.2 - r / 2)), sq_nonneg (r / 2)]
  · rcases ha.eq_or_lt with h | h
    · have : b = 1 := by linarith
      subst this
      simpa using hq2
    · exact add_pos_of_pos_of_nonneg (mul_pos h (half_pos hr)) (mul_nonneg hb hq2.le)

theorem isPathConnected_disc

TopologyByExample.HalfDisc.isPathConnected_disc

Every half-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 / 2) ∈ planeDisc x r := ⟨by simp only [sub_self]; nlinarith, half_pos hr⟩
  convert ((starConvex_planeDisc x hr).isPathConnected hc).image'
    (continuousOn_ofPlane fun q hq ↦ hq.2)
  ext p
  constructor
  · intro hp
    exact ⟨p.toPlane, hp, ofPlane_toPlane p⟩
  · rintro ⟨q, hq, rfl⟩
    exact (ofPlane_mem_disc_iff hq.2.le).2 hq

theorem isPathConnected_insert_disc

TopologyByExample.HalfDisc.isPathConnected_insert_disc

A half-disc of positive radius together with its centre is path connected: the vertical segment from (x, 0) to (x, r / 2) 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 / 2) ∈ disc x r := ofPlane_mem_disc (half_pos hr) (by linarith)
  refine ⟨ofPlane (x, r / 2), mem_insert_of_mem _ hc, fun {y} hy ↦ ?_⟩
  rcases hy with rfl | hy
  · let γ : Path (axisPt x) (ofPlane (x, r / 2)) :=
      { toFun := fun t ↦ ofPlane (x, r / 2 * 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 / 2 * (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.HalfDisc.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)

theorem pathPreconnectedSpace

TopologyByExample.HalfDisc.pathPreconnectedSpace

The half-disc topology is path connected.

theorem pathPreconnectedSpace : PathPreconnectedSpace HalfDisc
Proof
:= by
  have key : ∀ p : HalfDisc, 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 (by norm_num : (0 : ℝ) < 1 / 2)
          (by norm_num)))).joined.trans (hup (x, 1 / 2) (by norm_num))
    · 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: Half-disc topology is path connected

theorem locallyPathConnectedSpace

TopologyByExample.HalfDisc.locallyPathConnectedSpace

The half-disc topology 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.

theorem locallyPathConnectedSpace : LocallyPathConnectedSpace HalfDisc
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.HalfDisc.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.HalfDisc.baireSpace

The half-disc topology 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 HalfDisc
Proof
:= by
  have := baireSpace_closedHalfPlane
  refine baireSpace_of_continuous_of_surjective
    (f := fun p : HalfDisc ↦ (⟨p.toPlane, p.snd_nonneg⟩ : {q : ℝ × ℝ // 0 ≤ q.2}))
    (continuous_toPlane.subtype_mk _) (fun q ↦ ⟨show HalfDisc 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 / 2), hrU (Or.inr (ofPlane_mem_disc (half_pos hr) (by linarith))), ?_⟩
      rw [toPlane_ofPlane (show 0 ≤ (x, r / 2).2 from (half_pos hr).le)]
      exact half_pos 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: Half-disc topology is a Baire space

The x-axis

theorem discreteTopology_axis

TopologyByExample.HalfDisc.discreteTopology_axis

The x-axis is discrete: as a subspace, 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)

theorem cardinal_axis

TopologyByExample.HalfDisc.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.HalfDisc.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: Half-disc topology: The axis is closed, discrete, of cardinality continuum

theorem exists_closed_discrete_continuum_le

TopologyByExample.HalfDisc.exists_closed_discrete_continuum_le

Some closed discrete subset has cardinality at least 𝔠: the x-axis.

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

On this site: Half-disc topology has a closed discrete subset of cardinality \(\mathfrak{c}\)

Negative properties

theorem not_pseudocompactSpace

TopologyByExample.HalfDisc.not_pseudocompactSpace

The half-disc topology is not pseudocompact: the first coordinate is a continuous unbounded function.

theorem not_pseudocompactSpace : ¬PseudocompactSpace HalfDisc
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: Half-disc topology is not pseudocompact

theorem insert_disc_subset_closure

TopologyByExample.HalfDisc.insert_disc_subset_closure

The closure of a basic neighbourhood of a point of the axis contains the diameter of its half-disc, and indeed a basic neighbourhood of each point of it: for |a - x| < r, the point (a, 0) is the limit of the points (a, t) of disc x r, and a small half-disc at (a, 0) lies inside disc x r.

theorem insert_disc_subset_closure {x r a : ℝ} (ha : |a - x| < r) :
    ∃ s > 0, insert (axisPt a) (disc a s) ⊆ closure (insert (axisPt x) (disc x r))
Proof
:= by
  have hr : 0 < r := (abs_nonneg _).trans_lt ha
  set s := (r - |a - x|) / 2
  have hs : 0 < s := by simp only [s]; linarith
  have hsub : disc a s ⊆ disc x r := by
    intro p hp
    refine ⟨?_, hp.2⟩
    obtain ⟨h, hb⟩ := hp
    have h1 : |p.toPlane.1 - a| < s := abs_lt_of_sq_lt_sq (by nlinarith) hs.le
    have h2 : p.toPlane.2 < s := abs_lt_of_sq_lt_sq (by nlinarith) hs.le |>.trans_le'
      (le_abs_self _)
    have h3 : |p.toPlane.1 - x| < (r + |a - x|) / 2 := by
      calc |p.toPlane.1 - x| = |(p.toPlane.1 - a) + (a - x)| := by ring_nf
        _ ≤ |p.toPlane.1 - a| + |a - x| := abs_add_le _ _
        _ < (r + |a - x|) / 2 := by simp only [s] at h1; linarith
    have h4 : (p.toPlane.1 - x) ^ 2 < ((r + |a - x|) / 2) ^ 2 := by
      rw [← sq_abs]; exact pow_lt_pow_left₀ h3 (abs_nonneg _) two_ne_zero
    have h5 : p.toPlane.2 ^ 2 < s ^ 2 := pow_lt_pow_left₀ h2 hb.le two_ne_zero
    have h6 : |a - x| ^ 2 < r ^ 2 := pow_lt_pow_left₀ ha (abs_nonneg _) two_ne_zero
    simp only [s] at h5
    nlinarith [sq_abs (a - x)]
  refine ⟨s, hs, insert_subset ?_ ((hsub.trans (subset_insert _ _)).trans subset_closure)⟩
  -- `(a, 0)` is the limit of the points `(a, t)`, `t → 0⁺`, of `disc a s`
  have hc := (continuous_ofPlane_vertical a).tendsto 0
  have h0 : ofPlane (a, 0) = axisPt a := rfl
  rw [← h0]
  refine mem_closure_of_tendsto (hc.mono_left (nhdsWithin_le_nhds (s := Ioi 0))) ?_
  filter_upwards [Ioo_mem_nhdsGT hs] with t ht
  exact Or.inr (hsub (ofPlane_mem_disc ht.1 ht.2))

theorem not_semiregularSpace

TopologyByExample.HalfDisc.not_semiregularSpace

The half-disc topology is not semiregular. A regular open set containing (0, 0) contains a basic neighbourhood {(0, 0)} ∪ disc 0 r, hence the interior of its closure, which contains the point (r / 2, 0); so it does not lie in {(0, 0)} ∪ disc 0 1.

theorem not_semiregularSpace : ¬SemiregularSpace HalfDisc
Proof
:= by
  intro h
  obtain ⟨V, hVreg, hpV, hVW⟩ := h.isTopologicalBasis.exists_subset_of_mem_open
    (mem_insert (axisPt 0) (disc 0 1)) (isOpen_insert_disc 0 one_pos)
  have hVreg' : interior (closure V) = V := hVreg
  have hVo : IsOpen V := hVreg' ▸ isOpen_interior
  obtain ⟨r, hr, hrV⟩ := (hasBasis_nhds_axisPt 0).mem_iff.1 (hVo.mem_nhds hpV)
  set a := min (r / 2) (1 / 2)
  have ha : 0 < a := lt_min (half_pos hr) one_half_pos
  have har : |a - 0| < r := by
    rw [sub_zero, abs_of_pos ha]; linarith [min_le_left (r / 2) (1 / 2)]
  obtain ⟨s, hs, hsub⟩ := insert_disc_subset_closure har
  have hmem : axisPt a ∈ V := by
    rw [← hVreg']
    exact interior_maximal (hsub.trans (closure_mono hrV)) (isOpen_insert_disc a hs)
      (mem_insert _ _)
  rcases hVW hmem with h | h
  · have := congrArg (fun p ↦ p.toPlane.1) h
    simp only [toPlane_axisPt] at this
    exact ha.ne' this
  · exact notMem_disc_of_mem_axis (by simp [axis]) h

On this site: Half-disc topology is not semiregular