Zulip Chat Archive

Stream: mathlib4

Topic: Bounded vs BddAbove


Yury G. Kudryashov (Sep 17 2023 at 22:06):

We have docs#Set.Bounded, docs#BddAbove, and docs#BddBelow. Should we reuse the former for the other two?

Yaël Dillies (Sep 18 2023 at 05:17):

No. Violeta Hernández added (a lot of API for) the former because she didn't know about the latter two, but in general we prefer predicates specialised to <=, >= for usability.

Yury G. Kudryashov (Sep 18 2023 at 14:41):

Should we drop the former then?

Yury G. Kudryashov (Sep 18 2023 at 14:42):

Or at least mention BddAbove/BddBelow in the docstring?

Yaël Dillies (Sep 18 2023 at 14:43):

What are the current uses of Set.Bounded? In principle, I'm happy to drop it.

Yury G. Kudryashov (Sep 19 2023 at 00:59):

It is used in Order/Bounded (a lot), in Order/RelClasses (def + 2 lemmas), Order/WellFounded (2 lemmas), Cardinal/Cofinality (2 theorems), and Ordinal/Arithmetic (once).

Yury G. Kudryashov (Sep 19 2023 at 01:00):

Do you know that Lean 4 extension can show all uses of a definition/lemma?

Yury G. Kudryashov (Sep 19 2023 at 01:00):

(not hidden ones like in by simp)

Alex J. Best (Sep 19 2023 at 01:03):

You can right click and click on "Find all references"

Yaël Dillies (Sep 19 2023 at 06:12):

Ah no I didn't!

Violeta Hernández (Oct 24 2024 at 12:22):

Hi, just found this again, and yes, docs#Set.Bounded and docs#Set.Unbounded should be deprecated

Violeta Hernández (Oct 24 2024 at 12:26):

The file Order/Bounded was made by me to be "basic API for bounded sets" while being unaware of all the API that had already been written for BddAbove / BddBelow

Violeta Hernández (Oct 24 2024 at 12:28):

Order/WellFounded uses it only to define WellFounded.sup, which in my opinion should also be deprecated, since we already have docs#WellFoundedLT.conditionallyCompleteLinearOrderBot

Violeta Hernández (Oct 24 2024 at 12:31):

Its use in Ordinal/Arithmetic as docs#Ordinal.bounded_singleton is really the same thing as saying Ordinal is a NoMaxOrder

Violeta Hernández (Oct 24 2024 at 12:33):

And the theorems in Cardinal/Cofinality should be rewritten in terms of a linear order, rather than an arbitrary well-order relation.

Violeta Hernández (Oct 24 2024 at 12:44):

It's worth pointing out that the use of Set.Unbounded in the cofinality file isn't even correct for partial orders. The correct spelling for a cofinal partial set is ∀ a, ∃ b ∈ S, r a b for r = (· ≤ ·), rather than ∀ a, ∃ b ∈ S, ¬ r b a for r = (· < ·).

Violeta Hernández (Oct 24 2024 at 12:45):

It'd be nice to introduce a Set.Cofinal predicate to supercede it.

Violeta Hernández (Oct 24 2024 at 12:47):

(Really it'd be nice to work with PartialOrder instead of talking about unbundled relations, but since Ordinal is defined as a quotient of IsWellOrder that would introduce other complications)

Violeta Hernández (Oct 24 2024 at 13:42):

Actually, I could register a LinearOrder instance on o.α for o : WellOrder. Then Order.cof can instead take a Preorder instance argument instead of an arbitrary relation.

Violeta Hernández (Oct 24 2024 at 13:43):

And likewise, we can define a Set.Cofinal predicate taking in a LE instance argument

Violeta Hernández (Oct 24 2024 at 14:19):

Violeta Hernández said:

Actually, I could register a LinearOrder instance on o.α for o : WellOrder. Then Order.cof can instead take a Preorder instance argument instead of an arbitrary relation.

#18174 is the first step towards this


Last updated: May 02 2025 at 03:31 UTC