Skip to content

Commit 2308156

Browse files
committed
feat(Order/SuccPred): BddAbove.exists_isGreatest_of_nonempty (#15944)
when `IsSuccArchimedean` Co-authored-by: Yakov Pechersky <ffxen158@gmail.com> Co-authored-by: Yakov Pechersky <pechersky@users.noreply.github.com>
1 parent e2b29fb commit 2308156

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Mathlib/Order/SuccPred/Archimedean.lean

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,39 @@ lemma SuccOrder.forall_ne_bot_iff
234234
simp only [Function.iterate_succ', Function.comp_apply]
235235
apply h
236236

237+
section IsLeast
238+
239+
-- TODO: generalize to PartialOrder and `DirectedOn` after #16272
240+
lemma BddAbove.exists_isGreatest_of_nonempty {X : Type*} [LinearOrder X] [SuccOrder X]
241+
[IsSuccArchimedean X] {S : Set X} (hS : BddAbove S) (hS' : S.Nonempty) :
242+
∃ x, IsGreatest S x := by
243+
obtain ⟨m, hm⟩ := hS
244+
obtain ⟨n, hn⟩ := hS'
245+
by_cases hm' : m ∈ S
246+
· exact ⟨_, hm', hm⟩
247+
have hn' := hm hn
248+
revert hn hm hm'
249+
refine Succ.rec ?_ ?_ hn'
250+
· simp (config := {contextual := true})
251+
intro m _ IH hm hn hm'
252+
rw [mem_upperBounds] at IH hm
253+
simp_rw [Order.le_succ_iff_eq_or_le] at hm
254+
replace hm : ∀ x ∈ S, x ≤ m := by
255+
intro x hx
256+
refine (hm x hx).resolve_left ?_
257+
rintro rfl
258+
exact hm' hx
259+
by_cases hmS : m ∈ S
260+
· exact ⟨m, hmS, hm⟩
261+
· exact IH hm hn hmS
262+
263+
lemma BddBelow.exists_isLeast_of_nonempty {X : Type*} [LinearOrder X] [PredOrder X]
264+
[IsPredArchimedean X] {S : Set X} (hS : BddBelow S) (hS' : S.Nonempty) :
265+
∃ x, IsLeast S x :=
266+
hS.dual.exists_isGreatest_of_nonempty hS'
267+
268+
end IsLeast
269+
237270
section OrderIso
238271

239272
variable {X Y : Type*} [PartialOrder X] [PartialOrder Y]

0 commit comments

Comments
 (0)