Lean library · module TopologyByExample.Theorems.LexicographicSum

Lexicographic sums of linear orders

Source file

Two order-theoretic facts about the lexicographic sum α ⊕ₗ β of linear orders (every element of α below every element of β), used to build the long line from two copies of the long ray.

  • If α is a conditionally complete linear order and β a conditionally complete linear order with a least element, every nonempty set of α ⊕ₗ β with an upper bound has a least upper bound: the least element of β fills the gap between the two parts.
  • If α has no greatest element, every ray [a, →) of α and every ray (←, b] of β has a countable order-dense subset, then so does every closed interval of α ⊕ₗ β.

Main statements

Tags

lexicographic sum, linear order, least upper bound, conditionally complete, countable dense set

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
variable {α β : Type*} [ConditionallyCompleteLinearOrder α] [ConditionallyCompleteLinearOrderBot β]

theorem exists_isLUB

TopologyByExample.SumLex.exists_isLUB

In the lexicographic sum α ⊕ₗ β of a conditionally complete linear order and a conditionally complete linear order with a least element, every nonempty set with an upper bound has a least upper bound.

theorem exists_isLUB (s : Set (α ⊕ₗ β)) (hs : s.Nonempty) (hb : BddAbove s) :
    ∃ x, IsLUB s x
Proof
:= by
  open Sum.Lex in
  set A : Set α := {a | toLex (Sum.inl a) ∈ s}
  set B : Set β := {b | toLex (Sum.inr b) ∈ s}
  by_cases hB : B.Nonempty
  · -- the supremum of the right-hand part
    obtain ⟨u, hu⟩ := hb
    obtain ⟨b₀, hb₀⟩ := hB
    have hu' : ∃ c, u = toLex (Sum.inr c) := by
      obtain ⟨u | c, rfl⟩ := toLex.surjective u
      · exact absurd (hu hb₀) not_inr_le_inl
      · exact ⟨c, rfl⟩
    obtain ⟨c, rfl⟩ := hu'
    have hBb : BddAbove B := ⟨c, fun b hb ↦ inr_le_inr_iff.1 (hu hb)⟩
    refine ⟨toLex (Sum.inr (sSup B)), fun x hx ↦ ?_, fun v hv ↦ ?_⟩
    · obtain ⟨x | x, rfl⟩ := toLex.surjective x
      · exact inl_le_inr _ _
      · exact inr_le_inr_iff.2 (le_csSup hBb hx)
    · obtain ⟨v | v, rfl⟩ := toLex.surjective v
      · exact absurd (hv hb₀) not_inr_le_inl
      · exact inr_le_inr_iff.2 (csSup_le ⟨b₀, hb₀⟩ fun b hb ↦ inr_le_inr_iff.1 (hv hb))
  · have hA : A.Nonempty := by
      obtain ⟨x, hx⟩ := hs
      obtain ⟨x | x, rfl⟩ := toLex.surjective x
      · exact ⟨x, hx⟩
      · exact absurd ⟨x, hx⟩ hB
    have hsA (x) (hx : x ∈ s) : ∃ a ∈ A, x = toLex (Sum.inl a) := by
      obtain ⟨x | x, rfl⟩ := toLex.surjective x
      · exact ⟨x, hx, rfl⟩
      · exact absurd ⟨x, hx⟩ hB
    by_cases hAb : BddAbove A
    · refine ⟨toLex (Sum.inl (sSup A)), fun x hx ↦ ?_, fun v hv ↦ ?_⟩
      · obtain ⟨a, ha, rfl⟩ := hsA x hx
        exact inl_le_inl_iff.2 (le_csSup hAb ha)
      · obtain ⟨v | v, rfl⟩ := toLex.surjective v
        · exact inl_le_inl_iff.2 (csSup_le hA fun a ha ↦ inl_le_inl_iff.1 (hv ha))
        · exact inl_le_inr _ _
    · refine ⟨toLex (Sum.inr ⊥), fun x hx ↦ ?_, fun v hv ↦ ?_⟩
      · obtain ⟨a, -, rfl⟩ := hsA x hx
        exact inl_le_inr _ _
      · obtain ⟨v | v, rfl⟩ := toLex.surjective v
        · exact absurd ⟨v, fun a ha ↦ inl_le_inl_iff.1 (hv ha)⟩ hAb
        · exact inr_le_inr_iff.2 bot_le

On this site: Theorem: Least upper bounds in a lexicographic sum

theorem exists_countable_dense

TopologyByExample.SumLex.exists_countable_dense

In the lexicographic sum α ⊕ₗ β of two nonempty linear orders, the first without a greatest element, if every ray [a, →) of α and every ray (←, b] of β has a countable order-dense subset, then so does every closed interval of α ⊕ₗ β.

theorem exists_countable_dense {α β : Type*} [LinearOrder α] [LinearOrder β] [Nonempty α]
    [Nonempty β] [NoMaxOrder α]
    (hα : ∀ a : α, ∃ D : Set α, D.Countable ∧ ∀ x y, a ≤ x → x < y → ∃ d ∈ D, x < d ∧ d < y)
    (hβ : ∀ b : β, ∃ D : Set β, D.Countable ∧ ∀ x y, x < y → y ≤ b → ∃ d ∈ D, x < d ∧ d < y)
    (a b : α ⊕ₗ β) : ∃ D : Set (α ⊕ₗ β), D.Countable ∧
      ∀ x y, a ≤ x → x < y → y ≤ b → ∃ d ∈ D, x < d ∧ d < y
Proof
:= by
  obtain ⟨a₀, ha₀⟩ : ∃ a₀ : α, toLex (Sum.inl a₀) ≤ a := by
    obtain ⟨a | a, rfl⟩ := toLex.surjective a
    · exact ⟨a, le_rfl⟩
    · exact ⟨Classical.arbitrary α, inl_le_inr _ _⟩
  obtain ⟨b₀, hb₀⟩ : ∃ b₀ : β, b ≤ toLex (Sum.inr b₀) := by
    obtain ⟨b | b, rfl⟩ := toLex.surjective b
    · exact ⟨Classical.arbitrary β, inl_le_inr _ _⟩
    · exact ⟨b, le_rfl⟩
  obtain ⟨A, hAc, hA⟩ := hα a₀
  obtain ⟨B, hBc, hB⟩ := hβ b₀
  refine ⟨(fun d ↦ toLex (Sum.inl d)) '' A ∪ (fun d ↦ toLex (Sum.inr d)) '' B,
    (hAc.image _).union (hBc.image _), fun x y hx hxy hy ↦ ?_⟩
  have hx' := ha₀.trans hx
  have hy' := hy.trans hb₀
  obtain ⟨x | x, rfl⟩ := toLex.surjective x <;> obtain ⟨y | y, rfl⟩ := toLex.surjective y
  · obtain ⟨d, hd, h₁, h₂⟩ := hA x y (inl_le_inl_iff.1 hx') (inl_lt_inl_iff.1 hxy)
    exact ⟨_, .inl ⟨d, hd, rfl⟩, inl_lt_inl_iff.2 h₁, inl_lt_inl_iff.2 h₂⟩
  · obtain ⟨x', hx''⟩ := exists_gt x
    obtain ⟨d, hd, h₁, -⟩ := hA x x' (inl_le_inl_iff.1 hx') hx''
    exact ⟨_, .inl ⟨d, hd, rfl⟩, inl_lt_inl_iff.2 h₁, inl_lt_inr _ _⟩
  · exact absurd hxy not_inr_lt_inl
  · obtain ⟨d, hd, h₁, h₂⟩ := hB x y (inr_lt_inr_iff.1 hxy) (inr_le_inr_iff.1 hy')
    exact ⟨_, .inr ⟨d, hd, rfl⟩, inr_lt_inr_iff.2 h₁, inr_lt_inr_iff.2 h₂⟩

On this site: Theorem: Countable order-dense sets in a lexicographic sum