Lean library · module TopologyByExample.Theorems.RealSubspaceEmbeddings

Embeddings of intervals and ambient inequivalence of finite arrangements

Source file

The open and closed unit intervals embed into one another without being homeomorphic. The two interval-and-two-point arrangements are homeomorphic as subspaces, but no homeomorphism of the ambient real line identifies them.

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 openToClosed

TopologyByExample.BookEmbeddings.openToClosed

The inclusion of the open unit interval in the closed unit interval.

def openToClosed : Ioo (0 : ℝ) 1 → Icc (0 : ℝ) 1
:=
  inclusion Ioo_subset_Icc_self

theorem isEmbedding_openToClosed

TopologyByExample.BookEmbeddings.isEmbedding_openToClosed

The inclusion is a topological embedding.

theorem isEmbedding_openToClosed : IsEmbedding openToClosed
Proof
:=
  IsEmbedding.subtypeVal.codRestrict _ _

definition closedToOpen

TopologyByExample.BookEmbeddings.closedToOpen

Affine compression embeds the closed interval into the open one.

def closedToOpen (x : Icc (0 : ℝ) 1) : Ioo (0 : ℝ) 1
:=
  ⟨x.val / 2 + 1 / 4, by constructor <;> linarith [x.property.1, x.property.2]⟩

theorem isEmbedding_closedToOpen

TopologyByExample.BookEmbeddings.isEmbedding_closedToOpen

The affine compression is an embedding.

theorem isEmbedding_closedToOpen : IsEmbedding closedToOpen
Proof
:= by
  have hc : Continuous closedToOpen :=
    (continuous_subtypeVal.div_const 2 |>.add_const (1 / 4 : ℝ)).subtype_mk _
  apply hc.isClosedEmbedding ?_ |>.isEmbedding
  intro x y h
  apply Subtype.ext
  have hh := congrArg Subtype.val h
  change x.val / 2 + 1 / 4 = y.val / 2 + 1 / 4 at hh
  linarith

theorem range_closedToOpen_val

TopologyByExample.BookEmbeddings.range_closedToOpen_val

The image of the affine embedding is exactly the middle closed half.

theorem range_closedToOpen_val :
    range (fun x ↦ (closedToOpen x).val) = Icc (1 / 4 : ℝ) (3 / 4)
Proof
:= by
  ext y
  constructor
  · rintro ⟨x, rfl⟩
    change 1 / 4 ≤ x.val / 2 + 1 / 4 ∧ x.val / 2 + 1 / 4 ≤ 3 / 4
    constructor <;> linarith [x.property.1, x.property.2]
  · intro hy
    refine ⟨⟨2 * y - 1 / 2, ?_⟩, ?_⟩
    · constructor <;> linarith [hy.1, hy.2]
    · change (2 * y - 1 / 2) / 2 + 1 / 4 = y
      ring

theorem not_homeomorphic_intervals

TopologyByExample.BookEmbeddings.not_homeomorphic_intervals

The two intervals nevertheless are not homeomorphic.

theorem not_homeomorphic_intervals : IsEmpty (Ioo (0 : ℝ) 1 ≃ₜ Icc (0 : ℝ) 1)
Proof
:= by
  refine ⟨fun e ↦ ?_⟩
  let h : Icc (0 : ℝ) 1 ≃ₜ ℝ := e.symm.trans (SeparatedRealSubsets.intervalReal 0 1 (by norm_num))
  exact RealLine.not_compactSpace (h.surjective.compactSpace h.continuous)

theorem first_bounds

TopologyByExample.BookEmbeddings.first_bounds

private theorem first_bounds {x : ℝ} (hx : x ∈ firstSet) : 0 ≤ x ∧ x ≤ 3
Proof
:= by
  rcases hx with (hx | hx) | hx
  · simp only [mem_singleton_iff] at hx
    subst x
    norm_num
  · constructor <;> linarith [hx.1, hx.2]
  · simp only [mem_singleton_iff] at hx
    subst x
    norm_num

theorem second_nonneg

TopologyByExample.BookEmbeddings.second_nonneg

private theorem second_nonneg {x : ℝ} (hx : x ∈ secondSet) : 0 ≤ x
Proof
:= by
  rcases hx with (hx | hx) | hx
  · exact hx.1
  · simp only [mem_singleton_iff] at hx
    subst x
    norm_num
  · simp only [mem_singleton_iff] at hx
    subst x
    norm_num

theorem no_strictMono_image

TopologyByExample.BookEmbeddings.no_strictMono_image

An increasing map cannot carry the first arrangement onto the second.

theorem no_strictMono_image {f : ℝ → ℝ} (hf : StrictMono f) :
    f '' firstSet ≠ secondSet
Proof
:= by
  intro he
  have hzero : (0 : ℝ) ∈ firstSet := by simp [firstSet]
  have hmin : f 0 = 0 := by
    have hlo := second_nonneg (he ▸ mem_image_of_mem f hzero)
    obtain ⟨x, hx, hfx⟩ := he.symm ▸ (show (0 : ℝ) ∈ secondSet by simp [secondSet])
    have hhi := hf.monotone (first_bounds hx).1
    rw [hfx] at hhi
    exact le_antisymm hhi hlo
  have hpos : 0 < f 1 := by simpa [hmin] using hf (show (0 : ℝ) < 1 by norm_num)
  let y : ℝ := min (f 1) 1 / 2
  have hypos : 0 < y := by dsimp [y]; positivity
  have hylt : y < f 1 := by dsimp [y]; linarith [min_le_left (f 1) 1]
  have hyone : y ≤ 1 := by dsimp [y]; linarith [min_le_right (f 1) 1]
  have hy : y ∈ secondSet := Or.inl (Or.inl ⟨hypos.le, hyone⟩)
  obtain ⟨x, hx, hfx⟩ := he.symm ▸ hy
  have hxpos : 0 < x := hf.lt_iff_lt.mp (by rw [hfx, hmin]; exact hypos)
  have hxlt : x < 1 := hf.lt_iff_lt.mp (by rw [hfx]; exact hylt)
  rcases hx with (hx | hx) | hx
  · simp only [mem_singleton_iff] at hx
    linarith
  · linarith [hx.1]
  · simp only [mem_singleton_iff] at hx
    linarith

theorem no_strictAnti_image

TopologyByExample.BookEmbeddings.no_strictAnti_image

A decreasing map cannot carry the first arrangement onto the second.

theorem no_strictAnti_image {f : ℝ → ℝ} (hf : StrictAnti f) :
    f '' firstSet ≠ secondSet
Proof
:= by
  intro he
  have hthree : (3 : ℝ) ∈ firstSet := by simp [firstSet]
  have hmin : f 3 = 0 := by
    have hlo := second_nonneg (he ▸ mem_image_of_mem f hthree)
    obtain ⟨x, hx, hfx⟩ := he.symm ▸ (show (0 : ℝ) ∈ secondSet by simp [secondSet])
    have hhi := hf.antitone (first_bounds hx).2
    rw [hfx] at hhi
    exact le_antisymm hhi hlo
  have hpos : 0 < f 2 := by simpa [hmin] using hf (show (2 : ℝ) < 3 by norm_num)
  let y : ℝ := min (f 2) 1 / 2
  have hypos : 0 < y := by dsimp [y]; positivity
  have hylt : y < f 2 := by dsimp [y]; linarith [min_le_left (f 2) 1]
  have hyone : y ≤ 1 := by dsimp [y]; linarith [min_le_right (f 2) 1]
  have hy : y ∈ secondSet := Or.inl (Or.inl ⟨hypos.le, hyone⟩)
  obtain ⟨x, hx, hfx⟩ := he.symm ▸ hy
  have hxlt : x < 3 := hf.lt_iff_gt.mp (by rw [hfx, hmin]; exact hypos)
  have hxgt : 2 < x := hf.lt_iff_gt.mp (by rw [hfx]; exact hylt)
  rcases hx with (hx | hx) | hx
  · simp only [mem_singleton_iff] at hx
    linarith
  · linarith [hx.2]
  · simp only [mem_singleton_iff] at hx
    linarith

theorem no_ambient_homeomorph

TopologyByExample.BookEmbeddings.no_ambient_homeomorph

No ambient real-line homeomorphism identifies the two homeomorphic subspaces.

theorem no_ambient_homeomorph : ¬∃ h : ℝ ≃ₜ ℝ, h '' firstSet = secondSet
Proof
:= by
  rintro ⟨h, he⟩
  rcases h.continuous.strictMono_of_inj h.injective with hm | ha
  · exact no_strictMono_image hm he
  · exact no_strictAnti_image ha he

On this site: Closed interval with two isolated points: Homeomorphic subspaces need not be ambiently homeomorphic