Skip to content

[Merged by Bors] - feat(Order/ConditionallyCompleteLattice/WithTop): OrderSupSet instances on WithTop - #45406

Closed
astrainfinita wants to merge 14 commits into
leanprover-community:masterfrom
astrainfinita:ordersup_withtop
Closed

astrainfinita wants to merge 14 commits into
leanprover-community:masterfrom
astrainfinita:ordersup_withtop

Conversation

@astrainfinita

@astrainfinita astrainfinita commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Adds OrderSupSet (WithTop α) and OrderInfSet (WithTop α) instances (and their WithBot duals), and cleans up the API for sSup and sInf on WithTop.


…hTop`

This PR moves the material on `sSup` and `sInf` on `WithTop α` and `WithBot α` from `Order/ConditionallyCompleteLattice/Basic` and `Order/ConditionallyCompleteLattice/Indexed` to a new file `Order/ConditionallyCompleteLattice/WithTop`.

This material was scattered over five places in the two files, although the rest of these files does not depend on it.
…nces on `WithTop`

Adds `OrderSupSet (WithTop α)` and `OrderInfSet (WithTop α)` instances (and their `WithBot` duals), and cleans up the API for `sSup` and `sInf` on `WithTop`.
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

PR summary 57ad922567

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ bddBelow_preimage_coe
+ coe_iInf
+ coe_iSup
+ coe_sInf'
+ iInf_empty
+ instOrderInfSet
+ instOrderSupSet
+ instSupSet
+ isCompl_range_coe
+ isGLB_coe_iff
+ isGLB_top_iff
+ isLUB_coe_iff
+ isLUB_top_iff
+ lowerBounds_preimage_coe
+ sInf_eq_coe_iff
+ sInf_eq_top_iff
+ sSup_eq_coe_iff
+ sSup_eq_top_iff
- WithTop.coe_iInf
- WithTop.coe_iSup
- WithTop.coe_sInf'
- WithTop.iInf_empty
- instance [SupSet α] : SupSet (WithTop α)
-+-+ instance [ConditionallyCompleteLinearOrder α] :

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit 57ad922).

  • +26 new declarations
  • −0 removed declarations
+WithBot.bddAbove_preimage_coe
+WithBot.instOrderInfSet
+WithBot.instOrderSupSet
+WithBot.isCompl_range_coe
+WithBot.isGLB_bot_iff
+WithBot.isGLB_coe_iff
+WithBot.isLUB_bot_iff
+WithBot.isLUB_coe_iff
+WithBot.sInf_eq_bot_iff
+WithBot.sInf_eq_coe_iff
+WithBot.sSup_eq_bot_iff
+WithBot.sSup_eq_coe_iff
+WithBot.upperBounds_preimage_coe
+WithTop.bddBelow_preimage_coe
+WithTop.instOrderInfSet
+WithTop.instOrderSupSet
+WithTop.isCompl_range_coe
+WithTop.isGLB_coe_iff
+WithTop.isGLB_top_iff
+WithTop.isLUB_coe_iff
+WithTop.isLUB_top_iff
+WithTop.lowerBounds_preimage_coe
+WithTop.sInf_eq_coe_iff
+WithTop.sInf_eq_top_iff
+WithTop.sSup_eq_coe_iff
+WithTop.sSup_eq_top_iff

No changes to strong technical debt.

Decrease in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
5145 -1 exposed public sections

Current commit 57ad922567
Reference commit 5216ddb526

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py 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).

@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Oct 28, 2026

@vihdzp vihdzp left a comment

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.

Went through the diff, looks good to me :) Much cleaner proofs.

@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Nov 3, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

@mathlib-merge-conflicts mathlib-merge-conflicts Bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 3, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

This pull request has conflicts, please merge master and resolve them.

@astrainfinita astrainfinita added the t-order Order theory label Nov 6, 2026
@github-actions github-actions Bot added tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip and removed merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) labels Nov 6, 2026
simp [h]
· exact (WithTop.isLUB_sSup' h).2 ha⟩
isGLB_sInf S := ⟨fun a haS ↦
isGLB_sInf S := private ⟨fun a haS ↦

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.

Why is the private attribute needed?

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.

The InfSet instance is now marked as @[no_expose]. Its definition is no longer unfoldable across modules.

end LE

@[to_dual]
theorem isCompl_range_coe : IsCompl (range ((↑) : α → WithTop α)) {⊤} :=

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.

This doesn't seem to belong here. Can we move this to an earlier file?

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 couldn't find a better place for this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This belongs in the file defining the order on WithTop. Do you get issues if you import Set.range and the lattice structure on Set there? At any rate, you could at least move this lemma to the top of the file instead of stranding it in the middle!

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.

Putting it in Order/WithBot.lean would add these imports:

public import Mathlib.Order.BooleanAlgebra.Set
public import Mathlib.Order.Disjoint

@vihdzp
vihdzp requested a review from YaelDillies November 14, 2026 01:10
@YaelDillies YaelDillies self-assigned this Nov 14, 2026
@YaelDillies YaelDillies added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 14, 2026
@astrainfinita astrainfinita removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 16, 2026

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

maintainer delegate

Comment on lines +29 to +31
@[to_dual]
theorem isCompl_range_coe : IsCompl (range ((↑) : α → WithTop α)) {⊤} :=
eq_compl_iff_isCompl.1 <| Set.ext fun _ ↦ ne_top_iff_exists.symm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a comment that this lemma is out of place?

@YaelDillies YaelDillies removed their assignment Nov 17, 2026
@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 17, 2026
@j-loreaux

Copy link
Copy Markdown
Contributor

LGTM

bors d+

@mathlib-bors mathlib-bors Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Nov 17, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

✌️ astrainfinita can now approve this pull request until 2026-12-01 21:55 UTC (in 2 weeks). To approve and merge, reply with bors r+. More detailed instructions are available here.

⚠️ This delegation only covers changes within Archive/**, Counterexamples/**, docs/**, DownstreamTest/**, Mathlib/**, MathlibTest/**, Wanted/**, widget/**, Archive.lean, Counterexamples.lean, docs.lean, Mathlib.lean, Wanted.lean; an author commit touching anything else will revoke it. Bors also revokes it if a later push changes too many files for it to check the full list — even if it stays within scope.

@mathlib-triage mathlib-triage Bot removed the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Nov 17, 2026
@astrainfinita

Copy link
Copy Markdown
Collaborator Author

bors r+

@mathlib-bors mathlib-bors Bot added the ready-to-merge This PR has been sent to bors. label Nov 17, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Nov 17, 2026
…nces on `WithTop` (#45406)

Adds `OrderSupSet (WithTop α)` and `OrderInfSet (WithTop α)` instances (and their `WithBot` duals), and cleans up the API for `sSup` and `sInf` on `WithTop`.
@mathlib-bors mathlib-bors Bot added the bors-staging This PR is currently being built by bors on the staging branch. label Nov 17, 2026
@mathlib-bors

mathlib-bors Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@mathlib-bors mathlib-bors Bot changed the title feat(Order/ConditionallyCompleteLattice/WithTop): OrderSupSet instances on WithTop [Merged by Bors] - feat(Order/ConditionallyCompleteLattice/WithTop): OrderSupSet instances on WithTop Nov 17, 2026
@mathlib-bors mathlib-bors Bot closed this Nov 17, 2026
@mathlib-bors mathlib-bors Bot removed the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bors-staging This PR is currently being built by bors on the staging branch. ready-to-merge This PR has been sent to bors. t-order Order theory tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants