Skip to content

[Merged by Bors] - chore(Algebra/Category/Ring): use unification hint to clean up proofs#20075

Closed
Vierkantor wants to merge 4 commits intomasterfrom
CommRingCat-forget-uni_hint
Closed

[Merged by Bors] - chore(Algebra/Category/Ring): use unification hint to clean up proofs#20075
Vierkantor wants to merge 4 commits intomasterfrom
CommRingCat-forget-uni_hint

Conversation

@Vierkantor
Copy link
Copy Markdown
Contributor

(Everything below is written for CommRingCat, but also holds for the other RingCats.)

As a consequence of #19757, it became harder to unify (forget ?C).obj R =?= CommRingCat.carrier R since ?C =?= CommRingCat would no longer be inferred. This PR adds a unification hint that helps with all but 2 cases where we need to hint C := CommRingCat.

The current unification hint uses CommRingCat as the argument to forget, even though we would like it to be an arbitrary category C, which can then trigger downstream unification of C =?= CommRingCat. However, it seems that dependent unification hints do not work: I cannot get Lean to typecheck C =?= CommRingCat; (instC : Category C) =?= CommRingCat.instCategory |- ....

I tried doing this for ModuleCat too and it did not seem to fix any required hints. Perhaps because ModuleCat R depends on the R?


Open in Gitpod

@Vierkantor Vierkantor added t-category-theory Category theory tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip labels Dec 19, 2024
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 19, 2024

PR summary 4b9241684a

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/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

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

@joelriou joelriou added the t-meta Tactics, attributes or user commands label Dec 21, 2024
(Everything below is written for `CommRingCat`, but also holds for the other `RingCat`s.)

As a consequence of #19757, it became harder to unify `(forget ?C).obj R =?= CommRingCat.carrier R` since `?C =?= CommRingCat` would no longer be inferred. This PR adds a unification hint that helps with all but 2 cases where we need to hint `C := CommRingCat`.

The current unification hint uses `CommRingCat` as the argument to `forget`, even though we would like it to be an arbitrary category `C`, which can then trigger downstream unification of `C =?= CommRingCat`. However, it seems that dependent unification hints do not work: I cannot get Lean to typecheck `C =?= CommRingCat; (instC : Category C) =?= CommRingCat.instCategory |- ...`.

I tried doing this for `ModuleCat` too and it did not seem to fix any required hints. Perhaps because `ModuleCat R` depends on the `R`?
@Vierkantor Vierkantor force-pushed the CommRingCat-forget-uni_hint branch from 169344e to 4b92416 Compare January 6, 2025 11:03
@kim-em
Copy link
Copy Markdown
Contributor

kim-em commented Jan 13, 2025

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 13, 2025

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

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jan 13, 2025
@Vierkantor
Copy link
Copy Markdown
Contributor Author

This still builds locally after merging master so:

bors r+

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Jan 13, 2025
mathlib-bors bot pushed a commit that referenced this pull request Jan 13, 2025
…#20075)

(Everything below is written for `CommRingCat`, but also holds for the other `RingCat`s.)

As a consequence of #19757, it became harder to unify `(forget ?C).obj R =?= CommRingCat.carrier R` since `?C =?= CommRingCat` would no longer be inferred. This PR adds a unification hint that helps with all but 2 cases where we need to hint `C := CommRingCat`.

The current unification hint uses `CommRingCat` as the argument to `forget`, even though we would like it to be an arbitrary category `C`, which can then trigger downstream unification of `C =?= CommRingCat`. However, it seems that dependent unification hints do not work: I cannot get Lean to typecheck `C =?= CommRingCat; (instC : Category C) =?= CommRingCat.instCategory |- ...`.

I tried doing this for `ModuleCat` too and it did not seem to fix any required hints. Perhaps because `ModuleCat R` depends on the `R`?
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jan 13, 2025

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title chore(Algebra/Category/Ring): use unification hint to clean up proofs [Merged by Bors] - chore(Algebra/Category/Ring): use unification hint to clean up proofs Jan 13, 2025
@mathlib-bors mathlib-bors bot closed this Jan 13, 2025
@mathlib-bors mathlib-bors bot deleted the CommRingCat-forget-uni_hint branch January 13, 2025 15:16
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). ready-to-merge This PR has been sent to bors. t-category-theory Category theory t-meta Tactics, attributes or user commands tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants