Skip to content

refactor(Algebra): uniform API for substructures#37446

Open
artie2000 wants to merge 12 commits intoleanprover-community:masterfrom
artie2000:setlike-closure
Open

refactor(Algebra): uniform API for substructures#37446
artie2000 wants to merge 12 commits intoleanprover-community:masterfrom
artie2000:setlike-closure

Conversation

@artie2000
Copy link
Copy Markdown
Collaborator

@artie2000 artie2000 commented Mar 31, 2026

  • Add class for SetLike instances whose map preserves meets - the intended interpretation is substructures whose closure properties are preserved under intersection
  • Abstract out the CompleteLattice instance and closure adjunction on such instances

This change unifies a significant part of the API for algebraic substructures.


Open in Gitpod

Original PR: #25963

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

PR summary 6db85f34e4

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
There are 4074 files with changed transitive imports taking up over 186379 characters: this is too many to display!
You can run ci-tools/scripts/pr_summary/import_trans_difference.sh all locally to see the whole output.

Declarations diff

+ CompleteLattice.ofSetLike
+ CompleteLattice.of_exists_isGLB
+ IsConcreteSInf
+ List.init
+ Props.
+ Shape
+ closure_apply
+ closure_monotone
+ coe_bot
+ coe_closure
+ constrToProp
+ instance : IsConcreteLE A B
+ instance : IsConcreteSInf (Subsemigroup M) M := ⟨fun _ ↦ rfl⟩
+ isGLB_closure
+ listBoolMerge
+ mem_bot
+ mkAndList
+ mkExistsList
+ mkIffOfInductivePropImpl
+ mkOpList
+ mkOrList
+ nCasesProd
+ nCasesSum
+ not_mem_of_not_mem_closure
+ select
+ splitThenConstructor
+ toCases
+ toInductive
+ updateLambdaBinderInfoD!
++ Foo
++ IsSumNonzeroSq
+-+ closure
- notMem_of_notMem_closure

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-data Data (lists, quotients, numbers, etc) label Mar 31, 2026
Comment thread Mathlib/Data/SetLike/Lattice.lean
Comment thread Mathlib/Data/SetLike/Lattice.lean Outdated
i.mul_mem (by apply Set.mem_iInter₂.1 hx i h) (by apply Set.mem_iInter₂.1 hy i h) }⟩

@[to_additive (attr := simp, norm_cast)]
theorem coe_sInf (S : Set (Subsemigroup M)) : ((sInf S : Subsemigroup M) : Set M) = ⋂ s ∈ S, ↑s :=
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.

a) Can you deprecate instead of remove?
b) Should the PR both define IsConcreteSInf and start using it? Or can those be separate concerns?

Copy link
Copy Markdown
Collaborator Author

@artie2000 artie2000 Apr 1, 2026

Choose a reason for hiding this comment

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

the "using it" part is just for testing - I'll mark the PR WIP sorry
defining and using should be separate PRs

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.

we may not even decide to remove all these declarations (I personally am in favour of removing)
then this PR just means we can stop having to maintain them

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.

We should certainly have one PR for just implementing it, and another draft PR which battle tests it.

@artie2000 artie2000 added the WIP Work in progress label Apr 1, 2026
artie2000 and others added 5 commits April 1, 2026 12:53
Co-authored-by: Violeta Hernández Palacios <vi.hdz.p@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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