Skip to content

feat(Order/ConditionallyCompleteLattice): ConditionallyCompleteSemiLatticeInf#38192

Draft
Jun2M wants to merge 4 commits intoleanprover-community:masterfrom
Jun2M:ConditionallyCompleteSemiLatticeSup
Draft

feat(Order/ConditionallyCompleteLattice): ConditionallyCompleteSemiLatticeInf#38192
Jun2M wants to merge 4 commits intoleanprover-community:masterfrom
Jun2M:ConditionallyCompleteSemiLatticeSup

Conversation

@Jun2M
Copy link
Copy Markdown
Collaborator

@Jun2M Jun2M commented Apr 18, 2026

This PR introduces ConditionallyCompleteSemilatticeSup/Inf, Sup/Inf only versions of ConditionallyCompleteLattice.

This is a preliminary PR for #37620, showing that Graph forms a ConditionallyCompleteSemilatticeInf.


Open in Gitpod

@Jun2M Jun2M marked this pull request as draft April 18, 2026 00:05
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Apr 18, 2026

This pull request is now in draft mode. No active bors state needed cleanup.

While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like bors r+ or bors try.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 18, 2026

PR summary 9036ce5439

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ ConditionallyCompleteSemilatticeInf
+ ConditionallyCompleteSemilatticeSup
+ OrderDual.instConditionallyCompleteSemilatticeSup
+ conditionallyCompleteSemilatticeInfOfsInf
+ conditionallyCompleteSemilatticeInfOfsInfTop
+ isGLB_csInf
- isLUB_csSup

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/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).

@github-actions github-actions Bot added the t-order Order theory label Apr 18, 2026
@Jun2M Jun2M added the help-wanted The author needs attention to resolve issues label Apr 18, 2026
Copy link
Copy Markdown
Collaborator

@vihdzp vihdzp left a comment

Choose a reason for hiding this comment

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

The design looks reasonable to me, but do you have any examples of structures that would fit these instances?

Comment thread Mathlib/Order/ConditionallyCompleteLattice/Defs.lean Outdated
Comment thread Mathlib/Order/ConditionallyCompleteLattice/Defs.lean Outdated
complete lattices, we prefix `sSup` by a `c` everywhere. The same statements should
hold in both worlds, sometimes with additional assumptions of nonemptiness or
boundedness. -/
class ConditionallyCompleteSemiLatticeSupBot (α : Type*) extends
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You could get rid of this by adding a requirement to conditionally complete (semi)lattices that if they have a bottom/top, then the supremum/infimum of the empty set equals to it. I think that'd be a worthwhile refactor which can be done independently of adding these semilattice instances.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am not quite sure how I can say in Lean "if there is bottom/top, so and so is true". Could you spell out exactly what you are thinking?

Copy link
Copy Markdown
Collaborator

@vihdzp vihdzp Apr 18, 2026

Choose a reason for hiding this comment

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

IsBot x -> sSup \empty = x

@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Apr 18, 2026

Ah, this is for graphs. You know, surreals under the simplicity ordering also satisfy this typeclass but not ConditionallyCompleteLattice. So I'm happy to have them split up!

@Jun2M
Copy link
Copy Markdown
Collaborator Author

Jun2M commented Apr 18, 2026

@vihdzp, Could I ask for some help with making to_dual tag working? I don't really understand what is wrong.

/-- Every nonempty subset which is bounded above has a least upper bound. -/
isLUB_csSup : ∀ s : Set α, s.Nonempty → BddAbove s → IsLUB s (sSup s)
/-- If the lattice has a bottom element, then `sSup ∅` is the bottom element. -/
csSup_empty : ∀ ⦃x⦄, IsBot x -> sSup ∅ = x
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd like to see this change done in a preliminary PR, which would also deprecate ConditionallyCompleteSemilatticeSupBot.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've opened a Zulip thread to double-check that this is a good idea.

@staroperator
Copy link
Copy Markdown
Collaborator

do you have any examples of structures that would fit these instances?

I encountered another one, the $\alpha^{&lt;\beta}$ tree. (This is probably a sublattice of graphs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help-wanted The author needs attention to resolve issues t-order Order theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants