Skip to content

feat(Order/CompleteLattice): more lemmas about membership under lattice operations - #44253

Open
artie2000 wants to merge 10 commits into
leanprover-community:masterfrom
artie2000:setlike_lattice_lemmas
Open

artie2000 wants to merge 10 commits into
leanprover-community:masterfrom
artie2000:setlike_lattice_lemmas

Conversation

@artie2000

@artie2000 artie2000 commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

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

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

PR summary c0384d7847

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Order.CompleteLattice.SetLike 694 279 -415 (-59.80%)
Import changes for all files
Files Import difference
Mathlib.Order.CompleteSublattice -693
Mathlib.Order.CompleteLattice.SetLike Mathlib.SetTheory.Descriptive.Tree -415
Mathlib.Order.Lattice.SetLike (new file) 278
Mathlib.Order.CompleteSublattice.Basic 693
Mathlib.Order.CompleteSublattice.SetLike (new file) 694

Declarations diff (regex)

+ IsMemLE
+ IsMemLE.exists_of_lt
+ IsMemLE.le_iff
+ IsMemLE.lt_iff_le_and_exists
+ IsMemLE.not_le_iff_exists
+ exists_mem_notMem_of_lt
+ instance (α : Type*) : IsMemLE (Set α) α
+ instance [Membership B A] : letI := LE.ofMembership A; IsMemLE A B
+ lt_iff_le_and_exists_mem_notMem
+ mem_of_le_of_mem
+ mem_of_mem_bot
+ mem_of_mem_inf_left
+ mem_of_mem_inf_right
+ mem_sSup_of_exists
+ mem_sSup_of_mem
+ mem_sup_left
+ mem_sup_of_mem_or_mem
+ mem_sup_right
+ mem_top_of_mem
+ not_le_iff_exists_mem_notMem
- exists_of_lt
- instance (α : Type*) : IsConcreteLE (Set α) α
- instance [Membership B A] : letI := LE.ofMembership A; IsConcreteLE A B
- lt_iff_le_and_exists
- not_le_iff_exists
--++ mem_subtype

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 -- stale, waiting for the new build)

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

  • +8 new declarations
  • −0 removed declarations
+SetLike.mem_and_mem_of_mem_inf
+SetLike.mem_bot_of_mem
+SetLike.mem_of_mem_inf_left
+SetLike.mem_of_mem_inf_right
+SetLike.mem_sup
+SetLike.mem_sup_left
+SetLike.mem_sup_right
+SetLike.mem_top_of_mem

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

Current commit c0384d7847
Reference commit 3c58f3bd8f

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

note: file Mathlib/Order/CompleteSublattice.lean` was renamed to `Mathlib/Order/CompleteSublattice/Basic.lean without a module deprecation
Please create a follow-up pull request adding one. Thanks!

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

✅ PR Title Formatted Correctly

The title of this PR has been updated to match our commit style conventions.
Thank you!

@artie2000 artie2000 added the WIP Work in progress label Sep 27, 2026
@artie2000 artie2000 changed the title WIP SetLike Lattice lemmas feat(Data/SetLike): generic lemmas about membership under lattice operations Sep 28, 2026
Comment thread Mathlib/Data/SetLike/Basic.lean Outdated
lemma mem_of_mem_inf_right {x : B} (h : x ∈ p ⊓ q) : x ∈ q :=
mem_of_le_of_mem inf_le_right h

lemma mem_and_mem_of_mem_inf {x : B} (h : x ∈ p ⊓ q) : x ∈ p ∧ x ∈ q :=

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.

Are you sure we need this lemma? It seems a bit redundant.

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.

it's there to be annotated with membership (#42342) in a future PR
I can remove for now?

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.

Even then I would think this lemma is redundant. How would you tag it that can't be done with the two lemmas above?

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.

well, I'd tag it instead of tagging the two lemmas above
to limit the amount of branching that grind needs to do

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.

I don't understand how that affects branching. And grind tags come in many forms - which one were you considering adding?

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.

yeah you're right I'll remove
grind in this case we'd want to fire forward

@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

@artie2000 artie2000 removed the WIP Work in progress label Sep 28, 2026
Comment thread Mathlib/Data/SetLike/Lattice.lean Outdated
theorem mem_of_mem_inf_right {x : B} (h : x ∈ p ⊓ q) : x ∈ q :=
mem_of_le_of_mem inf_le_right h

theorem mem_and_mem_of_mem_inf {x : B} (h : x ∈ p ⊓ q) : x ∈ p ∧ x ∈ q :=

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.

It would make more sense to me if this was an iff lemma, because then you would be able to rewrite with it.

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.

Then, after we get #42316, we could tag mem_inf with @[simp], and remove the @[simp] tag from Set.mem_inter, Finset.mem_inter and ZFSet.mem_inter.

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.

it's not an iff in this generality
iff needs IsMemInf from #43726

@artie2000 artie2000 Sep 28, 2026 •

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.

and yes indeed once that's added we can remove the more specific lemmas - see Zulip thread https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Abstracting.20the.20substructure.20lattice.20construction/with/627416450 for the idea

artie2000 and others added 3 commits September 28, 2026 23:24
Removed theorem mem_and_mem_of_mem_inf from SemilatticeInf.
@artie2000 artie2000 changed the title feat(Data/SetLike): generic lemmas about membership under lattice operations feat(Order/CompleteLattice): generic lemmas about membership under lattice operations Sep 30, 2026
@github-actions github-actions Bot added the file-removed A Lean module was (re)moved without a `deprecated_module` annotation label Sep 30, 2026
@artie2000 artie2000 changed the title feat(Order/CompleteLattice): generic lemmas about membership under lattice operations feat(Order/CompleteLattice): more lemmas about membership under lattice operations Sep 30, 2026
@artie2000

artie2000 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

this PR needs file reorganisation after #43253
for now look at the new PR #44353

@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@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 9, 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 Oct 14, 2026
@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.

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) file-removed A Lean module was (re)moved without a `deprecated_module` annotation merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-data Data (lists, quotients, numbers, etc) WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants