-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(Order/Completion): embed a linear order into a dense and complete linear order #37939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AntoineChambert-Loir
wants to merge
28
commits into
leanprover-community:master
Choose a base branch
from
AntoineChambert-Loir:ACL/DedekindCut
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+208
−3
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
fcb1bfe
initial commit
AntoineChambert-Loir f3a42c7
add file
AntoineChambert-Loir 587f6e4
adjust linter
AntoineChambert-Loir f9caa5a
attempt
AntoineChambert-Loir 6107db0
correct docstring
AntoineChambert-Loir 0b89936
delete DenseCompletion
AntoineChambert-Loir 5196de9
adjust Mathlib after deletion
AntoineChambert-Loir 3312bcd
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir b32d2d4
Update Mathlib/Data/Prod/Lex.lean
AntoineChambert-Loir 95b570a
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir 8692fb9
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir 282b045
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir c981710
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir aac6538
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir b805994
Update Mathlib/Order/Completion.lean
AntoineChambert-Loir 80d17dd
modify to_dual tag
AntoineChambert-Loir e2d9c93
add Fill file
AntoineChambert-Loir 3f200df
use code by VHP
AntoineChambert-Loir d6d9f61
Merge branch 'master' into ACL/DedekindCut
AntoineChambert-Loir 3439a43
remove public in import
AntoineChambert-Loir ee5b25d
Merge branch 'ACL/DedekindCut' of github.com:AntoineChambert-Loir/mat…
AntoineChambert-Loir e9aad90
add file!
AntoineChambert-Loir d2ac476
remove arguments
AntoineChambert-Loir 0b1b164
remove unused import
AntoineChambert-Loir bf4dadc
Apply suggestions from code review
AntoineChambert-Loir d092afa
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 62408bf
adjust
AntoineChambert-Loir 8fd05a1
replace completion
AntoineChambert-Loir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| /- | ||
| 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 | ||
| public import Mathlib.Order.UpperLower.CompleteLattice | ||
| public import Mathlib.Order.Completion | ||
|
|
||
| import Mathlib.Algebra.Order.Field.Basic | ||
|
|
||
| /-! | ||
| # Dense and continuous completion of a linear order | ||
|
|
||
| Let `α` be a linear order. | ||
|
|
||
| * `DedekindCut.continuous_principal`: the canonical map | ||
| `DedekindCut.principal : α → DedekindCut α` is continuous for the order topologies. | ||
| * `Order.Fill α`: a dense linear order that extends `α`. | ||
| * `Order.Fill.some`: the order embedding `α ↪o Order.Fill α`/. | ||
| * `Order.Fill.continuous_some`: the map `⇑Order.Fill.some` | ||
| is continuous for the order topologies. | ||
| * `Order.exists_dense_continuous_completion`: | ||
| any linear order embeds continuously (for the order topologies) | ||
| into a dense and complete linear order. | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| open Set | ||
|
|
||
| variable {α : Type*} [LinearOrder α] | ||
|
|
||
| theorem DedekindCut.continuous_principal [TopologicalSpace α] [OrderTopology α] | ||
|
AntoineChambert-Loir marked this conversation as resolved.
|
||
| [TopologicalSpace (DedekindCut α)] [OrderTopology (DedekindCut α)] : | ||
|
AntoineChambert-Loir marked this conversation as resolved.
|
||
| Continuous (fun a : α ↦ principal a) := by | ||
| rw [OrderTopology.continuous_iff] | ||
| refine fun c ↦ ⟨?_, ?_⟩ | ||
| · have : IsOpen (⋃ a ∈ c.right, Ioi a) := isOpen_biUnion fun _ _ ↦ isOpen_Ioi | ||
| convert this | ||
| ext | ||
| simp [lt_principal_iff] | ||
| · have : IsOpen (⋃ a ∈ c.left, Iio a) := isOpen_biUnion fun _ _ ↦ isOpen_Iio | ||
| convert this | ||
| ext | ||
| simp [principal_lt_iff] | ||
|
|
||
| namespace Order | ||
|
|
||
| /-- 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 (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 | ||
|
|
||
| universe u | ||
|
|
||
| /-- Every linear order embeds continuously in a dense complete linear order. -/ | ||
| theorem exists_dense_continuous_completion | ||
| (α : Type u) [LinearOrder α] [TopologicalSpace α] [OrderTopology α] : | ||
| ∃ (β : Type u) (_ : CompleteLinearOrder β) (_ : DenselyOrdered β) (_ : TopologicalSpace β) | ||
| (_ : OrderTopology β) (ι : α ↪o β), Continuous ι := | ||
| let : TopologicalSpace (DedekindCut (Fill α)) := Preorder.topology _ | ||
| have : OrderTopology (DedekindCut (Fill α)) := ⟨rfl⟩ | ||
| ⟨_, inferInstance, inferInstance, inferInstance, inferInstance, | ||
| Fill.some.trans DedekindCut.principalEmbedding, | ||
| DedekindCut.continuous_principal.comp Fill.continuous_some⟩ | ||
|
|
||
| end Order | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.