Skip to content

[Merged by Bors] - feat: define ConditionallyCompletePartialOrder#35046

Closed
j-loreaux wants to merge 2 commits intoleanprover-community:masterfrom
j-loreaux:CCPO-def
Closed

[Merged by Bors] - feat: define ConditionallyCompletePartialOrder#35046
j-loreaux wants to merge 2 commits intoleanprover-community:masterfrom
j-loreaux:CCPO-def

Conversation

@j-loreaux
Copy link
Copy Markdown
Contributor

@j-loreaux j-loreaux commented Feb 9, 2026

This file defines conditionally complete partial orders with suprema, infima or both. These are partial orders where every nonempty, upwards (downwards) directed set which is bounded above (below) has a least upper bound (greatest lower bound). This class extends SupSet (InfSet) and the requirement is that sSup (sInf) must be the least upper bound.

The three classes defined herein are:

  • ConditionallyCompletePartialOrderSup for partial orders with suprema,
  • ConditionallyCompletePartialOrderInf for partial orders with infima, and
  • ConditionallyCompletePartialOrder for partial orders with both suprema and infima

One common use case for these classes is the order on a von Neumann algebra, or W⋆-algebra. This is the strongest order-theoretic structure satisfied by a von Neumann algebra; in particular it is not a conditionally complete lattice, and indeed it is a lattice if and only if the algebra is commutative. In addition, can be made to satisfy this class (one must provide a suitable SupSet instance), with the order w ≤ z ↔ w.re ≤ z.re ∧ w.im = z.im, which is available in the ComplexOrder namespace.

These use cases are the motivation for defining three classes, as compared with other parts of the order theory library, where only the supremum versions are defined (e.g., CompletePartialOrder and OmegaCompletePartialOrder). We note that, if these classes are used outside of order theory, then it is more likely that the infimum versions would be useful. Indeed, whenever the underlying type has an antitone involution (e.g., if it is an ordered ring, then negation would be such a map), then any ConditionallyCompletePartialOrder{Sup,Inf} is automatically a ConditionallyCompletePartialOrder. Because of the to_dual attribute, the additional overhead required to add and maintain the infimum version is minimal.


In a follow-up PR, we provide a more robust API and generalize some lemmas from ConditionallyCompleteLattice to ConditionallyCompletePartialOrder{Sup,Inf}.

Open in Gitpod

@github-actions github-actions bot added the t-order Order theory label Feb 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 9, 2026

PR summary 668a53718f

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Order.ConditionallyCompletePartialOrder.Defs (new file) 207

Declarations diff

+ ConditionallyCompletePartialOrder
+ ConditionallyCompletePartialOrderInf
+ ConditionallyCompletePartialOrderSup
+ Directed.ciSup_le
+ Directed.le_ciSup
+ DirectedOn.csSup_le
+ DirectedOn.isLUB_csSup
+ DirectedOn.le_csSup

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

Copy link
Copy Markdown
Contributor

@b-mehta b-mehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also have the instance that every ConditionallyCompletePartialOrderSup is a CompletePartialOrder?

@j-loreaux
Copy link
Copy Markdown
Contributor Author

j-loreaux commented Feb 9, 2026

@b-mehta Sure, can I put it in the Basic file in the follow-up PR? (EDIT : done in #35047, but let me know if you want me to pull it into this PR)

Comment thread Mathlib/Order/ConditionallyCompletePartialOrder/Defs.lean Outdated
@j-loreaux j-loreaux requested a review from b-mehta February 12, 2026 20:09
Copy link
Copy Markdown
Contributor

@b-mehta b-mehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Feb 12, 2026
This file defines *conditionally complete partial orders* with suprema, infima or both. These are partial orders where every nonempty, upwards (downwards) directed set which is bounded above (below) has a least upper bound (greatest lower bound). This class extends `SupSet` (`InfSet`) and the requirement is that `sSup` (`sInf`) must be the least upper bound.

The three classes defined herein are:

+ `ConditionallyCompletePartialOrderSup` for partial orders with suprema,
+ `ConditionallyCompletePartialOrderInf` for partial orders with infima, and
+ `ConditionallyCompletePartialOrder` for partial orders with both suprema and infima

One common use case for these classes is the order on a von Neumann algebra, or W⋆-algebra. This is the strongest order-theoretic structure satisfied by a von Neumann algebra; in particular it is *not* a conditionally complete *lattice*, and indeed it is a lattice if and only if the algebra is commutative. In addition, `ℂ` can be made to satisfy this class (one must provide a suitable `SupSet` instance), with the order `w ≤ z ↔ w.re ≤ z.re ∧ w.im = z.im`, which is available in the `ComplexOrder` namespace.

These use cases are the motivation for defining three classes, as compared with other parts of the order theory library, where only the supremum versions are defined (e.g., `CompletePartialOrder` and `OmegaCompletePartialOrder`). We note that, if these classes are used outside of order theory, then it is more likely that the infimum versions would be useful. Indeed, whenever the underlying type has an antitone involution (e.g., if it is an ordered ring, then negation would be such a map), then any `ConditionallyCompletePartialOrder{Sup,Inf}` is automatically a `ConditionallyCompletePartialOrder`. Because of the `to_dual` attribute, the additional overhead required to add and maintain the infimum version is minimal.
@mathlib-triage mathlib-triage bot added the ready-to-merge This PR has been sent to bors. label Feb 12, 2026
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Feb 12, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: define ConditionallyCompletePartialOrder [Merged by Bors] - feat: define ConditionallyCompletePartialOrder Feb 12, 2026
@mathlib-bors mathlib-bors bot closed this Feb 12, 2026
kim-em pushed a commit to kim-em/mathlib4 that referenced this pull request Feb 14, 2026
…y#35046)

This file defines *conditionally complete partial orders* with suprema, infima or both. These are partial orders where every nonempty, upwards (downwards) directed set which is bounded above (below) has a least upper bound (greatest lower bound). This class extends `SupSet` (`InfSet`) and the requirement is that `sSup` (`sInf`) must be the least upper bound.

The three classes defined herein are:

+ `ConditionallyCompletePartialOrderSup` for partial orders with suprema,
+ `ConditionallyCompletePartialOrderInf` for partial orders with infima, and
+ `ConditionallyCompletePartialOrder` for partial orders with both suprema and infima

One common use case for these classes is the order on a von Neumann algebra, or W⋆-algebra. This is the strongest order-theoretic structure satisfied by a von Neumann algebra; in particular it is *not* a conditionally complete *lattice*, and indeed it is a lattice if and only if the algebra is commutative. In addition, `ℂ` can be made to satisfy this class (one must provide a suitable `SupSet` instance), with the order `w ≤ z ↔ w.re ≤ z.re ∧ w.im = z.im`, which is available in the `ComplexOrder` namespace.

These use cases are the motivation for defining three classes, as compared with other parts of the order theory library, where only the supremum versions are defined (e.g., `CompletePartialOrder` and `OmegaCompletePartialOrder`). We note that, if these classes are used outside of order theory, then it is more likely that the infimum versions would be useful. Indeed, whenever the underlying type has an antitone involution (e.g., if it is an ordered ring, then negation would be such a map), then any `ConditionallyCompletePartialOrder{Sup,Inf}` is automatically a `ConditionallyCompletePartialOrder`. Because of the `to_dual` attribute, the additional overhead required to add and maintain the infimum version is minimal.
rao107 pushed a commit to rao107/mathlib4 that referenced this pull request Feb 18, 2026
…y#35046)

This file defines *conditionally complete partial orders* with suprema, infima or both. These are partial orders where every nonempty, upwards (downwards) directed set which is bounded above (below) has a least upper bound (greatest lower bound). This class extends `SupSet` (`InfSet`) and the requirement is that `sSup` (`sInf`) must be the least upper bound.

The three classes defined herein are:

+ `ConditionallyCompletePartialOrderSup` for partial orders with suprema,
+ `ConditionallyCompletePartialOrderInf` for partial orders with infima, and
+ `ConditionallyCompletePartialOrder` for partial orders with both suprema and infima

One common use case for these classes is the order on a von Neumann algebra, or W⋆-algebra. This is the strongest order-theoretic structure satisfied by a von Neumann algebra; in particular it is *not* a conditionally complete *lattice*, and indeed it is a lattice if and only if the algebra is commutative. In addition, `ℂ` can be made to satisfy this class (one must provide a suitable `SupSet` instance), with the order `w ≤ z ↔ w.re ≤ z.re ∧ w.im = z.im`, which is available in the `ComplexOrder` namespace.

These use cases are the motivation for defining three classes, as compared with other parts of the order theory library, where only the supremum versions are defined (e.g., `CompletePartialOrder` and `OmegaCompletePartialOrder`). We note that, if these classes are used outside of order theory, then it is more likely that the infimum versions would be useful. Indeed, whenever the underlying type has an antitone involution (e.g., if it is an ordered ring, then negation would be such a map), then any `ConditionallyCompletePartialOrder{Sup,Inf}` is automatically a `ConditionallyCompletePartialOrder`. Because of the `to_dual` attribute, the additional overhead required to add and maintain the infimum version is minimal.
Maldooor pushed a commit to Maldooor/mathlib4 that referenced this pull request Feb 25, 2026
…y#35046)

This file defines *conditionally complete partial orders* with suprema, infima or both. These are partial orders where every nonempty, upwards (downwards) directed set which is bounded above (below) has a least upper bound (greatest lower bound). This class extends `SupSet` (`InfSet`) and the requirement is that `sSup` (`sInf`) must be the least upper bound.

The three classes defined herein are:

+ `ConditionallyCompletePartialOrderSup` for partial orders with suprema,
+ `ConditionallyCompletePartialOrderInf` for partial orders with infima, and
+ `ConditionallyCompletePartialOrder` for partial orders with both suprema and infima

One common use case for these classes is the order on a von Neumann algebra, or W⋆-algebra. This is the strongest order-theoretic structure satisfied by a von Neumann algebra; in particular it is *not* a conditionally complete *lattice*, and indeed it is a lattice if and only if the algebra is commutative. In addition, `ℂ` can be made to satisfy this class (one must provide a suitable `SupSet` instance), with the order `w ≤ z ↔ w.re ≤ z.re ∧ w.im = z.im`, which is available in the `ComplexOrder` namespace.

These use cases are the motivation for defining three classes, as compared with other parts of the order theory library, where only the supremum versions are defined (e.g., `CompletePartialOrder` and `OmegaCompletePartialOrder`). We note that, if these classes are used outside of order theory, then it is more likely that the infimum versions would be useful. Indeed, whenever the underlying type has an antitone involution (e.g., if it is an ordered ring, then negation would be such a map), then any `ConditionallyCompletePartialOrder{Sup,Inf}` is automatically a `ConditionallyCompletePartialOrder`. Because of the `to_dual` attribute, the additional overhead required to add and maintain the infimum version is minimal.
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
…y#35046)

This file defines *conditionally complete partial orders* with suprema, infima or both. These are partial orders where every nonempty, upwards (downwards) directed set which is bounded above (below) has a least upper bound (greatest lower bound). This class extends `SupSet` (`InfSet`) and the requirement is that `sSup` (`sInf`) must be the least upper bound.

The three classes defined herein are:

+ `ConditionallyCompletePartialOrderSup` for partial orders with suprema,
+ `ConditionallyCompletePartialOrderInf` for partial orders with infima, and
+ `ConditionallyCompletePartialOrder` for partial orders with both suprema and infima

One common use case for these classes is the order on a von Neumann algebra, or W⋆-algebra. This is the strongest order-theoretic structure satisfied by a von Neumann algebra; in particular it is *not* a conditionally complete *lattice*, and indeed it is a lattice if and only if the algebra is commutative. In addition, `ℂ` can be made to satisfy this class (one must provide a suitable `SupSet` instance), with the order `w ≤ z ↔ w.re ≤ z.re ∧ w.im = z.im`, which is available in the `ComplexOrder` namespace.

These use cases are the motivation for defining three classes, as compared with other parts of the order theory library, where only the supremum versions are defined (e.g., `CompletePartialOrder` and `OmegaCompletePartialOrder`). We note that, if these classes are used outside of order theory, then it is more likely that the infimum versions would be useful. Indeed, whenever the underlying type has an antitone involution (e.g., if it is an ordered ring, then negation would be such a map), then any `ConditionallyCompletePartialOrder{Sup,Inf}` is automatically a `ConditionallyCompletePartialOrder`. Because of the `to_dual` attribute, the additional overhead required to add and maintain the infimum version is minimal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants