Zulip Chat Archive
Stream: mathlib4
Topic: Improvements to OmegaCompletePartialOrder.lean
Anthony Vandikas (Jan 14 2026 at 20:37):
As part of the work @Kiarash Sotoudeh and I have been doing on formalizing (ω) quasi-borel spaces, we have been filling in some missing functionality that I believe belongs in OmegaCompletePartialOrder.lean. This includes:
- Teaching
fun_propaboutωScottContinuousfunctions. OmegaCompletePartialOrderinstances forOption,Sum, andSigma.- Various
Chainconstructions necessary for the aforementioned instances. ωScottContinuousproofs for various basic functions (e.g.,Prod.fst,ite, ...).
Is this appropriate for mathlib? I've made an initial PR for the first item (#33941).
Ruben Van de Velde (Jan 14 2026 at 21:06):
Sounds welcome, yeah
Yaël Dillies (Jan 14 2026 at 21:31):
Sure, yes! Feel free to request my review in case the other reviewing avenues become too slow
Chris Henson (Jan 14 2026 at 22:02):
This will be appreciated downstream as well, where it will be useful for programming language semantics!
One question I have about OmegaCompletePartialOrder instances for Option α (and WithBot α) is that sometimes we would like the "flat" ωCPO where we just have ⊥ ≤ (a : α) and ignore the ordering on α. Can we scope things so that users can choose what instances they want?
Yaël Dillies (Jan 14 2026 at 22:05):
Shouldn't that be the order on WithBot (Discrete α) instead?
Anthony Vandikas (Jan 14 2026 at 22:25):
Part behaves like this and already has an OmegaCompletePartialOrder instance.
Violeta Hernández (Jan 14 2026 at 22:41):
I thought Part was discouraged if not outright deprecated.
Chris Henson (Jan 14 2026 at 22:57):
Violeta Hernández said:
I thought
Partwas discouraged if not outright deprecated.
Part does have the instance I meant, but I similarly had the impression that WithBot was the preferred way to attach a bottom element. Yaël's suggestion of WithBot (Discrete α) seems very nice mathematically, though I don't know at a glance if universes will be an annoyance.
Anthony Vandikas (Jan 16 2026 at 02:41):
Violeta Hernández said:
I thought
Partwas discouraged if not outright deprecated.
Is this documented somewhere? Closest I could find is #mathlib4 > deprecate Mathlib.Data.Nat.PartENat?, and I am not sure that the consensus was to remove Part (at most, it looks like it would be moved to batteries).
I have submitted another PR #33985 containing the OmegaCompletePartialOrder instance for Sum.
Violeta Hernández (Jan 16 2026 at 17:07):
Assuming choice, Part is entirely equivalent to Option, which has much more API. And the consensus (though not universal) is that Mathlib shouldn't bother much with constructivism or decidability.
Aaron Liu (Jan 16 2026 at 19:57):
I don't like Part for a different reason, because it's not the right definition for computations that have the potential to run on forever but are otherwise safe.
Anthony Vandikas (Jan 20 2026 at 23:54):
I have made two more PRs: #34054 for the Sigma instance and #34093 for Option instance.
I expect that I should split up OmegaCompletePartialOrder.lean before any further work as it is getting quite long.
Yaël Dillies said:
Sure, yes! Feel free to request my review in case the other reviewing avenues become too slow
If it's not too much trouble I'd like to take you up on your offer (apologies if a week is too soon, this is my first experience making a PR here :smile:).
Last updated: Feb 28 2026 at 14:05 UTC