Lean library · module TopologyByExample.Spaces.IrrationalCoordinatePlane

The plane with rational-coordinate pairs removed

Source file

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

Imports

definition irrationalCoordinateSet

TopologyByExample.irrationalCoordinateSet

Points of the real plane having at least one irrational coordinate.

def irrationalCoordinateSet : Set (ℝ × ℝ)
:= {p | Irrational p.1 ∨ Irrational p.2}

definition IrrationalCoordinatePlane

TopologyByExample.IrrationalCoordinatePlane

The plane with the rational pairs removed, with its subspace topology.

abbrev IrrationalCoordinatePlane
:= ↥irrationalCoordinateSet

On this site: Space: Plane with rational pairs removed

theorem isGδ_set

TopologyByExample.IrrationalCoordinatePlane.isGδ_set

The defining subset is a countable intersection of open sets.

theorem isGδ_set : IsGδ irrationalCoordinateSet
Proof
:=
  (IsGδ.setOfPred_irrational.preimage continuous_fst).union
    (IsGδ.setOfPred_irrational.preimage continuous_snd)

instance

The subspace admits a compatible complete metric and is second countable.

instance : PolishSpace IrrationalCoordinatePlane
Proof
:= isGδ_set.polishSpace

definition frame

TopologyByExample.IrrationalCoordinatePlane.frame

Rectangles with rational pairs removed.

def frame (s t : Set ℝ) : Set (ℝ × ℝ)
:=
  {p | p.1 ∈ s ∧ p.2 ∈ t ∧ (Irrational p.1 ∨ Irrational p.2)}

theorem segment_irrational_fst

TopologyByExample.IrrationalCoordinatePlane.segment_irrational_fst

A segment with a constant irrational first coordinate avoids every rational pair.

theorem segment_irrational_fst {x y : ℝ × ℝ} (h : x.1 = y.1) (hx : Irrational x.1) :
    segment ℝ x y ⊆ irrationalCoordinateSet
Proof
:= by
  rintro z ⟨a, b, _, _, hab, rfl⟩
  left
  change Irrational (a * x.1 + b * y.1)
  simpa only [← h, ← add_mul, hab, one_mul] using hx

theorem segment_irrational_snd

TopologyByExample.IrrationalCoordinatePlane.segment_irrational_snd

A segment with a constant irrational second coordinate avoids every rational pair.

theorem segment_irrational_snd {x y : ℝ × ℝ} (h : x.2 = y.2) (hx : Irrational x.2) :
    segment ℝ x y ⊆ irrationalCoordinateSet
Proof
:= by
  rintro z ⟨a, b, _, _, hab, rfl⟩
  right
  change Irrational (a * x.2 + b * y.2)
  simpa only [← h, ← add_mul, hab, one_mul] using hx

theorem segment_frame

TopologyByExample.IrrationalCoordinatePlane.segment_frame

Coordinate segments inside a convex rectangle remain in that rectangle.

theorem segment_frame {s t : Set ℝ} (hs : Convex ℝ s) (ht : Convex ℝ t)
    {x y : frame s t}
    (hirr : segment ℝ (x : ℝ × ℝ) (y : ℝ × ℝ) ⊆ irrationalCoordinateSet) :
    segment ℝ (x : ℝ × ℝ) (y : ℝ × ℝ) ⊆ frame s t
Proof
:= by
  intro p hp
  have hrect := (hs.prod ht).segment_subset ⟨x.property.1, x.property.2.1⟩
    ⟨y.property.1, y.property.2.1⟩ hp
  exact ⟨hrect.1, hrect.2, hirr hp⟩

theorem arcConnectedSpace_frame

TopologyByExample.IrrationalCoordinatePlane.arcConnectedSpace_frame

Every such convex rectangle containing an irrational grid point is arc connected.

theorem arcConnectedSpace_frame {s t : Set ℝ} (hs : Convex ℝ s) (ht : Convex ℝ t)
    {a b : ℝ} (ha : a ∈ s) (hb : b ∈ t) (hia : Irrational a) (hib : Irrational b) :
    ArcConnectedSpace (frame s t)
Proof
:= by
  let hub : frame s t := ⟨(a, b), ha, hb, Or.inl hia⟩
  have hj (x : frame s t) : ArcJoined x hub := by
    rcases x.property.2.2 with hx | hx
    · let elbow : frame s t := ⟨(x.val.1, b), x.property.1, hb, Or.inl hx⟩
      have h1 : ArcJoined x elbow := arcJoined_of_segment_subset
        (segment_frame hs ht (segment_irrational_fst rfl hx))
      have h2 : ArcJoined elbow hub := arcJoined_of_segment_subset
        (segment_frame hs ht (segment_irrational_snd rfl hib))
      exact h1.trans h2
    · let elbow : frame s t := ⟨(a, x.val.2), ha, x.property.2.1, Or.inl hia⟩
      have h1 : ArcJoined x elbow := arcJoined_of_segment_subset
        (segment_frame hs ht (segment_irrational_snd rfl hx))
      have h2 : ArcJoined elbow hub := arcJoined_of_segment_subset
        (segment_frame hs ht (segment_irrational_fst rfl hia))
      exact h1.trans h2
  exact ⟨fun x y ↦ (hj x).trans (hj y).symm⟩