Skip to content

[Merged by Bors] - chore: make pseudoparents of algebraic substructures reducible - #36097

Closed
matthewjasper wants to merge 3 commits into
leanprover-community:masterfrom
matthewjasper:tosub-abbrevs
Closed

matthewjasper wants to merge 3 commits into
leanprover-community:masterfrom
matthewjasper:tosub-abbrevs

Conversation

@matthewjasper

@matthewjasper matthewjasper commented Mar 4, 2026 •

Copy link
Copy Markdown
Collaborator

Make functions that take an algebraic substructure and return a sibling class reducible, this matches actual parents and resolves some usage of set_option backward.isDefEq.respectTransparency false. For example it ensures that the field instance on IntermediateField has a compatible Semiring instance to the one from it extending a Subalgebra.
Also remove @[simp] from adjoin_toSubsemiring, since it prevents other simp lemmas on adjoin from applying.


Open in Gitpod

@github-actions

github-actions Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

PR summary 82865a1a3f

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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

@matthewjasper matthewjasper added the t-algebra Algebra (groups, rings, fields, etc) label Mar 4, 2026

@dagurtomas dagurtomas 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

@github-actions

Copy link
Copy Markdown

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


trigger_name: pull_request_review
wf_run: workflow_run

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Mar 12, 2026
@Vierkantor Vierkantor changed the title chore: make psuedoparents of algebraic substructures reducible chore: make pseudoparents of algebraic substructures reducible Mar 14, 2026

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

Makes sense to me otherwise, thanks!

bors d+

@mathlib-bors

mathlib-bors Bot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

✌️ matthewjasper can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-triage mathlib-triage Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Mar 17, 2026
@JovanGerb

Copy link
Copy Markdown
Contributor

My PR #36395 which does a subset of this has now been merged, hence the merge conflict.

For the remaining changes in this PR, I think if something is marked reducible, we should remove simps from it.

@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 Mar 18, 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 Mar 18, 2026
instance (priority := low) module' [Semiring R'] [SMul R' R] [Module R' A] [IsScalarTower R' R A] :
Module R' S :=
S.toSubmodule.module'
inferInstance

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.

Have you checked why these can now be inferred? Does that mean that these instances should now be removed entirely?

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 think that it was able to be inferred for a long time (it comes from SubmoduleClass.module') it's just that it's now defeq to previous definition. I think these still have value since they're higher priority than SubmoduleClass.module'.

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.

Aha, so what's the reason that this was changed to inferInstance?

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 chose to use inferInstance to make it clearer that this is short-cutting an already existing instance. I'm not sure whether that's preferred or not in Mathlib.

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.

Yeah, that's fine, I just didn't understand that this change was orthogonal to the rest of this PR.

@matthewjasper

Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request Mar 28, 2026
Make functions that take an algebraic substructure and return a sibling class reducible, this matches actual parents and resolves some usage of `set_option backward.isDefEq.respectTransparency false`. For example it ensures that the field instance on `IntermediateField` has a compatible `Semiring` instance to the one from it extending a `Subalgebra`.
Also remove @[simp] from `adjoin_toSubsemiring`, since it prevents other simp lemmas on `adjoin` from applying.

Co-authored-by: Matthew Jasper <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore: make pseudoparents of algebraic substructures reducible [Merged by Bors] - chore: make pseudoparents of algebraic substructures reducible Mar 28, 2026
@mathlib-bors mathlib-bors Bot closed this Mar 28, 2026
@matthewjasper
matthewjasper deleted the tosub-abbrevs branch March 28, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants