feat(Order/Completion): embed a linear order into a dense and complete linear order#37939
feat(Order/Completion): embed a linear order into a dense and complete linear order#37939AntoineChambert-Loir wants to merge 28 commits intoleanprover-community:masterfrom
Conversation
PR summary cb39573f93Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
|
What's the theorem you're trying to prove? Every linear order with the order topology embeds via a continuous map into a dense complete linear order? |
|
Yes, but I need that embedding to be continuous for the order topologies. Then the lex product with Q doesn't work, and I believe i'll have to fill the holes but nothing more. (I updated the above description.) |
|
I believe |
|
Embedding In other words, you're adding a copy of ℚ in between any two consecutive elements. |
|
Exactly, that's what I meant with “filling the holes”. |
|
I find it easier (the formalization will say so, or not) to define an adequate Sigma type. |
vihdzp
left a comment
There was a problem hiding this comment.
I'll try out my own formalization of this order, if it's any simpler than this I'll let you know.
|
This is one fourth the length of your code :) /-
Copyright (c) 2026 Violeta Hernández Palacios. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Violeta Hernández Palacios, Antoine Chambert-Loir
-/
module
public import Mathlib.Data.Prod.Lex
public import Mathlib.Order.SuccPred.Limit
public import Mathlib.Topology.Order.Basic
import Mathlib.Algebra.Order.Field.Basic
@[expose] public section
namespace Order
variable {α : Type*} [LinearOrder α]
/-- A dense linear order into which α embeds continuously, formed by "filling in" the blanks. -/
abbrev Fill (α : Type*) [LinearOrder α] : Type _ :=
{x : α ×ₗ ℚ //
(IsSuccPrelimit (ofLex x).1 → 0 ≤ (ofLex x).2) ∧
(IsPredPrelimit (ofLex x).1 → (ofLex x).2 ≤ 0) }
namespace Fill
instance [TopologicalSpace α] [OrderTopology α] : TopologicalSpace (Fill α) :=
Preorder.topology _
instance [TopologicalSpace α] [OrderTopology α] : OrderTopology (Fill α) :=
⟨rfl⟩
/-- A continuous embedding of `α` into `Fill α`. -/
def some : α ↪o Fill α where
toFun x := ⟨toLex (x, 0), by simp⟩
inj' _ := by simp
map_rel_iff' := by simp [Prod.Lex.toLex_le_toLex']
instance : DenselyOrdered (Fill α) where
dense := by
simp only [ofLex_toLex, Subtype.forall, Prod.Lex.lt_iff, Subtype.mk_lt_mk,
Lex.forall, Prod.forall]
rintro x q ⟨hx₁, hx₂⟩ y r ⟨hy₁, hy₂⟩ (h | ⟨rfl, h⟩)
· by_cases hx : IsPredPrelimit x
· obtain ⟨z, hz, hz'⟩ := hx.lt_iff_exists_lt.1 h
use some z
simp [some, Prod.Lex.lt_iff, hz', hz]
obtain ⟨s, hs⟩ := exists_gt (max 0 q)
rw [max_lt_iff] at hs
refine ⟨⟨toLex (x, s), ?_⟩, ?_⟩
· simp [hx, hs.1.le]
· simp [Prod.Lex.lt_iff, hs.2, h]
· obtain ⟨s, hs, hs'⟩ := exists_between h
refine ⟨⟨toLex (x, s), ?_⟩, ?_⟩
· grind [ofLex_toLex]
· simp [Prod.Lex.lt_iff, hs, hs']
theorem continuous_some [TopologicalSpace α] [OrderTopology α] : Continuous (X := α) some := by
simp only [OrderTopology.continuous_iff, ofLex_toLex, Subtype.forall, Lex.forall, Prod.forall]
refine fun x q ⟨hx₁, hx₂⟩ ↦ ⟨?_, ?_⟩
· obtain hq | hq := le_or_gt 0 q
· convert isOpen_Ioi (a := x)
ext
simp [some, Prod.Lex.lt_iff, hq.not_gt]
· obtain ⟨y, hy⟩ := (not_isSuccPrelimit_iff_exists_covBy _).1 <| mt hx₁ hq.not_ge
convert isOpen_Ioi (a := y)
ext
simpa [some, Prod.Lex.lt_iff, hq, le_iff_lt_or_eq] using hy.le_iff_lt_right
· obtain hq | hq := le_or_gt q 0
· convert isOpen_Iio (a := x)
ext
simp [some, Prod.Lex.lt_iff, hq.not_gt]
· obtain ⟨y, hy⟩ := (not_isPredPrelimit_iff_exists_covBy _).1 <| mt hx₂ hq.not_ge
convert isOpen_Iio (a := y)
ext
simpa [some, Prod.Lex.lt_iff, hq, le_iff_lt_or_eq] using hy.le_iff_lt_left
end Fill
end Order |
|
It's shorter but it does less, although this “less” (holes, etc.) might be uninteresting, and I'm not so happy with the going through |
|
What else do you need it to do? Isn't the core result "any linear order embeds continuously into a dense linear order"? |
|
I'm more interested into formalizing the how and the why than the what. It's OK, the core result is there. |
|
Both of our constructions are ultimately isomorphic, so I don't see what distinction you're making. |
|
I spent way too long trying to build something withe the flexibility of Antoine's approach as well as the conciseness of Violeta's, but this is not a huge success. One thing to note is that Antoine's construction also works for densifying a partial order, as long as the order relation on holes compares both the left and the right components (which is still more natural, and in the linearly ordered case it's the same). I think a reasonable middle ground (to keep some flexibility while still allowing for a more direct approach) would be to fill all holes with a single order. Then I would define How does this sound ? Antoine, do you have any reason to believe that the flexibility of putting a different order at different holes could matter for some application ? |
The theorem that any order embeds in a dense order (not necessarily continuously) is trivial, since you can just take the lex product with the rationals (or any other dense nonempty order). The key property here is continuity, but the order topology doesn't really make sense in a partial order (it is well-defined, but rarely if ever the topology you actually want to put on it). |
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
vihdzp
left a comment
There was a problem hiding this comment.
I'm not all too comfortable with having [TopologicalSpace (DedekindCut α)] [OrderTopology (DedekindCut α)] as assumptions to a theorem. But other than that, this LGTM.
The aim of the PR is to prove the following theorem that will be used as an input to Sion.DMCompletion.exists_isSaddlePointOn :
If
βis any linear order, then there exists a complete and dense linear orderγtogether with a continuous embeddingι : β ↪o γ(for the order topologies onβandγ).Meanwhile, the PR also records various instances about dense orders and lemmas regarding the Dedekind MacNeille completion and lexicographic orders.