Skip to content

Commit f5ca261

Browse files
committed
finish
1 parent 89d4407 commit f5ca261

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

Mathlib/Data/Fintype/Order.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ lemma Directed.finite_le {ι κ : Sort*} [Nonempty ι] [Finite κ] {f : ι →
195195
simpa using
196196
(hf.comp_of_surjective PLift.down_surjective).finite_set_le (Set.finite_range (PLift.up ∘ g))
197197

198+
theorem DirectedOn.finite_le {s : Set α} (hs₀ : s.Nonempty) (D : DirectedOn r s)
199+
(hs : s.Finite) : ∃ z ∈ s, ∀ i ∈ s, r i z := by
200+
have := hs₀.to_subtype
201+
have := hs.to_subtype
202+
obtain ⟨⟨z, hzs⟩, hz⟩ := D.directed_val.finite_le id
203+
use z, hzs
204+
simpa using hz
205+
198206
variable [Nonempty α] [Preorder α]
199207

200208
theorem Finite.exists_le [IsDirectedOrder α] (f : β → α) : ∃ M, ∀ i, f i ≤ M :=

Mathlib/Order/DirSupClosed.lean

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ Authors: Christopher Hoskin, Violeta Hernández Palacios
55
-/
66
module
77

8+
public import Mathlib.Data.Fintype.Order
89
public import Mathlib.Order.Antisymmetrization
910
public import Mathlib.Order.CompleteLattice.Defs
1011
public import Mathlib.Order.UpperLower.Basic
1112

12-
import Mathlib.Data.Set.Lattice
13+
import Mathlib.Data.Nat.Lattice
1314

1415
/-!
1516
# Sets closed under directed suprema
@@ -300,6 +301,29 @@ theorem dirSupClosed_singleton (a : α) : DirSupClosed {a} := by
300301
theorem dirSupClosedOn_singleton (a : α) : DirSupClosedOn D {a} :=
301302
(dirSupClosed_singleton a).dirSupClosedOn
302303

304+
theorem DirSupClosed.of_finite (hs : s.Finite) : DirSupClosed s := by
305+
intro t ht ht₀ ht₁ a ha
306+
obtain ⟨b, hbt, hb⟩ := ht₁.finite_le ht₀ (hs.subset ht)
307+
exact ht <| ha.unique ⟨hb, fun x hx ↦ hx hbt⟩ ▸ hbt
308+
309+
theorem dirSupClosed_range_nat {f : ℕ → α} (hf : Monotone f) (hf' : IsCofinal (.range f)) :
310+
DirSupClosed (range f) := by
311+
intro s hs hs₀ hs₁ a ha
312+
obtain ⟨_, ⟨n, rfl⟩, han⟩ := hf' a
313+
obtain rfl | han := han.eq_or_lt
314+
· simp
315+
have hfb : BddAbove (f ⁻¹' s) := by
316+
refine ⟨n, fun m hm ↦ ?_⟩
317+
by_contra! hnm
318+
exact (ha.1 hm).not_gt (han.trans_le (hf hnm.le))
319+
refine ⟨sSup (f ⁻¹' s), IsLUB.unique ⟨?_, ?_⟩ ha⟩ <;> intro x hx
320+
· obtain ⟨m, rfl⟩ := hs hx
321+
exact hf (le_csSup hfb hx)
322+
· apply hx (Nat.sSup_mem _ hfb)
323+
obtain ⟨x, hx⟩ := hs₀
324+
obtain ⟨m, rfl⟩ := hs hx
325+
exact ⟨m, hx⟩
326+
303327
end PartialOrder
304328

305329
section LinearOrder

0 commit comments

Comments
 (0)