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

Commit 819939f

Browse files
urkudmergify[bot]
andcommitted
refactor(order/lattice): generalize directed_of_mono (#1879)
It suffices to have `semilattice_sup`, not `decidable_linear_order`. Also add `directed_of_antimono`. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 9f7ae9a commit 819939f

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/order/basic.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,6 @@ theorem directed_mono {s : α → α → Prop} {ι} (f : ι → α)
578578
(H : ∀ a b, r a b → s a b) (h : directed r f) : directed s f :=
579579
λ a b, let ⟨c, h₁, h₂⟩ := h a b in ⟨c, H _ _ h₁, H _ _ h₂⟩
580580

581-
/-- A monotone function on a linear order is directed. -/
582-
lemma directed_of_mono {ι} [decidable_linear_order ι] (f : ι → α)
583-
(H : ∀ i j, i ≤ j → f i ≼ f j) : directed (≼) f :=
584-
λ a b, ⟨max a b, H _ _ (le_max_left _ _), H _ _ (le_max_right _ _)⟩
585-
586581
section prio
587582
set_option default_priority 100 -- see Note [default priority]
588583
class directed_order (α : Type u) extends preorder α :=

src/order/lattice.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ by finish
9696
theorem le_of_sup_eq (h : a ⊔ b = b) : a ≤ b :=
9797
by finish
9898

99+
/-- A monotone function on a sup-semilattice is directed. -/
100+
lemma directed_of_mono {β} (f : α → β) {r : β → β → Prop}
101+
(H : ∀ ⦃i j⦄, i ≤ j → r (f i) (f j)) : directed r f :=
102+
λ a b, ⟨a ⊔ b, H le_sup_left, H le_sup_right⟩
103+
99104
@[simp] lemma sup_lt_iff [is_total α (≤)] {a b c : α} : b ⊔ c < a ↔ b < a ∧ c < a :=
100105
begin
101106
cases (is_total.total (≤) b c) with h,
@@ -199,6 +204,11 @@ by finish
199204
theorem le_of_inf_eq (h : a ⊓ b = a) : a ≤ b :=
200205
by finish
201206

207+
/-- An antimonotone function on a sup-semilattice is directed. -/
208+
lemma directed_of_antimono {β} (f : α → β) {r : β → β → Prop}
209+
(H : ∀ ⦃i j⦄, i ≤ j → r (f j) (f i)) : directed r f :=
210+
λ a b, ⟨a ⊓ b, H inf_le_left, H inf_le_right⟩
211+
202212
@[simp] lemma lt_inf_iff [is_total α (≤)] {a b c : α} : a < b ⊓ c ↔ a < b ∧ a < c :=
203213
begin
204214
cases (is_total.total (≤) b c) with h,

src/topology/bases.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ begin
8484
refine (has_countable_basis_iff_mono_seq f).trans (exists_congr $ λ x, and_congr_right _),
8585
intro hmono,
8686
have : directed (≥) (λ i, principal (x i)),
87-
from directed_of_mono _ _ (λ i j hij, principal_mono.2 (hmono _ _ hij)),
87+
from directed_of_mono _ (λ i j hij, principal_mono.2 (hmono _ _ hij)),
8888
simp only [filter.ext_iff, mem_infi this0⟩, mem_Union, mem_principal_sets]
8989
end
9090

src/topology/sequences.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ instance [topological_space α] [first_countable_topology α] : sequential_space
187187
have gssnhds : ∀ s ∈ 𝓝 p, ∃ i, g i ⊆ s,
188188
{ intro s, rw gbasis, rw mem_infi,
189189
{ simp, intros i hi, use i, assumption },
190-
{ apply directed_of_mono, intros, apply principal_mono.mpr, apply gmon, assumption },
190+
{ apply lattice.directed_of_mono, intros, apply principal_mono.mpr, apply gmon, assumption },
191191
{ apply_instance } },
192192
-- For the sequence (x i) we can now show that a) it lies in M, and b) converges to p.
193193
⟨λ i, (x i).val, by intro i; simp [(x i).property.right],

0 commit comments

Comments
 (0)