Skip to content

[Merged by Bors] - feat: pushing Lattice and predecessors through Equiv#37605

Closed
Parcly-Taxel wants to merge 1 commit intoleanprover-community:masterfrom
Parcly-Taxel:equiv-lattice
Closed

[Merged by Bors] - feat: pushing Lattice and predecessors through Equiv#37605
Parcly-Taxel wants to merge 1 commit intoleanprover-community:masterfrom
Parcly-Taxel:equiv-lattice

Conversation

@Parcly-Taxel
Copy link
Copy Markdown
Collaborator

@Parcly-Taxel Parcly-Taxel commented Apr 3, 2026

The point is to transfer as cheaply as possible instances over to type synonyms. Note that we already have these for most of the algebraic hierarchy even when they "generalise" from an equiv to a structure-preserving injective function (note that the equiv needn't be structure-preserving, precisely because said structure needn't exist already).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

PR summary cd8272a9d5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ distribLattice
+ lattice
+ le
+ le_def
+ linearOrder
+ lt
+ lt_def
+ max
+ max_def
+ min
+ min_def
+ ord
+ ord_def
+ partialOrder
+ preorder
+ semilatticeInf
+ semilatticeSup

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

@Parcly-Taxel Parcly-Taxel requested a review from YaelDillies April 3, 2026 17:03
@vihdzp
Copy link
Copy Markdown
Collaborator

vihdzp commented Apr 3, 2026

Doesn't this just duplicate what we can already do with the Function.Injective constructors?

@Parcly-Taxel
Copy link
Copy Markdown
Collaborator Author

Doesn't this just duplicate what we can already do with the Function.Injective constructors?

Yaël asked me to do this. See #36934 (comment).

Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

Thanks! 🚀

maintainer merge

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2026

🚀 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 Apr 4, 2026
@riccardobrasca
Copy link
Copy Markdown
Member

I didn't check if really all the declarations work in the case of an injective function, but I agree with @vihdzp that it's not clear why we want this. @YaelDillies if you have a good reason can you explain this in the PR description (and maybe also in the code)? Thanks!

@YaelDillies
Copy link
Copy Markdown
Contributor

The point is to transfer as cheaply as possible instances over to type synonyms. Note that we already have these for most of the algebraic hierarchy even when they "generalise" from an equiv to a structure-preserving injective function (note that the equiv needn't be structure-preserving, precisely because said structure needn't exist already).

@JovanGerb
Copy link
Copy Markdown
Contributor

Have we thought about potentially automating this, instead of writinf these instances out explicitly? (I don't want to block this PR, but it may be interesting to think about)

I find that the intros <;> rfl is a bit unnecessary, shouldn't we use autoparams instead (and then not use tactic mode in these instancea)?

@YaelDillies
Copy link
Copy Markdown
Contributor

I would be very happy for automation to exist here, but note that what Jeremy's PR is doing is merely extending the statu quo and we shouldn't block him on that.

Also note that ideas for such automation have in the past systematically been shot down on the same basis as Violeta and Riccardo's objection above.

@faenuccio
Copy link
Copy Markdown
Contributor

I agree with @riccardobrasca that a bit of details in the PR description would help before merging.

@YaelDillies
Copy link
Copy Markdown
Contributor

Have added my comment above as description

@faenuccio
Copy link
Copy Markdown
Contributor

Thanks.

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Apr 5, 2026
The point is to transfer as cheaply as possible instances over to type synonyms. Note that we already have these for most of the algebraic hierarchy even when they "generalise" from an equiv to a structure-preserving injective function (note that the equiv needn't be structure-preserving, precisely because said structure needn't exist already).

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
@mathlib-triage mathlib-triage bot added ready-to-merge This PR has been sent to bors. and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Apr 5, 2026
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Apr 5, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: pushing Lattice and predecessors through Equiv [Merged by Bors] - feat: pushing Lattice and predecessors through Equiv Apr 5, 2026
@mathlib-bors mathlib-bors bot closed this Apr 5, 2026
@Parcly-Taxel Parcly-Taxel deleted the equiv-lattice branch April 6, 2026 01:05
riccardobrasca pushed a commit to riccardobrasca/mathlib4 that referenced this pull request Apr 6, 2026
…community#37605)

The point is to transfer as cheaply as possible instances over to type synonyms. Note that we already have these for most of the algebraic hierarchy even when they "generalise" from an equiv to a structure-preserving injective function (note that the equiv needn't be structure-preserving, precisely because said structure needn't exist already).

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
YellPika pushed a commit to YellPika/mathlib4 that referenced this pull request Apr 6, 2026
…community#37605)

The point is to transfer as cheaply as possible instances over to type synonyms. Note that we already have these for most of the algebraic hierarchy even when they "generalise" from an equiv to a structure-preserving injective function (note that the equiv needn't be structure-preserving, precisely because said structure needn't exist already).

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
mathlib-bors bot pushed a commit that referenced this pull request Apr 7, 2026
Where `CABA` is `CompleteAtomicBooleanAlgebra`. The natural follow-up to #37605.

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
xroblot pushed a commit to xroblot/mathlib4 that referenced this pull request Apr 10, 2026
…munity#37733)

Where `CABA` is `CompleteAtomicBooleanAlgebra`. The natural follow-up to leanprover-community#37605.

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants