Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit e8b581a

Browse files
committed
feat(order/countable_dense_linear_order): Relax conditions of embedding_from_countable_to_dense (#12928)
We prove that any countable order embeds in any nontrivial dense order. We also slightly golf the rest of the file.
1 parent 0f9edf9 commit e8b581a

File tree

1 file changed

+37
-43
lines changed

1 file changed

+37
-43
lines changed

src/order/countable_dense_linear_order.lean

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ import order.ideal
1010
1111
## Results
1212
13-
Suppose `α β` are linear orders, with `α` countable and `β` dense, nonempty, without endpoints.
14-
Then there is an order embedding `α ↪ β`. If in addition `α` is dense, nonempty, without
15-
endpoints and `β` is countable, then we can upgrade this to an order isomorphism `α ≃ β`.
13+
Suppose `α β` are orders, with `α` countable and `β` dense, nontrivial. Then there is an order
14+
embedding `α ↪ β`. If in addition `α` is dense, nonempty, without endpoints and `β` is countable,
15+
without endpoints, then we can upgrade this to an order isomorphism `α ≃ β`.
1616
17-
The idea for both results is to consider "partial isomorphisms", which
18-
identify a finite subset of `α` with a finite subset of `β`, and prove that
19-
for any such partial isomorphism `f` and `a : α`, we can extend `f` to
20-
include `a` in its domain.
17+
The idea for both results is to consider "partial isomorphisms", which identify a finite subset of
18+
`α` with a finite subset of `β`, and prove that for any such partial isomorphism `f` and `a : α`, we
19+
can extend `f` to include `a` in its domain.
2120
2221
## References
2322
@@ -26,7 +25,6 @@ https://en.wikipedia.org/wiki/Back-and-forth_method
2625
## Tags
2726
2827
back and forth, dense, countable, order
29-
3028
-/
3129

3230
noncomputable theory
@@ -87,7 +85,7 @@ lemma exists_across [densely_ordered β] [no_min_order β] [no_max_order β] [no
8785
∃ b : β, ∀ (p ∈ f.val), cmp (prod.fst p) a = cmp (prod.snd p) b :=
8886
begin
8987
by_cases h : ∃ b, (a, b) ∈ f.val,
90-
{ cases h with b hb, exact ⟨b, λ p hp, f.property _ hp _ hb⟩, },
88+
{ cases h with b hb, exact ⟨b, λ p hp, f.prop _ hp _ hb⟩, },
9189
have : ∀ (x ∈ (f.val.filter (λ (p : α × β), p.fst < a)).image prod.snd)
9290
(y ∈ (f.val.filter (λ (p : α × β), a < p.fst)).image prod.snd),
9391
x < y,
@@ -96,7 +94,7 @@ begin
9694
rcases hx with ⟨p, hp1, rfl⟩,
9795
rcases hy with ⟨q, hq1, rfl⟩,
9896
rw finset.mem_filter at hp1 hq1,
99-
rw ←lt_iff_lt_of_cmp_eq_cmp (f.property _ hp1.1 _ hq1.1),
97+
rw ←lt_iff_lt_of_cmp_eq_cmp (f.prop _ hp1.1 _ hq1.1),
10098
exact lt_trans hp1.right hq1.right, },
10199
cases exists_between_finsets _ _ this with b hb,
102100
use b,
@@ -125,19 +123,17 @@ variable (β)
125123
def defined_at_left [densely_ordered β] [no_min_order β] [no_max_order β] [nonempty β]
126124
(a : α) : cofinal (partial_iso α β) :=
127125
{ carrier := λ f, ∃ b : β, (a, b) ∈ f.val,
128-
mem_gt :=
129-
begin
130-
intro f,
126+
mem_gt := λ f, begin
131127
cases exists_across f a with b a_b,
132-
refine ⟨⟨insert (a, b) f.val, _⟩, ⟨b, finset.mem_insert_self _ _⟩, finset.subset_insert _ _⟩,
133-
intros p hp q hq,
128+
refine ⟨⟨insert (a, b) f.val, λ p hp q hq, _⟩, ⟨b, finset.mem_insert_self _ _⟩,
129+
finset.subset_insert _ _⟩,
134130
rw finset.mem_insert at hp hq,
135131
rcases hp with rfl | pf;
136132
rcases hq with rfl | qf,
137-
{ simp },
133+
{ simp only [cmp_self_eq_eq] },
138134
{ rw cmp_eq_cmp_symm, exact a_b _ qf },
139135
{ exact a_b _ pf },
140-
{ exact f.property _ pf _ qf },
136+
{ exact f.prop _ pf _ qf },
141137
end }
142138

143139
variables (α) {β}
@@ -146,14 +142,10 @@ variables (α) {β}
146142
def defined_at_right [densely_ordered α] [no_min_order α] [no_max_order α] [nonempty α]
147143
(b : β) : cofinal (partial_iso α β) :=
148144
{ carrier := λ f, ∃ a, (a, b) ∈ f.val,
149-
mem_gt :=
150-
begin
151-
intro f,
145+
mem_gt := λ f, begin
152146
rcases (defined_at_left α b).mem_gt f.comm with ⟨f', ⟨a, ha⟩, hl⟩,
153-
use f'.comm,
154-
split,
155-
{ use a,
156-
change (a, b) ∈ f'.val.image _,
147+
refine ⟨f'.comm, ⟨a, _⟩, _⟩,
148+
{ change (a, b) ∈ f'.val.image _,
157149
rwa [←finset.mem_coe, finset.coe_image, equiv.image_eq_preimage] },
158150
{ change _ ⊆ f'.val.image _,
159151
rw [←finset.coe_subset, finset.coe_image, ← equiv.subset_image],
@@ -182,38 +174,40 @@ open partial_iso
182174

183175
variables (α β)
184176

185-
/-- Any countable linear order embeds in any nonempty dense linear order without endpoints. -/
186-
def embedding_from_countable_to_dense
187-
[encodable α] [densely_ordered β] [no_min_order β] [no_max_order β] [nonempty β] :
188-
α ↪o β :=
189-
let our_ideal : ideal (partial_iso α β) := ideal_of_cofinals default $ defined_at_left β in
190-
let F := λ a, fun_of_ideal a our_ideal (cofinal_meets_ideal_of_cofinals _ _ a) in
191-
order_embedding.of_strict_mono (λ a, (F a).val)
177+
/-- Any countable order embeds in any nontrivial dense linear order. -/
178+
theorem embedding_from_countable_to_dense [encodable α] [densely_ordered β] [nontrivial β] :
179+
nonempty (α ↪o β) :=
192180
begin
193-
intros a₁ a₂,
194-
rcases (F a₁).property with ⟨f, hf, ha₁⟩,
195-
rcases (F a₂).property with ⟨g, hg, ha₂⟩,
181+
rcases exists_pair_lt β with ⟨x, y, hxy⟩,
182+
cases exists_between hxy with a ha,
183+
haveI : nonempty (set.Ioo x y) := ⟨⟨a, ha⟩⟩,
184+
let our_ideal : ideal (partial_iso α _) :=
185+
ideal_of_cofinals default (defined_at_left (set.Ioo x y)),
186+
let F := λ a, fun_of_ideal a our_ideal (cofinal_meets_ideal_of_cofinals _ _ a),
187+
refine ⟨rel_embedding.trans (order_embedding.of_strict_mono (λ a, (F a).val) (λ a₁ a₂, _))
188+
(order_embedding.subtype _)⟩,
189+
rcases (F a₁).prop with ⟨f, hf, ha₁⟩,
190+
rcases (F a₂).prop with ⟨g, hg, ha₂⟩,
196191
rcases our_ideal.directed _ hf _ hg with ⟨m, hm, fm, gm⟩,
197-
exact (lt_iff_lt_of_cmp_eq_cmp $ m.property (a₁, _) (fm ha₁) (a₂, _) (gm ha₂)).mp
192+
exact (lt_iff_lt_of_cmp_eq_cmp $ m.prop (a₁, _) (fm ha₁) (a₂, _) (gm ha₂)).mp
198193
end
199194

200195
/-- Any two countable dense, nonempty linear orders without endpoints are order isomorphic. -/
201-
def iso_of_countable_dense
196+
theorem iso_of_countable_dense
202197
[encodable α] [densely_ordered α] [no_min_order α] [no_max_order α] [nonempty α]
203198
[encodable β] [densely_ordered β] [no_min_order β] [no_max_order β] [nonempty β] :
204-
α ≃o β :=
199+
nonempty (α ≃o β) :=
205200
let to_cofinal : α ⊕ β → cofinal (partial_iso α β) :=
206201
λ p, sum.rec_on p (defined_at_left β) (defined_at_right α) in
207202
let our_ideal : ideal (partial_iso α β) := ideal_of_cofinals default to_cofinal in
208203
let F := λ a, fun_of_ideal a our_ideal (cofinal_meets_ideal_of_cofinals _ to_cofinal (sum.inl a)) in
209204
let G := λ b, inv_of_ideal b our_ideal (cofinal_meets_ideal_of_cofinals _ to_cofinal (sum.inr b)) in
210-
order_iso.of_cmp_eq_cmp (λ a, (F a).val) (λ b, (G b).val)
205+
order_iso.of_cmp_eq_cmp (λ a, (F a).val) (λ b, (G b).val) $ λ a b,
211206
begin
212-
intros a b,
213-
rcases (F a).property with ⟨f, hf, ha⟩,
214-
rcases (G b).property with ⟨g, hg, hb⟩,
207+
rcases (F a).prop with ⟨f, hf, ha⟩,
208+
rcases (G b).prop with ⟨g, hg, hb⟩,
215209
rcases our_ideal.directed _ hf _ hg with ⟨m, hm, fm, gm⟩,
216-
exact m.property (a, _) (fm ha) (_, b) (gm hb)
217-
end
210+
exact m.prop (a, _) (fm ha) (_, b) (gm hb)
211+
end
218212

219213
end order

0 commit comments

Comments
 (0)