Lean library · module TopologyByExample.Spaces.IrrationalSlope

The irrational slope topology

Source file

Bing's countable connected Hausdorff space. Its points are the rational points (x, y) of the closed upper half-plane, y ≥ 0. Fix the irrational slope θ = √3. Each point p = (x, y) has two projections on the horizontal axis, the points x - y / θ and x + y / θ where the lines through p of slopes θ and -θ meet the axis (both are x when y = 0). A basic neighbourhood of p consists of p together with the rational points of the axis within ε of one of its projections.

Main definitions

Main statements

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports

definition slope

TopologyByExample.slope

The slope of the irrational slope topology, θ = √3.

noncomputable def slope : ℝ
:= √3

theorem slope_pos

TopologyByExample.slope_pos

theorem slope_pos : 0 < slope
Proof
:= Real.sqrt_pos.2 (by norm_num)

theorem irrational_slope

TopologyByExample.irrational_slope

theorem irrational_slope : Irrational slope
Proof
:= by
  simpa [slope] using Nat.prime_three.irrational_sqrt

theorem eq_zero_of_eq_div_slope

TopologyByExample.eq_zero_of_eq_div_slope

If a = b / θ for rationals a and b, then a = b = 0.

theorem eq_zero_of_eq_div_slope {a b : ℚ} (h : (a : ℝ) = b / slope) : a = 0 ∧ b = 0
Proof
:= by
  have hs := slope_pos.ne'
  by_cases hb : b = 0
  · subst hb
    simpa using h
  · have ha : a ≠ 0 := by
      rintro rfl
      have h' : (b : ℝ) = 0 ∨ slope = 0 := by simpa using h.symm
      rcases h' with h' | h'
      · exact hb (by exact_mod_cast h')
      · exact hs h'
    exfalso
    refine irrational_slope ⟨b / a, ?_⟩
    push_cast
    rw [h]
    field_simp

definition IrrationalSlope

TopologyByExample.IrrationalSlope

The points of the irrational slope topology: the rational points of the closed upper half-plane.

def IrrationalSlope : Type
:= {p : ℚ × ℚ // 0 ≤ p.2}

On this site: Space: Irrational slope topology

definition x

TopologyByExample.IrrationalSlope.x

The first coordinate.

def x (p : IrrationalSlope) : ℚ
:= p.val.1

definition y

TopologyByExample.IrrationalSlope.y

The second coordinate.

def y (p : IrrationalSlope) : ℚ
:= p.val.2

theorem y_nonneg

TopologyByExample.IrrationalSlope.y_nonneg

theorem y_nonneg (p : IrrationalSlope) : 0 ≤ p.y
Proof
:= p.property

definition mk

TopologyByExample.IrrationalSlope.mk

The point with coordinates a and b ≥ 0.

def mk (a b : ℚ) (hb : 0 ≤ b) : IrrationalSlope
:= ⟨(a, b), hb⟩

theorem x_mk

TopologyByExample.IrrationalSlope.x_mk

@[simp] theorem x_mk (a b : ℚ) (hb : 0 ≤ b) : (mk a b hb).x = a
Proof
:= rfl

theorem y_mk

TopologyByExample.IrrationalSlope.y_mk

@[simp] theorem y_mk (a b : ℚ) (hb : 0 ≤ b) : (mk a b hb).y = b
Proof
:= rfl

theorem ext

TopologyByExample.IrrationalSlope.ext

theorem ext {p q : IrrationalSlope} (hx : p.x = q.x) (hy : p.y = q.y) : p = q
Proof
:=
  Subtype.ext (Prod.ext hx hy)

instance

The space is countable.

instance : Countable IrrationalSlope
Proof
:= inferInstanceAs (Countable {p : ℚ × ℚ // 0 ≤ p.2})

definition top

TopologyByExample.IrrationalSlope.top

The point (0, 1).

def top : IrrationalSlope
:= mk 0 1 zero_le_one

instance

The space is nonempty.

instance : Nonempty IrrationalSlope
Proof
:= ⟨top⟩

definition proj

TopologyByExample.IrrationalSlope.proj

The two projections of a point on the axis: x - y / θ (for false) and x + y / θ (for true).

noncomputable def proj (p : IrrationalSlope) : Bool → ℝ
  | false => p.x - p.y / slope
  | true => p.x + p.y / slope

theorem proj_of_y_eq_zero

TopologyByExample.IrrationalSlope.proj_of_y_eq_zero

theorem proj_of_y_eq_zero {p : IrrationalSlope} (hp : p.y = 0) (i : Bool) : p.proj i = p.x
Proof
:= by
  cases i <;> simp [proj, hp]

theorem proj_false_le_proj_true

TopologyByExample.IrrationalSlope.proj_false_le_proj_true

theorem proj_false_le_proj_true (p : IrrationalSlope) : p.proj false ≤ p.proj true
Proof
:= by
  have := div_nonneg (Rat.cast_nonneg.2 p.y_nonneg) slope_pos.le
  simp only [proj]
  linarith

theorem eq_of_proj_eq

TopologyByExample.IrrationalSlope.eq_of_proj_eq

Distinct points have distinct projections: if a projection of p equals one of q, then p = q.

theorem eq_of_proj_eq {p q : IrrationalSlope} {i j : Bool} (h : p.proj i = q.proj j) : p = q
Proof
:= by
  have hp := p.y_nonneg
  have hq := q.y_nonneg
  cases i <;> cases j <;> simp only [proj] at h
  · obtain ⟨h1, h2⟩ := eq_zero_of_eq_div_slope (a := p.x - q.x) (b := p.y - q.y)
      (by push_cast; rw [sub_div]; linarith)
    exact ext (by linarith) (by linarith)
  · obtain ⟨h1, h2⟩ := eq_zero_of_eq_div_slope (a := p.x - q.x) (b := p.y + q.y)
      (by push_cast; rw [add_div]; linarith)
    exact ext (by linarith) (by linarith)
  · obtain ⟨h1, h2⟩ := eq_zero_of_eq_div_slope (a := q.x - p.x) (b := p.y + q.y)
      (by push_cast; rw [add_div]; linarith)
    exact ext (by linarith) (by linarith)
  · obtain ⟨h1, h2⟩ := eq_zero_of_eq_div_slope (a := q.x - p.x) (b := p.y - q.y)
      (by push_cast; rw [sub_div]; linarith)
    exact ext (by linarith) (by linarith)

definition nhd

TopologyByExample.IrrationalSlope.nhd

The basic neighbourhood of p of radius ε: the point p together with the points of the axis within ε of a projection of p.

def nhd (p : IrrationalSlope) (ε : ℝ) : Set IrrationalSlope
:=
  {q | q = p ∨ q.y = 0 ∧ ∃ i, |(q.x : ℝ) - p.proj i| < ε}

theorem mem_nhd_self

TopologyByExample.IrrationalSlope.mem_nhd_self

theorem mem_nhd_self (p : IrrationalSlope) (ε : ℝ) : p ∈ nhd p ε
Proof
:= Or.inl rfl

theorem nhd_mono

TopologyByExample.IrrationalSlope.nhd_mono

theorem nhd_mono {p : IrrationalSlope} {ε δ : ℝ} (h : ε ≤ δ) : nhd p ε ⊆ nhd p δ
Proof
:= by
  rintro q (rfl | ⟨hq, i, hi⟩)
  · exact Or.inl rfl
  · exact Or.inr ⟨hq, i, hi.trans_le h⟩

theorem mem_nhd_of_y_eq_zero

TopologyByExample.IrrationalSlope.mem_nhd_of_y_eq_zero

An axis point within ε of a projection of p lies in nhd p ε.

theorem mem_nhd_of_y_eq_zero {p q : IrrationalSlope} {ε : ℝ} (hq : q.y = 0) {i : Bool}
    (h : |(q.x : ℝ) - p.proj i| < ε) : q ∈ nhd p ε
Proof
:=
  Or.inr ⟨hq, i, h⟩

instance instTopologicalSpace

TopologyByExample.IrrationalSlope.instTopologicalSpace

A set is open if it contains a basic neighbourhood of each of its points.

instance instTopologicalSpace : TopologicalSpace IrrationalSlope
Proof
where
  IsOpen U := ∀ p ∈ U, ∃ ε > 0, nhd p ε ⊆ U
  isOpen_univ p _ := ⟨1, one_pos, subset_univ _⟩
  isOpen_inter s t hs ht p hp := by
    obtain ⟨ε, hε, hεs⟩ := hs p hp.1
    obtain ⟨δ, hδ, hδt⟩ := ht p hp.2
    exact ⟨min ε δ, lt_min hε hδ, fun q hq ↦
      ⟨hεs (nhd_mono (min_le_left _ _) hq), hδt (nhd_mono (min_le_right _ _) hq)⟩⟩
  isOpen_sUnion S hS p := by
    rintro ⟨t, ht, hp⟩
    obtain ⟨ε, hε, hεt⟩ := hS t ht p hp
    exact ⟨ε, hε, hεt.trans (subset_sUnion_of_mem ht)⟩

theorem isOpen_iff

TopologyByExample.IrrationalSlope.isOpen_iff

theorem isOpen_iff {U : Set IrrationalSlope} : IsOpen U ↔ ∀ p ∈ U, ∃ ε > 0, nhd p ε ⊆ U
Proof
:=
  Iff.rfl

theorem nhd_of_y_eq_zero

TopologyByExample.IrrationalSlope.nhd_of_y_eq_zero

For an axis point q, nhd q δ is the set of axis points within δ of q.

theorem nhd_of_y_eq_zero {q : IrrationalSlope} (hq : q.y = 0) (δ : ℝ) (hδ : 0 < δ) :
    nhd q δ = {r | r.y = 0 ∧ |(r.x : ℝ) - q.x| < δ}
Proof
:= by
  ext r
  simp only [nhd, mem_ofPred_eq, proj_of_y_eq_zero hq, exists_const]
  constructor
  · rintro (rfl | h)
    · exact ⟨hq, by simpa using hδ⟩
    · exact h
  · exact Or.inr

theorem isOpen_nhd

TopologyByExample.IrrationalSlope.isOpen_nhd

The basic neighbourhoods are open.

theorem isOpen_nhd (p : IrrationalSlope) {ε : ℝ} (hε : 0 < ε) : IsOpen (nhd p ε)
Proof
:= by
  rintro q (rfl | ⟨hq, i, hi⟩)
  · exact ⟨ε, hε, subset_rfl⟩
  · refine ⟨ε - |(q.x : ℝ) - q.proj i - (p.proj i - q.proj i)|, ?_, ?_⟩
    · rw [proj_of_y_eq_zero hq]; simpa using hi
    · rw [nhd_of_y_eq_zero hq _ (by rw [proj_of_y_eq_zero hq]; simpa using hi)]
      rintro r ⟨hr, hrq⟩
      refine mem_nhd_of_y_eq_zero hr (i := i) ?_
      rw [proj_of_y_eq_zero hq] at hrq
      simp only [sub_sub_sub_cancel_right] at hrq
      calc |(r.x : ℝ) - p.proj i| ≤ |(r.x : ℝ) - q.x| + |(q.x : ℝ) - p.proj i| :=
            abs_sub_le _ _ _
        _ < ε := by linarith

theorem hasBasis_nhds

TopologyByExample.IrrationalSlope.hasBasis_nhds

The basic neighbourhoods of p form a neighbourhood base at p.

theorem hasBasis_nhds (p : IrrationalSlope) : (𝓝 p).HasBasis (fun ε : ℝ ↦ 0 < ε) (nhd p)
Proof
:= by
  refine ⟨fun t ↦ ⟨fun ht ↦ ?_, fun ⟨ε, hε, hεt⟩ ↦
    mem_of_superset ((isOpen_nhd p hε).mem_nhds (mem_nhd_self p ε)) hεt⟩⟩
  obtain ⟨U, hUt, hU, hpU⟩ := mem_nhds_iff.1 ht
  obtain ⟨ε, hε, hεU⟩ := hU p hpU
  exact ⟨ε, hε, hεU.trans hUt⟩

instance

The space is first countable.

instance : FirstCountableTopology IrrationalSlope
Proof
:= by
  refine ⟨fun p ↦ ?_⟩
  have h : (𝓝 p).HasBasis (fun _ : ℕ ↦ True) (fun n ↦ nhd p (1 / ((n : ℝ) + 1))) :=
    (hasBasis_nhds p).to_hasBasis (fun ε hε ↦ by
        obtain ⟨n, hn⟩ := exists_nat_one_div_lt hε
        exact ⟨n, trivial, nhd_mono hn.le⟩)
      fun n _ ↦ ⟨1 / ((n : ℝ) + 1), Nat.one_div_pos_of_nat, subset_rfl⟩
  exact h.isCountablyGenerated

instance

The space is second countable.

instance : SecondCountableTopology IrrationalSlope
Proof
:= inferInstance

instance

Distinct points have disjoint basic neighbourhoods: those of radius half the least distance between a projection of one and a projection of the other.

instance : T2Space IrrationalSlope
Proof
:= by
  refine ⟨fun p q hpq ↦ ?_⟩
  have hpos : ∀ i j, 0 < |p.proj i - q.proj j| := fun i j ↦
    abs_pos.2 (sub_ne_zero.2 fun h ↦ hpq (eq_of_proj_eq h))
  set D := min (min |p.proj false - q.proj false| |p.proj false - q.proj true|)
    (min |p.proj true - q.proj false| |p.proj true - q.proj true|)
  have hD : 0 < D := lt_min (lt_min (hpos _ _) (hpos _ _)) (lt_min (hpos _ _) (hpos _ _))
  have hle : ∀ i j, D ≤ |p.proj i - q.proj j| := by
    intro i j
    cases i <;> cases j
    · exact (min_le_left _ _).trans (min_le_left _ _)
    · exact (min_le_left _ _).trans (min_le_right _ _)
    · exact (min_le_right _ _).trans (min_le_left _ _)
    · exact (min_le_right _ _).trans (min_le_right _ _)
  refine ⟨nhd p (D / 2), nhd q (D / 2), isOpen_nhd p (by positivity),
    isOpen_nhd q (by positivity), mem_nhd_self _ _, mem_nhd_self _ _, ?_⟩
  refine disjoint_left.2 fun r hrp hrq ↦ ?_
  -- In each case some projection of `p` is within `D` of some projection of `q`.
  obtain ⟨i, j, hij⟩ : ∃ i j, |p.proj i - q.proj j| < D := by
    rcases hrp with rfl | ⟨hr, i, hi⟩ <;> rcases hrq with h | ⟨hr', j, hj⟩
    · exact absurd h hpq
    · refine ⟨false, j, ?_⟩
      rw [proj_of_y_eq_zero hr']
      linarith
    · subst h
      refine ⟨i, false, ?_⟩
      rw [proj_of_y_eq_zero hr, abs_sub_comm]
      linarith
    · refine ⟨i, j, ?_⟩
      calc |p.proj i - q.proj j| ≤ |p.proj i - r.x| + |(r.x : ℝ) - q.proj j| := abs_sub_le _ _ _
        _ < D := by rw [abs_sub_comm] at hi; linarith
  exact (hle i j).not_gt hij

Closures

theorem mem_closure_nhd

TopologyByExample.IrrationalSlope.mem_closure_nhd

A point one of whose projections is within ε of a projection of p lies in the closure of nhd p ε.

theorem mem_closure_nhd {p q : IrrationalSlope} {ε : ℝ} {i j : Bool}
    (h : |q.proj j - p.proj i| < ε) : q ∈ closure (nhd p ε)
Proof
:= by
  refine (mem_closure_iff_nhds_basis' (hasBasis_nhds q)).2 fun δ hδ ↦ ?_
  have hlo : max (q.proj j - δ) (p.proj i - ε) < min (q.proj j + δ) (p.proj i + ε) := by
    rw [abs_lt] at h
    refine max_lt (lt_min ?_ ?_) (lt_min ?_ ?_) <;> linarith
  obtain ⟨r, hr1, hr2⟩ := exists_rat_btwn hlo
  refine ⟨mk r 0 le_rfl, mem_nhd_of_y_eq_zero rfl (i := j) ?_,
    mem_nhd_of_y_eq_zero rfl (i := i) ?_⟩
  · rw [abs_lt]; simp only [x_mk]
    constructor <;> linarith [le_max_left (q.proj j - δ) (p.proj i - ε),
      min_le_left (q.proj j + δ) (p.proj i + ε)]
  · rw [abs_lt]; simp only [x_mk]
    constructor <;> linarith [le_max_right (q.proj j - δ) (p.proj i - ε),
      min_le_right (q.proj j + δ) (p.proj i + ε)]

On this site: Irrational slope topology: The closure of a basic neighbourhood contains strips

theorem exists_proj_near

TopologyByExample.IrrationalSlope.exists_proj_near

For reals α ≤ β and η > 0 there is a point whose projections are within η of α and β.

theorem exists_proj_near {α β η : ℝ} (hαβ : α ≤ β) (hη : 0 < η) :
    ∃ q : IrrationalSlope, |q.proj false - α| < η ∧ |q.proj true - β| < η
Proof
:= by
  have hs := slope_pos
  obtain ⟨v, hv1, hv2⟩ := exists_rat_btwn
    (show slope * (β - α) / 2 < slope * (β - α) / 2 + slope * η / 2 by
      have : 0 < slope * η / 2 := by positivity
      linarith)
  obtain ⟨u, hu1, hu2⟩ := exists_rat_btwn
    (show (α + β) / 2 - η / 2 < (α + β) / 2 + η / 2 by linarith)
  have hv0 : (0 : ℝ) ≤ v := le_of_lt (lt_of_le_of_lt (by
    have : 0 ≤ β - α := by linarith
    positivity) hv1)
  refine ⟨mk u v (by exact_mod_cast hv0), ?_, ?_⟩
  · -- `v / θ` is within `η / 2` of `(β - α) / 2`.
    have h1 : (β - α) / 2 < v / slope := by
      rw [lt_div_iff₀ hs]; linarith
    have h2 : (v : ℝ) / slope < (β - α) / 2 + η / 2 := by
      rw [div_lt_iff₀ hs]; linarith
    simp only [proj, x_mk, y_mk]
    rw [abs_lt]; constructor <;> linarith
  · have h1 : (β - α) / 2 < v / slope := by
      rw [lt_div_iff₀ hs]; linarith
    have h2 : (v : ℝ) / slope < (β - α) / 2 + η / 2 := by
      rw [div_lt_iff₀ hs]; linarith
    simp only [proj, x_mk, y_mk]
    rw [abs_lt]; constructor <;> linarith

theorem closure_inter_closure_nonempty

TopologyByExample.IrrationalSlope.closure_inter_closure_nonempty

The closures of any two nonempty open sets meet.

theorem closure_inter_closure_nonempty (U V : Set IrrationalSlope) (hU : IsOpen U)
    (hV : IsOpen V) (hU' : U.Nonempty) (hV' : V.Nonempty) : (closure U ∩ closure V).Nonempty
Proof
:= by
  obtain ⟨p, hp⟩ := hU'
  obtain ⟨p', hp'⟩ := hV'
  obtain ⟨ε, hε, hεU⟩ := hU p hp
  obtain ⟨δ, hδ, hδV⟩ := hV p' hp'
  have hU2 : closure (nhd p (min ε δ)) ⊆ closure U :=
    closure_mono ((nhd_mono (min_le_left _ _)).trans hεU)
  have hV2 : closure (nhd p' (min ε δ)) ⊆ closure V :=
    closure_mono ((nhd_mono (min_le_right _ _)).trans hδV)
  rcases le_total (p.proj false) (p'.proj false) with h | h
  · obtain ⟨q, hq1, hq2⟩ := exists_proj_near h (lt_min hε hδ)
    exact ⟨q, hU2 (mem_closure_nhd hq1), hV2 (mem_closure_nhd hq2)⟩
  · obtain ⟨q, hq1, hq2⟩ := exists_proj_near h (lt_min hε hδ)
    exact ⟨q, hU2 (mem_closure_nhd hq2), hV2 (mem_closure_nhd hq1)⟩

On this site: Irrational slope topology: The closures of any two nonempty open sets meet

instance

The space is preconnected.

instance : PreconnectedSpace IrrationalSlope
Proof
:=
  (preconnectedSpace_and_not_t25_of_closure_inter_closure closure_inter_closure_nonempty).1

theorem not_t25Space

TopologyByExample.IrrationalSlope.not_t25Space

The space is not Urysohn.

theorem not_t25Space : ¬T25Space IrrationalSlope
Proof
:= fun h ↦ by
  have := (preconnectedSpace_and_not_t25_of_closure_inter_closure
    closure_inter_closure_nonempty).2.2 h
  have h' := Subsingleton.elim top (mk 0 0 le_rfl)
  have := congrArg y h'
  simp [top] at this

On this site: The irrational slope topology is not Urysohn

theorem exists_ne_mem_nhd

TopologyByExample.IrrationalSlope.exists_ne_mem_nhd

Every basic neighbourhood of p contains a point other than p.

theorem exists_ne_mem_nhd (p : IrrationalSlope) {ε : ℝ} (hε : 0 < ε) :
    ∃ q ∈ nhd p ε, q ≠ p
Proof
:= by
  obtain ⟨r, hr1, hr2⟩ := exists_rat_btwn (show p.proj false < p.proj false + ε by linarith)
  refine ⟨mk r 0 le_rfl, mem_nhd_of_y_eq_zero rfl (i := false) ?_, fun h ↦ ?_⟩
  · rw [abs_lt]; simp only [x_mk]; constructor <;> linarith
  · have hy : p.y = 0 := by rw [← h]; rfl
    have hx : p.x = r := by rw [← h]; rfl
    rw [proj_of_y_eq_zero hy, hx] at hr1
    exact lt_irrefl _ hr1

theorem not_hasIsolatedPoint

TopologyByExample.IrrationalSlope.not_hasIsolatedPoint

No point is isolated.

theorem not_hasIsolatedPoint : ¬HasIsolatedPoint IrrationalSlope
Proof
:= by
  rintro ⟨p, hp⟩
  obtain ⟨ε, hε, hεp⟩ := hp p rfl
  obtain ⟨q, hq, hqp⟩ := exists_ne_mem_nhd p hε
  exact hqp (hεp hq)

On this site: The irrational slope topology has no isolated point

Local connectedness and semiregularity

theorem top_y

TopologyByExample.IrrationalSlope.top_y

theorem top_y : top.y = 1
Proof
:= rfl

theorem y_eq_zero_of_mem_nhd_top

TopologyByExample.IrrationalSlope.y_eq_zero_of_mem_nhd_top

The points of nhd top ε other than top lie on the axis.

theorem y_eq_zero_of_mem_nhd_top {q : IrrationalSlope} {ε : ℝ} (hq : q ∈ nhd top ε)
    (hne : q ≠ top) : q.y = 0
Proof
:= by
  rcases hq with rfl | ⟨hq, -⟩
  · exact absurd rfl hne
  · exact hq

theorem not_locallyConnectedSpace

TopologyByExample.IrrationalSlope.not_locallyConnectedSpace

The space is not locally connected: an open set V with top ∈ V ⊆ nhd top 1 splits at an irrational number just below the left projection of top into the axis points of V to the left of it, and the rest.

theorem not_locallyConnectedSpace : ¬LocallyConnectedSpace IrrationalSlope
Proof
:= by
  intro hlc
  obtain ⟨V, hVW, hVo, htV, hVc⟩ :=
    (locallyConnectedSpace_iff_subsets_isOpen_isConnected.1 hlc) top (nhd top 1)
      ((isOpen_nhd top one_pos).mem_nhds (mem_nhd_self _ _))
  obtain ⟨δ, hδ, hδV⟩ := hVo top htV
  set a := top.proj false
  obtain ⟨c, hc, hc1, hc2⟩ := exists_irrational_btwn (show a - δ < a by linarith)
  have hxc : ∀ q : IrrationalSlope, (q.x : ℝ) ≠ c := fun q h ↦ hc ⟨q.x, h⟩
  -- The two open sets.
  set u : Set IrrationalSlope := {q | q.y = 0 ∧ (q.x : ℝ) < c}
  set v : Set IrrationalSlope := {q | q = top ∨ q.y = 0 ∧ c < (q.x : ℝ)}
  have hu : IsOpen u := by
    rintro q ⟨hq, hqc⟩
    refine ⟨c - q.x, by linarith, ?_⟩
    rw [nhd_of_y_eq_zero hq _ (by linarith)]
    rintro r ⟨hr, hrq⟩
    exact ⟨hr, by rw [abs_lt] at hrq; linarith⟩
  have hv : IsOpen v := by
    rintro q (rfl | ⟨hq, hqc⟩)
    · refine ⟨a - c, by linarith, ?_⟩
      rintro r (rfl | ⟨hr, i, hi⟩)
      · exact Or.inl rfl
      · refine Or.inr ⟨hr, ?_⟩
        have hle : a ≤ top.proj i := by cases i <;> simp [a, top.proj_false_le_proj_true]
        rw [abs_lt] at hi
        linarith
    · refine ⟨q.x - c, by linarith, ?_⟩
      rw [nhd_of_y_eq_zero hq _ (by linarith)]
      rintro r ⟨hr, hrq⟩
      exact Or.inr ⟨hr, by rw [abs_lt] at hrq; linarith⟩
  have hsub : V ⊆ u ∪ v := by
    intro q hq
    by_cases hqt : q = top
    · exact Or.inr (Or.inl hqt)
    · have hy := y_eq_zero_of_mem_nhd_top (hVW hq) hqt
      rcases lt_or_gt_of_ne (hxc q) with h | h
      · exact Or.inl ⟨hy, h⟩
      · exact Or.inr (Or.inr ⟨hy, h⟩)
  obtain ⟨r, hr1, hr2⟩ := exists_rat_btwn hc1
  have hru : (mk r 0 le_rfl) ∈ V ∩ u := by
    refine ⟨hδV (mem_nhd_of_y_eq_zero rfl (i := false) ?_), rfl, hr2⟩
    rw [abs_lt]; simp only [x_mk]; constructor <;> linarith
  obtain ⟨w, -, hwu, hwv⟩ := hVc.isPreconnected u v hu hv hsub ⟨_, hru⟩ ⟨top, htV, Or.inl rfl⟩
  rcases hwv with rfl | ⟨-, hwc⟩
  · exact absurd hwu.1 (by simp [top_y])
  · exact absurd hwu.2 (not_lt.2 hwc.le)

On this site: The irrational slope topology is not locally connected

definition shifted

TopologyByExample.IrrationalSlope.shifted

The point (η, 1).

def shifted (η : ℚ) : IrrationalSlope
:= mk η 1 zero_le_one

theorem proj_shifted

TopologyByExample.IrrationalSlope.proj_shifted

theorem proj_shifted (η : ℚ) (i : Bool) : (shifted η).proj i = top.proj i + η
Proof
:= by
  cases i <;> simp [proj, shifted, top] <;> ring

theorem not_semiregularSpace

TopologyByExample.IrrationalSlope.not_semiregularSpace

The space is not semiregular: a regular open set V with top ∈ V ⊆ nhd top 1 contains a basic neighbourhood nhd top δ, and the interior of the closure of nhd top δ contains the point (η, 1) for small η > 0, which is not in nhd top 1.

theorem not_semiregularSpace : ¬SemiregularSpace IrrationalSlope
Proof
:= by
  intro h
  rw [semiregularSpace_iff_isRegularOpen] at h
  obtain ⟨V, hV, htV, hVW⟩ :=
    h.exists_subset_of_mem_open (mem_nhd_self top 1) (isOpen_nhd top one_pos)
  obtain ⟨δ, hδ, hδV⟩ := hV.isOpen top htV
  obtain ⟨η, hη1, hη2⟩ := exists_rat_btwn (show (0 : ℝ) < δ / 2 by positivity)
  have hsub : nhd (shifted η) (δ / 2) ⊆ closure (nhd top δ) := by
    rintro q (rfl | ⟨hq, i, hi⟩)
    · refine mem_closure_nhd (i := false) (j := false) ?_
      rw [proj_shifted, add_sub_cancel_left, abs_of_pos hη1]
      linarith
    · refine subset_closure (mem_nhd_of_y_eq_zero hq (i := i) ?_)
      rw [proj_shifted] at hi
      calc |(q.x : ℝ) - top.proj i| ≤ |(q.x : ℝ) - (top.proj i + η)| + |(η : ℝ)| := by
            have e : (q.x : ℝ) - top.proj i = ((q.x : ℝ) - (top.proj i + η)) + η := by ring
            rw [e]
            exact abs_add_le _ _
        _ < δ := by rw [abs_of_pos hη1]; linarith
  have hmem : shifted η ∈ V := by
    rw [← isRegularOpen_iff.1 hV]
    refine interior_maximal (hsub.trans (closure_mono hδV)) (isOpen_nhd _ (by positivity))
      (mem_nhd_self _ _)
  have hne : shifted η ≠ top := by
    intro he
    have hx : η = 0 := congrArg x he
    exact hη1.ne' (by exact_mod_cast hx)
  have := y_eq_zero_of_mem_nhd_top (hVW hmem) hne
  simp [shifted] at this

On this site: The irrational slope topology is not semiregular