Lean library · module TopologyByExample.Spaces.SimplifiedArensSquare

The simplified Arens square

Source file

In this file we define TopologyByExample.SimplifiedArensSquare, the open unit square (0, 1) × (0, 1) together with the two corners (0, 0) and (1, 0). The points of the open square have their Euclidean neighbourhoods; a basic neighbourhood of (0, 0) is the corner together with the points of the open square with x < 1/2 and y < ε, and one of (1, 0) is the corner together with those with 1/2 < x and y < ε.

The space is Hausdorff but not Urysohn: the closures of the basic neighbourhoods of the two corners both contain the points (1/2, y) with y small. So every continuous map from it to a Urysohn space takes the same value at the two corners. The identity map from the same set with the Euclidean topology is continuous, which makes the space path connected, locally path connected and σ-compact; it is second countable, semiregular, of second category and not pseudocompact.

Main definitions

Main statements

Tags

simplified Arens square, Urysohn space, T₂½, semiregular, 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 simplifiedArensSet

TopologyByExample.simplifiedArensSet

The points of the simplified Arens square in the plane: the open unit square and the two corners (0, 0) and (1, 0).

def simplifiedArensSet : Set (ℝ × ℝ)
:=
  {p | p = (0, 0) ∨ p = (1, 0) ∨ (0 < p.1 ∧ p.1 < 1 ∧ 0 < p.2 ∧ p.2 < 1)}

definition SimplifiedArensSquare

TopologyByExample.SimplifiedArensSquare

The simplified Arens square.

def SimplifiedArensSquare : Type
:= ↥simplifiedArensSet

On this site: Space: Simplified Arens square

definition left

TopologyByExample.SimplifiedArensSquare.left

The left corner (0, 0).

def left : SimplifiedArensSquare
:= ⟨(0, 0), .inl rfl⟩

definition right

TopologyByExample.SimplifiedArensSquare.right

The right corner (1, 0).

def right : SimplifiedArensSquare
:= ⟨(1, 0), .inr (.inl rfl)⟩

definition toPlane

TopologyByExample.SimplifiedArensSquare.toPlane

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

def toPlane (p : SimplifiedArensSquare) : ℝ × ℝ
:= Subtype.val (p : ↥simplifiedArensSet)

theorem toPlane_injective

TopologyByExample.SimplifiedArensSquare.toPlane_injective

Points with the same underlying point of the plane are equal.

theorem toPlane_injective : Injective toPlane
Proof
:= Subtype.val_injective

theorem toPlane_left

TopologyByExample.SimplifiedArensSquare.toPlane_left

@[simp] theorem toPlane_left : left.toPlane = (0, 0)
Proof
:= rfl

theorem toPlane_right

TopologyByExample.SimplifiedArensSquare.toPlane_right

@[simp] theorem toPlane_right : right.toPlane = (1, 0)
Proof
:= rfl

theorem cases

TopologyByExample.SimplifiedArensSquare.cases

A point is a corner or lies in the open unit square.

theorem cases (p : SimplifiedArensSquare) :
    p = left ∨ p = right ∨
      (0 < p.toPlane.1 ∧ p.toPlane.1 < 1 ∧ 0 < p.toPlane.2 ∧ p.toPlane.2 < 1)
Proof
:= by
  rcases p.property with h | h | h
  · exact .inl (toPlane_injective h)
  · exact .inr (.inl (toPlane_injective h))
  · exact .inr (.inr h)

theorem bounds_of_ne

TopologyByExample.SimplifiedArensSquare.bounds_of_ne

A point off the axis lies in the open unit square.

theorem bounds_of_ne {p : SimplifiedArensSquare} (h : p.toPlane.2 ≠ 0) :
    0 < p.toPlane.1 ∧ p.toPlane.1 < 1 ∧ 0 < p.toPlane.2 ∧ p.toPlane.2 < 1
Proof
:= by
  rcases p.cases with rfl | rfl | h'
  · simp at h
  · simp at h
  · exact h'

theorem snd_nonneg

TopologyByExample.SimplifiedArensSquare.snd_nonneg

The heights are nonnegative.

theorem snd_nonneg (p : SimplifiedArensSquare) : 0 ≤ p.toPlane.2
Proof
:= by
  rcases p.cases with rfl | rfl | h
  · simp
  · simp
  · exact h.2.2.1.le

theorem abs_fst_sub_le_dist

TopologyByExample.SimplifiedArensSquare.abs_fst_sub_le_dist

The horizontal distance is at most the distance.

theorem abs_fst_sub_le_dist (p q : ℝ × ℝ) : |p.1 - q.1| ≤ dist p q
Proof
:= by
  rw [← Real.dist_eq, Prod.dist_eq]; exact le_max_left _ _

theorem abs_snd_sub_le_dist

TopologyByExample.SimplifiedArensSquare.abs_snd_sub_le_dist

The vertical distance is at most the distance.

theorem abs_snd_sub_le_dist (p q : ℝ × ℝ) : |p.2 - q.2| ≤ dist p q
Proof
:= by
  rw [← Real.dist_eq, Prod.dist_eq]; exact le_max_right _ _

definition basic

TopologyByExample.SimplifiedArensSquare.basic

The basic neighbourhood of radius ε of a point.

noncomputable def basic (z : SimplifiedArensSquare) (ε : ℝ) : Set SimplifiedArensSquare
Definition
:=
  if z.toPlane.2 = 0 then
    if z.toPlane.1 < 1 / 2 then
      {p | p = z ∨ (p.toPlane.1 < 1 / 2 ∧ p.toPlane.2 < ε ∧ p.toPlane.2 ≠ 0)}
    else {p | p = z ∨ (1 / 2 < p.toPlane.1 ∧ p.toPlane.2 < ε ∧ p.toPlane.2 ≠ 0)}
  else {p | dist p.toPlane z.toPlane < ε ∧ p.toPlane.2 ≠ 0}

theorem basic_left

TopologyByExample.SimplifiedArensSquare.basic_left

The basic neighbourhoods of the left corner.

theorem basic_left (ε : ℝ) : basic left ε =
    {p | p = left ∨ (p.toPlane.1 < 1 / 2 ∧ p.toPlane.2 < ε ∧ p.toPlane.2 ≠ 0)}
Proof
:= by
  simp only [basic, toPlane_left, ↓reduceIte]; norm_num

theorem basic_right

TopologyByExample.SimplifiedArensSquare.basic_right

The basic neighbourhoods of the right corner.

theorem basic_right (ε : ℝ) : basic right ε =
    {p | p = right ∨ (1 / 2 < p.toPlane.1 ∧ p.toPlane.2 < ε ∧ p.toPlane.2 ≠ 0)}
Proof
:= by
  simp only [basic, toPlane_right, ↓reduceIte]; norm_num

theorem basic_of_ne

TopologyByExample.SimplifiedArensSquare.basic_of_ne

The basic neighbourhoods of a point of the open square.

theorem basic_of_ne {z : SimplifiedArensSquare} (h : z.toPlane.2 ≠ 0) (ε : ℝ) :
    basic z ε = {p | dist p.toPlane z.toPlane < ε ∧ p.toPlane.2 ≠ 0}
Proof
:= by
  simp only [basic, h, ↓reduceIte]

theorem mem_basic_self

TopologyByExample.SimplifiedArensSquare.mem_basic_self

A point lies in its basic neighbourhoods of positive radius.

theorem mem_basic_self (z : SimplifiedArensSquare) {ε : ℝ} (hε : 0 < ε) : z ∈ basic z ε
Proof
:= by
  rcases z.cases with rfl | rfl | h
  · rw [basic_left]; exact .inl rfl
  · rw [basic_right]; exact .inl rfl
  · rw [basic_of_ne h.2.2.1.ne']; exact ⟨by simpa using hε, h.2.2.1.ne'⟩

theorem basic_mono

TopologyByExample.SimplifiedArensSquare.basic_mono

The basic neighbourhoods shrink with the radius.

theorem basic_mono (z : SimplifiedArensSquare) {δ ε : ℝ} (h : δ ≤ ε) : basic z δ ⊆ basic z ε
Proof
:= by
  rcases z.cases with rfl | rfl | hz
  · rw [basic_left, basic_left]
    exact fun p hp ↦ hp.imp id fun hp ↦ ⟨hp.1, hp.2.1.trans_le h, hp.2.2⟩
  · rw [basic_right, basic_right]
    exact fun p hp ↦ hp.imp id fun hp ↦ ⟨hp.1, hp.2.1.trans_le h, hp.2.2⟩
  · rw [basic_of_ne hz.2.2.1.ne', basic_of_ne hz.2.2.1.ne']
    exact fun p hp ↦ ⟨hp.1.trans_le h, hp.2⟩

theorem basic_subset_of_ne

TopologyByExample.SimplifiedArensSquare.basic_subset_of_ne

A point off the axis has a basic neighbourhood inside a Euclidean ball around it, off the axis.

theorem basic_subset_of_ne {q : SimplifiedArensSquare} (hq : q.toPlane.2 ≠ 0) {T : Set _}
    {r : ℝ} (hr : 0 < r)
    (hT : ∀ p : SimplifiedArensSquare, dist p.toPlane q.toPlane < r → p.toPlane.2 ≠ 0 → p ∈ T) :
    ∃ δ > 0, basic q δ ⊆ T
Proof
:=
  ⟨r, hr, fun p hp ↦ by rw [basic_of_ne hq] at hp; exact hT p hp.1 hp.2⟩

theorem exists_basic_subset

TopologyByExample.SimplifiedArensSquare.exists_basic_subset

Every point of a basic neighbourhood of positive radius has a basic neighbourhood inside it.

theorem exists_basic_subset {z : SimplifiedArensSquare} {ε : ℝ} (hε : 0 < ε)
    {q : SimplifiedArensSquare} (hq : q ∈ basic z ε) : ∃ δ > 0, basic q δ ⊆ basic z ε
Proof
:= by
  rcases z.cases with rfl | rfl | hz
  · rw [basic_left] at hq ⊢
    rcases hq with rfl | ⟨h1, h2, h0⟩
    · exact ⟨ε, hε, (basic_left ε).subset⟩
    refine basic_subset_of_ne h0 (r := min (1 / 2 - q.toPlane.1) (ε - q.toPlane.2))
      (lt_min (by linarith) (by linarith)) fun p hp hp0 ↦ .inr ⟨?_, ?_, hp0⟩
    · have := abs_lt.1 ((abs_fst_sub_le_dist p.toPlane q.toPlane).trans_lt
        (hp.trans_le (min_le_left _ _)))
      linarith [this.2]
    · have := abs_lt.1 ((abs_snd_sub_le_dist p.toPlane q.toPlane).trans_lt
        (hp.trans_le (min_le_right _ _)))
      linarith [this.2]
  · rw [basic_right] at hq ⊢
    rcases hq with rfl | ⟨h1, h2, h0⟩
    · exact ⟨ε, hε, (basic_right ε).subset⟩
    refine basic_subset_of_ne h0 (r := min (q.toPlane.1 - 1 / 2) (ε - q.toPlane.2))
      (lt_min (by linarith) (by linarith)) fun p hp hp0 ↦ .inr ⟨?_, ?_, hp0⟩
    · have := abs_lt.1 ((abs_fst_sub_le_dist p.toPlane q.toPlane).trans_lt
        (hp.trans_le (min_le_left _ _)))
      linarith [this.1]
    · have := abs_lt.1 ((abs_snd_sub_le_dist p.toPlane q.toPlane).trans_lt
        (hp.trans_le (min_le_right _ _)))
      linarith [this.2]
  · rw [basic_of_ne hz.2.2.1.ne'] at hq ⊢
    obtain ⟨h1, h0⟩ := hq
    refine basic_subset_of_ne h0 (r := ε - dist q.toPlane z.toPlane) (by linarith)
      fun p hp hp0 ↦ ⟨?_, hp0⟩
    linarith [dist_triangle p.toPlane q.toPlane z.toPlane]

instance

The topology: a set is open if it contains a basic neighbourhood of each of its points.

instance : TopologicalSpace SimplifiedArensSquare
Proof
where
  IsOpen U := ∀ z ∈ U, ∃ ε > 0, basic z ε ⊆ U
  isOpen_univ _ _ := ⟨1, one_pos, subset_univ _⟩
  isOpen_inter s t hs ht z hz := by
    obtain ⟨ε, hε, h⟩ := hs z hz.1
    obtain ⟨δ, hδ, h'⟩ := ht z hz.2
    exact ⟨min ε δ, lt_min hε hδ, subset_inter ((basic_mono z (min_le_left _ _)).trans h)
      ((basic_mono z (min_le_right _ _)).trans h')⟩
  isOpen_sUnion S hS := by
    rintro z ⟨t, ht, hz⟩
    obtain ⟨ε, hε, h⟩ := hS t ht z hz
    exact ⟨ε, hε, h.trans (subset_sUnion_of_mem ht)⟩

theorem isOpen_basic

TopologyByExample.SimplifiedArensSquare.isOpen_basic

The basic neighbourhoods of positive radius are open.

theorem isOpen_basic (z : SimplifiedArensSquare) {ε : ℝ} (hε : 0 < ε) : IsOpen (basic z ε)
Proof
:=
  fun _ hq ↦ exists_basic_subset hε hq

theorem hasBasis_nhds

TopologyByExample.SimplifiedArensSquare.hasBasis_nhds

The basic neighbourhoods of positive radius form a base of neighbourhoods of each point.

theorem hasBasis_nhds (z : SimplifiedArensSquare) :
    (𝓝 z).HasBasis (fun ε : ℝ ↦ 0 < ε) (basic z)
Proof
:= by
  refine ⟨fun t ↦ ⟨fun ht ↦ ?_, fun ⟨ε, hε, h⟩ ↦
    mem_of_superset ((isOpen_basic z hε).mem_nhds (mem_basic_self z hε)) h⟩⟩
  obtain ⟨V, hVt, hV, hzV⟩ := mem_nhds_iff.1 ht
  obtain ⟨ε, hε, h⟩ := hV z hzV
  exact ⟨ε, hε, h.trans hVt⟩

theorem continuous_snd

TopologyByExample.SimplifiedArensSquare.continuous_snd

The height is continuous.

theorem continuous_snd : Continuous fun p : SimplifiedArensSquare ↦ p.toPlane.2
Proof
:= by
  refine continuous_iff_continuousAt.2 fun z ↦
    ((hasBasis_nhds z).tendsto_iff Metric.nhds_basis_ball).2 fun ε hε ↦ ⟨ε, hε, fun q hq ↦ ?_⟩
  rw [mem_ball, Real.dist_eq]
  rcases z.cases with rfl | rfl | hz
  · rw [basic_left] at hq
    rcases hq with rfl | hq
    · simpa
    · change |q.toPlane.2 - left.toPlane.2| < ε
      rw [toPlane_left, sub_zero, abs_of_nonneg q.snd_nonneg]; exact hq.2.1
  · rw [basic_right] at hq
    rcases hq with rfl | hq
    · simpa
    · change |q.toPlane.2 - right.toPlane.2| < ε
      rw [toPlane_right, sub_zero, abs_of_nonneg q.snd_nonneg]; exact hq.2.1
  · rw [basic_of_ne hz.2.2.1.ne'] at hq
    exact (abs_snd_sub_le_dist _ _).trans_lt hq.1

The Euclidean topology is finer

definition ofPlane

TopologyByExample.SimplifiedArensSquare.ofPlane

The map from the plane, sending a point of the set to itself (and every other point to the left corner).

noncomputable def ofPlane (p : ℝ × ℝ) : SimplifiedArensSquare
:= by
  classical
  exact if h : p ∈ simplifiedArensSet then ⟨p, h⟩ else left

theorem ofPlane_toPlane

TopologyByExample.SimplifiedArensSquare.ofPlane_toPlane

On the set, ofPlane is a left inverse of toPlane.

theorem ofPlane_toPlane (p : SimplifiedArensSquare) : ofPlane p.toPlane = p
Proof
:= by
  unfold ofPlane
  exact dite_eq_left p.property

theorem ofPlane_image

TopologyByExample.SimplifiedArensSquare.ofPlane_image

ofPlane maps the set onto the space.

theorem ofPlane_image : ofPlane '' simplifiedArensSet = univ
Proof
:=
  eq_univ_of_forall fun p ↦ ⟨p.toPlane, p.property, ofPlane_toPlane p⟩

theorem toPlane_ofPlane

TopologyByExample.SimplifiedArensSquare.toPlane_ofPlane

toPlane of ofPlane on the set.

theorem toPlane_ofPlane {p : ℝ × ℝ} (hp : p ∈ simplifiedArensSet) : (ofPlane p).toPlane = p
Proof
:= by
  simp [ofPlane, toPlane, hp]

theorem continuousOn_ofPlane

TopologyByExample.SimplifiedArensSquare.continuousOn_ofPlane

The identity map from the Euclidean topology is continuous: every basic neighbourhood contains the points of the set in a Euclidean ball.

theorem continuousOn_ofPlane : ContinuousOn ofPlane simplifiedArensSet
Proof
:= by
  intro z hz
  have hz' : (ofPlane z).toPlane = z := toPlane_ofPlane hz
  refine ((hasBasis_nhds (ofPlane z)).tendsto_right_iff).2 fun ε hε ↦ ?_
  rw [eventually_nhdsWithin_iff]
  -- It suffices to find a Euclidean ball around `z` whose points of the set lie in the basic
  -- neighbourhood.
  suffices ∃ δ > 0, ∀ p ∈ simplifiedArensSet, dist p z < δ → ofPlane p ∈ basic (ofPlane z) ε by
    obtain ⟨δ, hδ, h⟩ := this
    exact Metric.eventually_nhds_iff.2 ⟨δ, hδ, fun p hp hpE ↦ h p hpE hp⟩
  rcases (ofPlane z).cases with h | h | h
  · refine ⟨min ε (1 / 2), lt_min hε (by norm_num), fun p hp hpz ↦ ?_⟩
    rw [h, basic_left]
    have hz0 : z = (0, 0) := by rw [← hz', h, toPlane_left]
    subst hz0
    have h1 := abs_fst_sub_le_dist p (0, 0)
    have h2 := abs_snd_sub_le_dist p (0, 0)
    simp only [sub_zero] at h1 h2
    rcases (ofPlane p).cases with hp' | hp' | hp'
    · exact .inl hp'
    · have hpeq : p = (1, 0) := by rw [← toPlane_ofPlane hp, hp', toPlane_right]
      have : |p.1| = 1 := by rw [hpeq]; norm_num
      linarith [min_le_right ε (1 / 2)]
    · rw [toPlane_ofPlane hp] at hp'
      refine .inr ⟨?_, ?_, ?_⟩ <;> rw [toPlane_ofPlane hp]
      · linarith [le_abs_self p.1, min_le_right ε (1 / 2)]
      · linarith [le_abs_self p.2, min_le_left ε (1 / 2)]
      · exact hp'.2.2.1.ne'
  · refine ⟨min ε (1 / 2), lt_min hε (by norm_num), fun p hp hpz ↦ ?_⟩
    rw [h, basic_right]
    have hz0 : z = (1, 0) := by rw [← hz', h, toPlane_right]
    subst hz0
    have h1 := abs_fst_sub_le_dist p (1, 0)
    have h2 := abs_snd_sub_le_dist p (1, 0)
    simp only [sub_zero] at h1 h2
    rcases (ofPlane p).cases with hp' | hp' | hp'
    · have hpeq : p = (0, 0) := by rw [← toPlane_ofPlane hp, hp', toPlane_left]
      have : |p.1 - 1| = 1 := by rw [hpeq]; norm_num
      linarith [min_le_right ε (1 / 2)]
    · exact .inl hp'
    · rw [toPlane_ofPlane hp] at hp'
      refine .inr ⟨?_, ?_, ?_⟩ <;> rw [toPlane_ofPlane hp]
      · linarith [neg_abs_le (p.1 - 1), min_le_right ε (1 / 2)]
      · linarith [le_abs_self p.2, min_le_left ε (1 / 2)]
      · exact hp'.2.2.1.ne'
  · have h0 : (ofPlane z).toPlane.2 ≠ 0 := h.2.2.1.ne'
    have hz2 : 0 < z.2 := by rw [← hz']; exact h.2.2.1
    refine ⟨min ε z.2, lt_min hε hz2, fun p hp hpz ↦ ?_⟩
    rw [basic_of_ne h0]
    refine ⟨?_, ?_⟩ <;> rw [toPlane_ofPlane hp]
    · rw [hz']; exact hpz.trans_le (min_le_left _ _)
    · intro hp0
      have := abs_snd_sub_le_dist p z
      rw [hp0, zero_sub, abs_neg, abs_of_pos hz2] at this
      linarith [min_le_right ε z.2]

Separation

instance

The simplified Arens square is Hausdorff. Points at different heights are separated by the height; the two corners by their basic neighbourhoods, on the two sides of x = 1/2; two points of the open square at the same height by Euclidean balls.

instance : T2Space SimplifiedArensSquare
Proof
:= by
  refine ⟨fun z w hzw ↦ ?_⟩
  by_cases hy : z.toPlane.2 = w.toPlane.2
  · rcases z.cases with rfl | rfl | hz <;> rcases w.cases with rfl | rfl | hw
    · exact absurd rfl hzw
    · refine ⟨_, _, isOpen_basic left one_pos, isOpen_basic right one_pos,
        mem_basic_self _ one_pos, mem_basic_self _ one_pos, disjoint_left.2 fun p hp hp' ↦ ?_⟩
      rw [basic_left] at hp; rw [basic_right] at hp'
      rcases hp with rfl | hp <;> rcases hp' with hp' | hp'
      · exact absurd (congrArg toPlane hp') (by simp)
      · norm_num at hp'
      · rw [hp'] at hp; norm_num at hp
      · linarith [hp.1, hp'.1]
    · simp at hy; linarith [hw.2.2.1]
    · refine ⟨_, _, isOpen_basic right one_pos, isOpen_basic left one_pos,
        mem_basic_self _ one_pos, mem_basic_self _ one_pos, disjoint_left.2 fun p hp hp' ↦ ?_⟩
      rw [basic_right] at hp; rw [basic_left] at hp'
      rcases hp with rfl | hp <;> rcases hp' with hp' | hp'
      · exact absurd (congrArg toPlane hp') (by simp)
      · norm_num at hp'
      · rw [hp'] at hp; norm_num at hp
      · linarith [hp.1, hp'.1]
    · exact absurd rfl hzw
    · simp at hy; linarith [hw.2.2.1]
    · simp at hy; linarith [hz.2.2.1]
    · simp at hy; linarith [hz.2.2.1]
    · have hne : z.toPlane ≠ w.toPlane := fun h ↦ hzw (toPlane_injective h)
      have hr : 0 < dist z.toPlane w.toPlane / 2 := half_pos (dist_pos.2 hne)
      refine ⟨_, _, isOpen_basic z hr, isOpen_basic w hr, mem_basic_self z hr,
        mem_basic_self w hr, disjoint_left.2 fun p hp hp' ↦ ?_⟩
      rw [basic_of_ne hz.2.2.1.ne'] at hp
      rw [basic_of_ne hw.2.2.1.ne'] at hp'
      linarith [dist_triangle_left z.toPlane w.toPlane p.toPlane, hp.1, hp'.1]
  · obtain ⟨u, v, hu, hv, hzu, hwv, huv⟩ := t2_separation hy
    exact ⟨_, _, hu.preimage continuous_snd, hv.preimage continuous_snd, hzu, hwv,
      huv.preimage _⟩

theorem dist_mk_same_snd

TopologyByExample.SimplifiedArensSquare.dist_mk_same_snd

The distance between two points at the same height.

theorem dist_mk_same_snd (a b y : ℝ) : dist (a, y) (b, y) = |a - b|
Proof
:= by
  rw [Prod.dist_eq, dist_self, Real.dist_eq]; exact max_eq_left (abs_nonneg _)

theorem mid_mem_closure

TopologyByExample.SimplifiedArensSquare.mid_mem_closure

For 0 < y < ε, the point (1/2, y) lies in the closures of the basic neighbourhoods of radius ε of the two corners.

theorem mid_mem_closure {y : ℝ} (hy0 : 0 < y) (hy1 : y < 1) {ε : ℝ} (hyε : y < ε) :
    ofPlane (1 / 2, y) ∈ closure (basic left ε) ∩ closure (basic right ε)
Proof
:= by
  have hm : ((1 / 2 : ℝ), y) ∈ simplifiedArensSet :=
    .inr (.inr ⟨by norm_num, by norm_num, hy0, hy1⟩)
  have hm' := toPlane_ofPlane hm
  have hm0 : (ofPlane (1 / 2, y)).toPlane.2 ≠ 0 := by rw [hm']; exact hy0.ne'
  -- A point of height `y` within `η` of `(1/2, y)`, with `x` in a given range.
  have key : ∀ η > 0, ∀ t : ℝ, 0 < t → t < 1 → |t - 1 / 2| < η →
      ofPlane (t, y) ∈ basic (ofPlane (1 / 2, y)) η ∧ (ofPlane (t, y)).toPlane = (t, y) := by
    intro η hη t ht0 ht1 htη
    have ht : (t, y) ∈ simplifiedArensSet := .inr (.inr ⟨ht0, ht1, hy0, hy1⟩)
    refine ⟨?_, toPlane_ofPlane ht⟩
    rw [basic_of_ne hm0]
    refine ⟨?_, ?_⟩ <;> rw [toPlane_ofPlane ht]
    · rw [hm', dist_mk_same_snd]; exact htη
    · exact hy0.ne'
  constructor
  · refine (mem_closure_iff_nhds_basis' (hasBasis_nhds _)).2 fun η hη ↦ ?_
    set t := max (1 / 4) (1 / 2 - η / 2)
    have ht1 : 1 / 4 ≤ t := le_max_left _ _
    have ht2 : 1 / 2 - η / 2 ≤ t := le_max_right _ _
    have ht3 : t < 1 / 2 := max_lt (by norm_num) (by linarith)
    obtain ⟨h1, h2⟩ := key η hη t (by linarith) (by linarith)
      (abs_lt.2 ⟨by linarith, by linarith⟩)
    refine ⟨_, h1, ?_⟩
    rw [basic_left]
    refine .inr ⟨?_, ?_, ?_⟩ <;> rw [h2]
    · exact ht3
    · exact hyε
    · exact hy0.ne'
  · refine (mem_closure_iff_nhds_basis' (hasBasis_nhds _)).2 fun η hη ↦ ?_
    set t := min (3 / 4) (1 / 2 + η / 2)
    have ht1 : t ≤ 3 / 4 := min_le_left _ _
    have ht2 : t ≤ 1 / 2 + η / 2 := min_le_right _ _
    have ht3 : 1 / 2 < t := lt_min (by norm_num) (by linarith)
    obtain ⟨h1, h2⟩ := key η hη t (by linarith) (by linarith)
      (abs_lt.2 ⟨by linarith, by linarith⟩)
    refine ⟨_, h1, ?_⟩
    rw [basic_right]
    refine .inr ⟨?_, ?_, ?_⟩ <;> rw [h2]
    · exact ht3
    · exact hyε
    · exact hy0.ne'

theorem closure_inter_closure_nonempty

TopologyByExample.SimplifiedArensSquare.closure_inter_closure_nonempty

The closures of any neighbourhoods of the two corners meet.

theorem closure_inter_closure_nonempty {s t : Set SimplifiedArensSquare} (hs : s ∈ 𝓝 left)
    (ht : t ∈ 𝓝 right) : (closure s ∩ closure t).Nonempty
Proof
:= by
  obtain ⟨ε, hε, hεs⟩ := (hasBasis_nhds left).mem_iff.1 hs
  obtain ⟨δ, hδ, hδt⟩ := (hasBasis_nhds right).mem_iff.1 ht
  set η := min (min ε δ) 1
  have hη : 0 < η := lt_min (lt_min hε hδ) one_pos
  have h := mid_mem_closure (y := η / 2) (by positivity) (by linarith [min_le_right (min ε δ) 1])
    (ε := η) (by linarith)
  exact ⟨_, closure_mono ((basic_mono _ ((min_le_left _ _).trans (min_le_left _ _))).trans hεs)
      h.1,
    closure_mono ((basic_mono _ ((min_le_left _ _).trans (min_le_right _ _))).trans hδt) h.2⟩

On this site: Simplified Arens square: The closures of neighbourhoods of the two corners meet

theorem not_t25Space

TopologyByExample.SimplifiedArensSquare.not_t25Space

The simplified Arens square is not Urysohn: the two corners have no neighbourhoods with disjoint closures.

theorem not_t25Space : ¬T25Space SimplifiedArensSquare
Proof
:= fun _ ↦ by
  have hne : left ≠ right := fun h ↦ by
    have := congrArg toPlane h
    simp at this
  obtain ⟨s, hs, t, ht, hst⟩ := exists_nhds_disjoint_closure hne
  exact (closure_inter_closure_nonempty hs ht).ne_empty hst.inter_eq

On this site: Simplified Arens square is not Urysohn

theorem eq_of_continuous

TopologyByExample.SimplifiedArensSquare.eq_of_continuous

A continuous map from the simplified Arens square to a Urysohn space (such as ℝ) takes the same value at the two corners.

theorem eq_of_continuous {Y : Type*} [TopologicalSpace Y] [T25Space Y]
    {f : SimplifiedArensSquare → Y} (hf : Continuous f) : f left = f right
Proof
:= by
  by_contra hne
  obtain ⟨s, hs, t, ht, hst⟩ := exists_nhds_disjoint_closure hne
  obtain ⟨z, hzs, hzt⟩ := closure_inter_closure_nonempty (hf.continuousAt.preimage_mem_nhds hs)
    (hf.continuousAt.preimage_mem_nhds ht)
  exact hst.le_bot ⟨hf.closure_preimage_subset s hzs, hf.closure_preimage_subset t hzt⟩

On this site: Simplified Arens square: Continuous maps to Urysohn spaces identify the corners

The open square

definition OpenSquare

TopologyByExample.SimplifiedArensSquare.OpenSquare

The open unit square, with the Euclidean topology.

abbrev OpenSquare : Type
:= ↥(Ioo (0 : ℝ) 1 ×ˢ Ioo (0 : ℝ) 1)

theorem openSquare_subset

TopologyByExample.SimplifiedArensSquare.openSquare_subset

The open unit square lies in the set.

theorem openSquare_subset : Ioo (0 : ℝ) 1 ×ˢ Ioo (0 : ℝ) 1 ⊆ simplifiedArensSet
Proof
:=
  fun _ hp ↦ .inr (.inr ⟨hp.1.1, hp.1.2, hp.2.1, hp.2.2⟩)

definition incl

TopologyByExample.SimplifiedArensSquare.incl

The inclusion of the open unit square.

noncomputable def incl (p : OpenSquare) : SimplifiedArensSquare
:= ofPlane p

theorem continuous_incl

TopologyByExample.SimplifiedArensSquare.continuous_incl

The inclusion of the open square is continuous.

theorem continuous_incl : Continuous incl
Proof
:=
  continuousOn_ofPlane.comp_continuous continuous_subtypeVal fun p ↦ openSquare_subset p.property

theorem isOpenMap_incl

TopologyByExample.SimplifiedArensSquare.isOpenMap_incl

The inclusion of the open square is an open map: the basic neighbourhoods of a point of the open square are Euclidean balls.

theorem isOpenMap_incl : IsOpenMap incl
Proof
:= by
  intro V hV
  rintro _ ⟨v, hv, rfl⟩
  obtain ⟨r, hr, hrV⟩ := Metric.isOpen_iff.1 hV v hv
  have hv' : (incl v).toPlane = v.val := toPlane_ofPlane (openSquare_subset v.property)
  have h0 : (incl v).toPlane.2 ≠ 0 := by rw [hv']; exact v.property.2.1.ne'
  refine ⟨r, hr, fun q hq ↦ ?_⟩
  rw [basic_of_ne h0, hv'] at hq
  obtain ⟨hq1, hq0⟩ := hq
  have hb := bounds_of_ne hq0
  have hqS : q.toPlane ∈ Ioo (0 : ℝ) 1 ×ˢ Ioo (0 : ℝ) 1 := ⟨⟨hb.1, hb.2.1⟩, hb.2.2.1, hb.2.2.2⟩
  refine ⟨⟨q.toPlane, hqS⟩, hrV ?_, ofPlane_toPlane q⟩
  rw [mem_ball, Subtype.dist_eq]
  exact hq1

theorem range_incl_union

TopologyByExample.SimplifiedArensSquare.range_incl_union

The space is the image of the open square together with the two corners.

theorem range_incl_union : range incl ∪ {left, right} = univ
Proof
:= by
  refine eq_univ_of_forall fun p ↦ ?_
  rcases p.cases with rfl | rfl | h
  · exact .inr (.inl rfl)
  · exact .inr (.inr rfl)
  · exact .inl ⟨⟨p.toPlane, ⟨h.1, h.2.1⟩, h.2.2.1, h.2.2.2⟩, ofPlane_toPlane p⟩

instance

The simplified Arens square is σ-compact: the open square is σ-compact.

instance : SigmaCompactSpace SimplifiedArensSquare
Proof
:= by
  have : LocallyCompactSpace OpenSquare := (isOpen_Ioo.prod isOpen_Ioo).locallyCompactSpace
  rw [← isSigmaCompact_univ_iff, ← range_incl_union, ← sUnion_pair]
  refine isSigmaCompact_sUnion _ (countable_singleton _ |>.insert _) ?_
  rintro ⟨s, rfl | rfl⟩
  · exact isSigmaCompact_range continuous_incl
  · exact (finite_singleton right |>.insert left).isCompact.isSigmaCompact

theorem not_isMeagre_univ

TopologyByExample.SimplifiedArensSquare.not_isMeagre_univ

The simplified Arens square is of second category: the open square, a Baire space, maps onto an open subset by a continuous open map.

theorem not_isMeagre_univ : ¬IsMeagre (univ : Set SimplifiedArensSquare)
Proof
:= by
  have : LocallyCompactSpace OpenSquare := (isOpen_Ioo.prod isOpen_Ioo).locallyCompactSpace
  intro h
  have := h.preimage_of_isOpenMap continuous_incl isOpenMap_incl
  rw [preimage_univ] at this
  exact not_isMeagre_of_isOpen isOpen_univ
    ⟨⟨(1 / 2, 1 / 2), ⟨by norm_num, by norm_num⟩, by norm_num, by norm_num⟩, trivial⟩ this

On this site: Simplified Arens square is of second category

Connectedness

theorem mem_image_toPlane

TopologyByExample.SimplifiedArensSquare.mem_image_toPlane

A point of the plane in the set lies in the image of a set of points of the space exactly when the corresponding point of the space lies in it.

theorem mem_image_toPlane {p : ℝ × ℝ} (hp : p ∈ simplifiedArensSet)
    {S : Set SimplifiedArensSquare} : p ∈ toPlane '' S ↔ ofPlane p ∈ S
Proof
:=
  ⟨fun ⟨q, hq, hqp⟩ ↦ by rw [← hqp, ofPlane_toPlane]; exact hq,
    fun h ↦ ⟨ofPlane p, h, toPlane_ofPlane hp⟩⟩

theorem isPathConnected_of_starConvex

TopologyByExample.SimplifiedArensSquare.isPathConnected_of_starConvex

A set of points whose underlying set in the plane is star-shaped is path connected.

theorem isPathConnected_of_starConvex {S : Set SimplifiedArensSquare} {z : SimplifiedArensSquare}
    (hz : z ∈ S) (h : StarConvex ℝ z.toPlane (toPlane '' S)) : IsPathConnected S
Proof
:= by
  have hS : S = ofPlane '' (toPlane '' S) := by
    rw [image_image]; simp only [ofPlane_toPlane, image_id']
  rw [hS]
  exact (h.isPathConnected (mem_image_of_mem _ hz)).image'
    (continuousOn_ofPlane.mono (by rintro _ ⟨q, -, rfl⟩; exact q.property))

theorem combo_fst

TopologyByExample.SimplifiedArensSquare.combo_fst

The first coordinate of a combination of two points of the plane.

theorem combo_fst (a b : ℝ) (u v : ℝ × ℝ) : (a • u + b • v).1 = a * u.1 + b * v.1
Proof
:= rfl

theorem combo_snd

TopologyByExample.SimplifiedArensSquare.combo_snd

The second coordinate of a combination of two points of the plane.

theorem combo_snd (a b : ℝ) (u v : ℝ × ℝ) : (a • u + b • v).2 = a * u.2 + b * v.2
Proof
:= rfl

theorem combo_mem

TopologyByExample.SimplifiedArensSquare.combo_mem

A combination a • z + b • q with a > 0 of a point z of the open square and a point q of the closed square below height 1 lies in the open square.

theorem combo_mem {z q : ℝ × ℝ} (hz : 0 < z.1 ∧ z.1 < 1 ∧ 0 < z.2 ∧ z.2 < 1)
    (hq : 0 ≤ q.1 ∧ q.1 ≤ 1 ∧ 0 ≤ q.2 ∧ q.2 < 1) {a b : ℝ} (ha : 0 < a) (hb : 0 ≤ b)
    (hab : a + b = 1) :
    0 < (a • z + b • q).1 ∧ (a • z + b • q).1 < 1 ∧ 0 < (a • z + b • q).2 ∧
      (a • z + b • q).2 < 1
Proof
:= by
  rw [combo_fst, combo_snd]
  refine ⟨add_pos_of_pos_of_nonneg (mul_pos ha hz.1) (mul_nonneg hb hq.1), ?_,
    add_pos_of_pos_of_nonneg (mul_pos ha hz.2.2.1) (mul_nonneg hb hq.2.2.1), ?_⟩ <;> nlinarith

theorem toPlane_bounds

TopologyByExample.SimplifiedArensSquare.toPlane_bounds

The points of the space lie in the closed square below height 1.

theorem toPlane_bounds (q : SimplifiedArensSquare) :
    0 ≤ q.toPlane.1 ∧ q.toPlane.1 ≤ 1 ∧ 0 ≤ q.toPlane.2 ∧ q.toPlane.2 < 1
Proof
:= by
  rcases q.cases with rfl | rfl | h
  · simp
  · simp
  · exact ⟨h.1.le, h.2.1.le, h.2.2.1.le, h.2.2.2⟩

instance

The simplified Arens square is path connected: the underlying set is star-shaped about (1/2, 1/2), and the identity map from the Euclidean topology is continuous.

instance : PathConnectedSpace SimplifiedArensSquare
Proof
:= by
  have hc : ((1 / 2 : ℝ), (1 / 2 : ℝ)) ∈ simplifiedArensSet :=
    .inr (.inr ⟨by norm_num, by norm_num, by norm_num, by norm_num⟩)
  rw [pathConnectedSpace_iff_univ]
  refine isPathConnected_of_starConvex (z := ofPlane (1 / 2, 1 / 2)) trivial ?_
  rw [toPlane_ofPlane hc]
  intro q hq a b ha hb hab
  obtain ⟨p, -, rfl⟩ := hq
  have hmem : a • ((1 / 2 : ℝ), (1 / 2 : ℝ)) + b • p.toPlane ∈ simplifiedArensSet := by
    rcases eq_or_lt_of_le ha with rfl | ha
    · simp only [zero_add] at hab; subst hab
      simp only [zero_smul, one_smul, zero_add]
      exact p.property
    · exact .inr (.inr (combo_mem ⟨by norm_num, by norm_num, by norm_num, by norm_num⟩
        (toPlane_bounds p) ha hb hab))
  rw [mem_image_toPlane hmem]
  trivial

theorem starConvex_basic

TopologyByExample.SimplifiedArensSquare.starConvex_basic

The plane coordinates of a basic neighbourhood form a set star-shaped about its centre.

theorem starConvex_basic (z : SimplifiedArensSquare) {ε : ℝ} (hε : 0 < ε) :
    StarConvex ℝ z.toPlane (toPlane '' basic z ε)
Proof
:= by
  intro q hq a b ha hb hab
  obtain ⟨p, hp, rfl⟩ := hq
  rcases eq_or_lt_of_le hb with rfl | hb'
  · simp only [add_zero] at hab; subst hab
    simp only [one_smul, zero_smul, add_zero]
    exact mem_image_of_mem _ (mem_basic_self z hε)
  have hpb := toPlane_bounds p
  rcases z.cases with rfl | rfl | hz
  · -- Around the left corner.
    rw [basic_left] at hp
    rcases hp with rfl | ⟨h1, h2, h0⟩
    · rw [← add_smul, hab, one_smul]; exact mem_image_of_mem _ (mem_basic_self _ hε)
    have hp0 := bounds_of_ne h0
    have hx : (a • left.toPlane + b • p.toPlane).1 = b * p.toPlane.1 := by
      rw [combo_fst]; simp
    have hy : (a • left.toPlane + b • p.toPlane).2 = b * p.toPlane.2 := by
      rw [combo_snd]; simp
    have hmem : a • left.toPlane + b • p.toPlane ∈ simplifiedArensSet := by
      refine .inr (.inr ?_)
      rw [hx, hy]
      exact ⟨mul_pos hb' hp0.1, by nlinarith, mul_pos hb' hp0.2.2.1, by nlinarith⟩
    rw [mem_image_toPlane hmem, basic_left]
    refine .inr ⟨?_, ?_, ?_⟩ <;> rw [toPlane_ofPlane hmem]
    · rw [hx]; nlinarith
    · rw [hy]; nlinarith
    · rw [hy]; exact (mul_pos hb' hp0.2.2.1).ne'
  · -- Around the right corner.
    rw [basic_right] at hp
    rcases hp with rfl | ⟨h1, h2, h0⟩
    · rw [← add_smul, hab, one_smul]; exact mem_image_of_mem _ (mem_basic_self _ hε)
    have hp0 := bounds_of_ne h0
    have hx : (a • right.toPlane + b • p.toPlane).1 = a + b * p.toPlane.1 := by
      rw [combo_fst]; simp
    have hy : (a • right.toPlane + b • p.toPlane).2 = b * p.toPlane.2 := by
      rw [combo_snd]; simp
    have hmem : a • right.toPlane + b • p.toPlane ∈ simplifiedArensSet := by
      refine .inr (.inr ?_)
      rw [hx, hy]
      exact ⟨by nlinarith, by nlinarith, mul_pos hb' hp0.2.2.1, by nlinarith⟩
    rw [mem_image_toPlane hmem, basic_right]
    refine .inr ⟨?_, ?_, ?_⟩ <;> rw [toPlane_ofPlane hmem]
    · rw [hx]; nlinarith
    · rw [hy]; nlinarith
    · rw [hy]; exact (mul_pos hb' hp0.2.2.1).ne'
  · -- Around a point of the open square.
    have hp' := hp
    rw [basic_of_ne hz.2.2.1.ne'] at hp
    obtain ⟨h1, h0⟩ := hp
    rcases eq_or_lt_of_le ha with rfl | ha'
    · simp only [zero_add] at hab; subst hab
      simp only [zero_smul, one_smul, zero_add]
      exact mem_image_of_mem _ hp'
    have hmem : a • z.toPlane + b • p.toPlane ∈ simplifiedArensSet :=
      .inr (.inr (combo_mem hz hpb ha' hb hab))
    rw [mem_image_toPlane hmem, basic_of_ne hz.2.2.1.ne']
    refine ⟨?_, ?_⟩ <;> rw [toPlane_ofPlane hmem]
    · have : a • z.toPlane + b • p.toPlane - z.toPlane = b • (p.toPlane - z.toPlane) := by
        have : a = 1 - b := by linarith
        subst this
        rw [smul_sub, sub_smul, one_smul]; abel
      rw [dist_eq_norm, this, norm_smul, Real.norm_of_nonneg hb, ← dist_eq_norm]
      calc b * dist p.toPlane z.toPlane ≤ 1 * dist p.toPlane z.toPlane := by
            gcongr; linarith
        _ < ε := by rw [one_mul]; exact h1
    · exact (combo_mem hz hpb ha' hb hab).2.2.1.ne'

theorem isPathConnected_basic

TopologyByExample.SimplifiedArensSquare.isPathConnected_basic

The basic neighbourhoods are path connected.

theorem isPathConnected_basic (z : SimplifiedArensSquare) {ε : ℝ} (hε : 0 < ε) :
    IsPathConnected (basic z ε)
Proof
:=
  isPathConnected_of_starConvex (mem_basic_self z hε) (starConvex_basic z hε)

instance

The simplified Arens square is locally path connected.

instance : LocallyPathConnectedSpace SimplifiedArensSquare
Proof
:=
  .of_bases hasBasis_nhds fun z _ hε ↦ isPathConnected_basic z hε

Second countability

definition countableBase

TopologyByExample.SimplifiedArensSquare.countableBase

A countable family of basic neighbourhoods: those of the corners of radius 1 / (n + 1) and those of the points with rational coordinates in the open square.

noncomputable def countableBase : Set (Set SimplifiedArensSquare)
:=
  range (fun n : ℕ ↦ basic left (1 / (n + 1))) ∪ range (fun n : ℕ ↦ basic right (1 / (n + 1))) ∪
    range (fun d : ℚ × ℚ × ℕ ↦ basic (ofPlane (d.1, d.2.1)) (1 / (d.2.2 + 1)))

instance

The simplified Arens square is second countable.

instance : SecondCountableTopology SimplifiedArensSquare
Proof
:= by
  refine IsTopologicalBasis.secondCountableTopology (b := countableBase) ?_
    (((countable_range _).union (countable_range _)).union (countable_range _))
  refine isTopologicalBasis_of_isOpen_of_nhds ?_ fun z U hz hU ↦ ?_
  · rintro _ ((⟨n, rfl⟩ | ⟨n, rfl⟩) | ⟨d, rfl⟩) <;> exact isOpen_basic _ Nat.one_div_pos_of_nat
  obtain ⟨ε, hε, hεU⟩ := (hasBasis_nhds z).mem_iff.1 (hU.mem_nhds hz)
  obtain ⟨n, hn⟩ := exists_nat_one_div_lt (half_pos hε)
  have hn0 : (0 : ℝ) < 1 / (n + 1) := Nat.one_div_pos_of_nat
  rcases z.cases with rfl | rfl | hz'
  · exact ⟨_, .inl (.inl ⟨n, rfl⟩), mem_basic_self _ hn0,
      (basic_mono _ (by linarith)).trans hεU⟩
  · exact ⟨_, .inl (.inr ⟨n, rfl⟩), mem_basic_self _ hn0,
      (basic_mono _ (by linarith)).trans hεU⟩
  · -- A rational point near `z`.
    set r := 1 / ((n : ℝ) + 1)
    obtain ⟨d₁, hd₁, hd₁'⟩ := exists_rat_btwn (show max 0 (z.toPlane.1 - r) <
      min 1 (z.toPlane.1 + r) from max_lt (lt_min (by linarith [hz'.1]) (by linarith [hz'.1]))
        (lt_min (by linarith [hz'.2.1]) (by linarith)))
    obtain ⟨d₂, hd₂, hd₂'⟩ := exists_rat_btwn (show max 0 (z.toPlane.2 - r) <
      min 1 (z.toPlane.2 + r) from max_lt (lt_min (by linarith [hz'.2.2.1])
        (by linarith [hz'.2.2.1])) (lt_min (by linarith [hz'.2.2.2]) (by linarith)))
    rw [max_lt_iff] at hd₁ hd₂
    rw [lt_min_iff] at hd₁' hd₂'
    have hd : ((d₁ : ℝ), (d₂ : ℝ)) ∈ simplifiedArensSet :=
      .inr (.inr ⟨hd₁.1, hd₁'.1, hd₂.1, hd₂'.1⟩)
    have hd' := toPlane_ofPlane hd
    have hd0 : (ofPlane ((d₁ : ℝ), (d₂ : ℝ))).toPlane.2 ≠ 0 := by rw [hd']; exact hd₂.1.ne'
    have hdist : dist z.toPlane ((d₁ : ℝ), (d₂ : ℝ)) < r := by
      rw [Prod.dist_eq, max_lt_iff, Real.dist_eq, Real.dist_eq, abs_lt, abs_lt]
      exact ⟨⟨by simp only; linarith, by simp only; linarith⟩,
        ⟨by simp only; linarith, by simp only; linarith⟩⟩
    refine ⟨_, .inr ⟨(d₁, d₂, n), rfl⟩, ?_, ?_⟩
    · change z ∈ basic (ofPlane ((d₁ : ℝ), (d₂ : ℝ))) (1 / ((n : ℝ) + 1))
      rw [basic_of_ne hd0, hd']
      exact ⟨hdist, hz'.2.2.1.ne'⟩
    · change basic (ofPlane ((d₁ : ℝ), (d₂ : ℝ))) (1 / ((n : ℝ) + 1)) ⊆ U
      refine Subset.trans ?_ hεU
      intro q hq
      rw [basic_of_ne hd0, hd'] at hq
      rw [basic_of_ne hz'.2.2.1.ne']
      refine ⟨?_, hq.2⟩
      have := dist_triangle q.toPlane ((d₁ : ℝ), (d₂ : ℝ)) z.toPlane
      rw [dist_comm ((d₁ : ℝ), (d₂ : ℝ))] at this
      have hq1 : dist q.toPlane ((d₁ : ℝ), (d₂ : ℝ)) < r := hq.1
      linarith

Semiregularity

theorem isClosed_fst_le

TopologyByExample.SimplifiedArensSquare.isClosed_fst_le

The points with x ≤ 1/2 form a closed set.

theorem isClosed_fst_le : IsClosed {p : SimplifiedArensSquare | p.toPlane.1 ≤ 1 / 2}
Proof
:= by
  rw [← isOpen_compl_iff]
  intro q hq
  simp only [mem_compl_iff, mem_ofPred_eq, not_le] at hq
  rcases q.cases with rfl | rfl | h
  · norm_num at hq
  · refine ⟨1, one_pos, fun p hp ↦ ?_⟩
    rw [basic_right] at hp
    simp only [mem_compl_iff, mem_ofPred_eq, not_le]
    rcases hp with rfl | hp
    · norm_num
    · exact hp.1
  · refine ⟨q.toPlane.1 - 1 / 2, by linarith, fun p hp ↦ ?_⟩
    rw [basic_of_ne h.2.2.1.ne'] at hp
    simp only [mem_compl_iff, mem_ofPred_eq, not_le]
    have := abs_lt.1 ((abs_fst_sub_le_dist p.toPlane q.toPlane).trans_lt hp.1)
    linarith [this.1]

theorem isClosed_le_fst

TopologyByExample.SimplifiedArensSquare.isClosed_le_fst

The points with 1/2 ≤ x form a closed set.

theorem isClosed_le_fst : IsClosed {p : SimplifiedArensSquare | 1 / 2 ≤ p.toPlane.1}
Proof
:= by
  rw [← isOpen_compl_iff]
  intro q hq
  simp only [mem_compl_iff, mem_ofPred_eq, not_le] at hq
  rcases q.cases with rfl | rfl | h
  · refine ⟨1, one_pos, fun p hp ↦ ?_⟩
    rw [basic_left] at hp
    simp only [mem_compl_iff, mem_ofPred_eq, not_le]
    rcases hp with rfl | hp
    · norm_num
    · exact hp.1
  · norm_num at hq
  · refine ⟨1 / 2 - q.toPlane.1, by linarith, fun p hp ↦ ?_⟩
    rw [basic_of_ne h.2.2.1.ne'] at hp
    simp only [mem_compl_iff, mem_ofPred_eq, not_le]
    have := abs_lt.1 ((abs_fst_sub_le_dist p.toPlane q.toPlane).trans_lt hp.1)
    linarith [this.2]

theorem isClosed_closedBall

TopologyByExample.SimplifiedArensSquare.isClosed_closedBall

Around a point z of the open square, the points within r of z form a closed set, for r below the height of z.

theorem isClosed_closedBall {z : SimplifiedArensSquare} {r : ℝ} (hr : r < z.toPlane.2) :
    IsClosed {p : SimplifiedArensSquare | dist p.toPlane z.toPlane ≤ r}
Proof
:= by
  rw [← isOpen_compl_iff]
  intro q hq
  simp only [mem_compl_iff, mem_ofPred_eq, not_le] at hq
  by_cases h0 : q.toPlane.2 = 0
  · refine ⟨z.toPlane.2 - r, by linarith, fun p hp ↦ ?_⟩
    simp only [mem_compl_iff, mem_ofPred_eq, not_le]
    have hpy : p.toPlane.2 < z.toPlane.2 - r := by
      rcases q.cases with rfl | rfl | h
      · rw [basic_left] at hp
        rcases hp with rfl | hp
        · simp only [toPlane_left]; linarith
        · exact hp.2.1
      · rw [basic_right] at hp
        rcases hp with rfl | hp
        · simp only [toPlane_right]; linarith
        · exact hp.2.1
      · exact absurd h0 h.2.2.1.ne'
    have := abs_snd_sub_le_dist p.toPlane z.toPlane
    rw [abs_sub_comm] at this
    linarith [le_abs_self (z.toPlane.2 - p.toPlane.2)]
  · refine ⟨dist q.toPlane z.toPlane - r, by linarith, fun p hp ↦ ?_⟩
    rw [basic_of_ne h0] at hp
    simp only [mem_compl_iff, mem_ofPred_eq, not_le]
    linarith [dist_triangle q.toPlane p.toPlane z.toPlane, dist_comm q.toPlane p.toPlane, hp.1]

instance instSemiregularSpace

TopologyByExample.SimplifiedArensSquare.instSemiregularSpace

The simplified Arens square is semiregular: the interior of the closure of a small basic neighbourhood lies in a larger one.

instance instSemiregularSpace : SemiregularSpace SimplifiedArensSquare
Proof
:= by
  rw [semiregularSpace_iff_isRegularOpen]
  refine isTopologicalBasis_of_isOpen_of_nhds (fun _ hs ↦ hs.isOpen) fun z U hz hU ↦ ?_
  obtain ⟨ε₀, hε₀, hsub⟩ := (hasBasis_nhds z).mem_iff.1 (hU.mem_nhds hz)
  -- The radius: at most `ε₀`, and below the height of `z` if `z` is off the axis.
  obtain ⟨ε, hε, hεε₀, hεz⟩ : ∃ ε : ℝ, 0 < ε ∧ ε ≤ ε₀ ∧ (z.toPlane.2 ≠ 0 → ε < z.toPlane.2) := by
    by_cases h0 : z.toPlane.2 = 0
    · exact ⟨ε₀, hε₀, le_rfl, fun h ↦ absurd h0 h⟩
    · have := (bounds_of_ne h0).2.2.1
      exact ⟨min ε₀ (z.toPlane.2 / 2), lt_min hε₀ (by linarith), min_le_left _ _,
        fun _ ↦ (min_le_right _ _).trans_lt (by linarith)⟩
  refine ⟨interior (closure (basic z (ε / 2))), isRegularOpen_interior_closure _,
    (isOpen_basic z (half_pos hε)).subset_interior_closure (mem_basic_self z (half_pos hε)),
    Subset.trans ?_ ((basic_mono z hεε₀).trans hsub)⟩
  intro w hw
  obtain ⟨δ, hδ, hwδ⟩ := (hasBasis_nhds w).mem_iff.1 (mem_interior_iff_mem_nhds.1 hw)
  have hwc := interior_subset hw
  have hcly : IsClosed {p : SimplifiedArensSquare | |p.toPlane.2 - z.toPlane.2| ≤ ε / 2} :=
    isClosed_le ((continuous_snd.sub continuous_const).abs) continuous_const
  have hy : ∀ p ∈ closure (basic z (ε / 2)), |p.toPlane.2 - z.toPlane.2| ≤ ε / 2 := by
    refine fun p hp ↦ closure_minimal (fun q hq ↦ ?_) hcly hp
    change |q.toPlane.2 - z.toPlane.2| ≤ ε / 2
    rcases z.cases with rfl | rfl | h
    · rw [basic_left] at hq
      rcases hq with rfl | hq
      · rw [sub_self, abs_zero]; positivity
      · rw [toPlane_left, sub_zero, abs_of_nonneg q.snd_nonneg]
        exact hq.2.1.le
    · rw [basic_right] at hq
      rcases hq with rfl | hq
      · rw [sub_self, abs_zero]; positivity
      · rw [toPlane_right, sub_zero, abs_of_nonneg q.snd_nonneg]
        exact hq.2.1.le
    · rw [basic_of_ne h.2.2.1.ne'] at hq
      exact ((abs_snd_sub_le_dist _ _).trans_lt hq.1).le
  rcases z.cases with rfl | rfl | hz'
  · -- The left corner.
    have hx : ∀ p ∈ closure (basic left (ε / 2)), p.toPlane.1 ≤ 1 / 2 := fun p hp ↦
      closure_minimal (fun q hq ↦ by
        rw [basic_left] at hq
        rcases hq with rfl | hq
        · change left.toPlane.1 ≤ 1 / 2; norm_num
        · exact hq.1.le) isClosed_fst_le hp
    rw [basic_left]
    rcases w.cases with rfl | rfl | hw'
    · exact .inl rfl
    · have := hx _ hwc; norm_num at this
    · have hwy := hy w hwc
      simp only [toPlane_left, sub_zero, abs_of_nonneg w.snd_nonneg] at hwy
      refine .inr ⟨lt_of_le_of_ne (hx w hwc) fun h ↦ ?_, by linarith, hw'.2.2.1.ne'⟩
      -- A point just to the right of `w` lies in the closure.
      set t := min (3 / 4) (1 / 2 + δ / 2) with ht
      have ht1 : 1 / 2 < t := lt_min (by norm_num) (by linarith)
      have hq : (t, w.toPlane.2) ∈ simplifiedArensSet :=
        .inr (.inr ⟨by linarith, by linarith [min_le_left (3 / 4 : ℝ) (1 / 2 + δ / 2)],
          hw'.2.2.1, hw'.2.2.2⟩)
      have := hx _ (hwδ (show ofPlane (t, w.toPlane.2) ∈ basic w δ by
        rw [basic_of_ne hw'.2.2.1.ne', mem_ofPred_eq, toPlane_ofPlane hq]
        refine ⟨?_, hw'.2.2.1.ne'⟩
        have : w.toPlane = (1 / 2, w.toPlane.2) := Prod.ext h rfl
        rw [this, dist_mk_same_snd, abs_lt]
        constructor <;> linarith [min_le_right (3 / 4 : ℝ) (1 / 2 + δ / 2)]))
      rw [toPlane_ofPlane hq] at this
      linarith
  · -- The right corner.
    have hx : ∀ p ∈ closure (basic right (ε / 2)), 1 / 2 ≤ p.toPlane.1 := fun p hp ↦
      closure_minimal (fun q hq ↦ by
        rw [basic_right] at hq
        rcases hq with rfl | hq
        · change 1 / 2 ≤ right.toPlane.1; norm_num
        · exact hq.1.le) isClosed_le_fst hp
    rw [basic_right]
    rcases w.cases with rfl | rfl | hw'
    · have := hx _ hwc; norm_num at this
    · exact .inl rfl
    · have hwy := hy w hwc
      simp only [toPlane_right, sub_zero, abs_of_nonneg w.snd_nonneg] at hwy
      refine .inr ⟨lt_of_le_of_ne (hx w hwc) fun h ↦ ?_, by linarith, hw'.2.2.1.ne'⟩
      -- A point just to the left of `w` lies in the closure.
      set t := max (1 / 4) (1 / 2 - δ / 2) with ht
      have ht1 : t < 1 / 2 := max_lt (by norm_num) (by linarith)
      have hq : (t, w.toPlane.2) ∈ simplifiedArensSet :=
        .inr (.inr ⟨by linarith [le_max_left (1 / 4 : ℝ) (1 / 2 - δ / 2)], by linarith,
          hw'.2.2.1, hw'.2.2.2⟩)
      have := hx _ (hwδ (show ofPlane (t, w.toPlane.2) ∈ basic w δ by
        rw [basic_of_ne hw'.2.2.1.ne', mem_ofPred_eq, toPlane_ofPlane hq]
        refine ⟨?_, hw'.2.2.1.ne'⟩
        have : w.toPlane = (1 / 2, w.toPlane.2) := Prod.ext h.symm rfl
        rw [this, dist_mk_same_snd, abs_lt]
        constructor <;> linarith [le_max_right (1 / 4 : ℝ) (1 / 2 - δ / 2)]))
      rw [toPlane_ofPlane hq] at this
      linarith
  · -- A point of the open square.
    have hεz' := hεz hz'.2.2.1.ne'
    have hcl : ∀ p ∈ closure (basic z (ε / 2)), dist p.toPlane z.toPlane ≤ ε / 2 :=
      fun p hp ↦ closure_minimal (fun q hq ↦ by
        rw [basic_of_ne hz'.2.2.1.ne'] at hq
        exact hq.1.le) (isClosed_closedBall (by linarith)) hp
    have hw := hcl w hwc
    rw [basic_of_ne hz'.2.2.1.ne']
    refine ⟨by linarith, fun h0 ↦ ?_⟩
    have := abs_snd_sub_le_dist w.toPlane z.toPlane
    rw [h0, zero_sub, abs_neg, abs_of_pos hz'.2.2.1] at this
    linarith

On this site: Simplified Arens square is semiregular

Pseudocompactness

theorem not_pseudocompactSpace

TopologyByExample.SimplifiedArensSquare.not_pseudocompactSpace

The simplified Arens square is not pseudocompact: 1 / (1 - y) is continuous and unbounded.

theorem not_pseudocompactSpace : ¬PseudocompactSpace SimplifiedArensSquare
Proof
:= by
  intro hP
  have hne : ∀ p : SimplifiedArensSquare, 1 - p.toPlane.2 ≠ 0 := fun p h ↦ by
    linarith [(toPlane_bounds p).2.2.2]
  let f : C(SimplifiedArensSquare, ℝ) :=
    ⟨fun p ↦ 1 / (1 - p.toPlane.2), continuous_const.div (continuous_const.sub continuous_snd) hne⟩
  obtain ⟨C, hC⟩ := (hP.bddAbove_and_bddBelow_range f).1
  set n := max C 0 + 2
  have hq : ((1 / 2 : ℝ), 1 - 1 / n) ∈ simplifiedArensSet := by
    have : 0 < 1 / n := by positivity
    have : 1 / n < 1 := by rw [div_lt_one (by positivity)]; linarith [le_max_right C 0]
    exact .inr (.inr ⟨by norm_num, by norm_num, by linarith, by linarith⟩)
  have h := hC ⟨ofPlane (1 / 2, 1 - 1 / n), rfl⟩
  change 1 / (1 - (ofPlane (1 / 2, 1 - 1 / n)).toPlane.2) ≤ C at h
  rw [toPlane_ofPlane hq] at h
  simp only [sub_sub_cancel, one_div_one_div] at h
  linarith [le_max_left C 0]

On this site: Simplified Arens square is not pseudocompact