Skip to content

feat(Data/SetLike): lattice membership typeclasses for Min and Max - #43726

Open
artie2000 wants to merge 28 commits into
leanprover-community:masterfrom
artie2000:ismemsupinf
Open

artie2000 wants to merge 28 commits into
leanprover-community:masterfrom
artie2000:ismemsupinf

Conversation

@artie2000

@artie2000 artie2000 commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator
  • Add classes IsMemInf and IsMemSup saying the respective operations agree with membership.
  • Add constructors for SemilatticeInf and SemilatticeSup from these, respectively.

Open in Gitpod

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

PR summary ec83c32cf6

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Order.Lattice.SetLike (new file) 281

Declarations diff (regex)

+ IsMemInf
+ IsMemSup
+ SemilatticeInf.ofSetLike
+ SemilatticeSup.ofSetLike
+ mem_inf_iff_mem_and_mem
+ mem_of_mem_bot
+ mem_of_mem_inf_left
+ mem_of_mem_inf_right
+ mem_sup_iff_mem_or_mem
+ mem_sup_left
+ mem_sup_right
+ mem_top_of_mem

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 ec83c32).

  • +22 new declarations
  • −0 removed declarations
+IsMemInf
+IsMemInf.casesOn
+IsMemInf.mem_inf
+IsMemInf.mk
+IsMemInf.rec
+IsMemInf.recOn
+IsMemSup
+IsMemSup.casesOn
+IsMemSup.mem_sup
+IsMemSup.mk
+IsMemSup.rec
+IsMemSup.recOn
+SemilatticeInf.ofSetLike
+SemilatticeSup.ofSetLike
+mem_inf_iff_mem_and_mem
+mem_of_mem_bot
+mem_of_mem_inf_left
+mem_of_mem_inf_right
+mem_sup_iff_mem_or_mem
+mem_sup_left
+mem_sup_right
+mem_top_of_mem

No changes to strong technical debt.
No changes to weak technical debt.

Current commit ec83c32cf6
Reference commit c47f9ad906

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).

@github-actions github-actions Bot added the t-data Data (lists, quotients, numbers, etc) label Sep 11, 2026

@metakunt metakunt 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.

Nice. Would be great to have this. Only comment I have is maybe some imports could be import instead of public import if you just need it for the proof.

Comment thread Mathlib/Data/SetLike/Lattice.lean Resolved
artie2000 and others added 4 commits September 18, 2026 14:09
Co-authored-by: David Kurniadi Angdinata <dka31@cantab.ac.uk>
@github-actions github-actions 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 Sep 28, 2026
@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 28, 2026
@artie2000 artie2000 added the WIP Work in progress label Sep 28, 2026
@artie2000

Copy link
Copy Markdown
Collaborator Author

todo: add lemmas, add IsMemLE instances

@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 Sep 28, 2026
@mathlib-dependent-issues

mathlib-dependent-issues Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

This PR/issue depends on:

artie2000 and others added 4 commits September 30, 2026 13:05
Removed theorem mem_sup_of_mem_or_mem for simplification.
@joneugster
joneugster marked this pull request as draft October 24, 2026 02:06
@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 Oct 24, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 11, 2026
artie2000 and others added 6 commits November 11, 2026 20:59
These commands made the changes in this commit.
To make the same fixes yourself, run them in your mathlib4 checkout.
@artie2000
artie2000 marked this pull request as ready for review November 11, 2026 21:47
@artie2000 artie2000 removed the WIP Work in progress label Nov 11, 2026
Add grind pattern for negation of subset goals
Updated grind_pattern to clarify its behavior with goals.
@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 20, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@github-actions github-actions Bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 21, 2026

This branch has not been deployed

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

Labels

blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) t-data Data (lists, quotients, numbers, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants