English
The truncatedSup of a Finset s at a is defined as a conditional supremum: if a ∈ lowerClosure(s), then (s ∩ {b | a ≤ b}).sup' (sup_aux h) id; otherwise ⊤.
Русский
Обозначение truncatedSup(s,a) — это условный верхний предел; если a принадлежит lowerClosure(s), то он равен sup'({b ∈ s | a ≤ b}); иначе ⊤.
LaTeX
$$truncatedSup(s,a) = if a ∈ lowerClosure(s) then {b ∈ s | a ≤ b}.sup'(sup_aux h) id else ⊤$$
Lean4
/-- The supremum of the elements of `s` less than `a` if there are some, otherwise `⊤`. -/
def truncatedSup (s : Finset α) (a : α) : α :=
if h : a ∈ lowerClosure s then {b ∈ s | a ≤ b}.sup' (sup_aux h) id else ⊤