New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - fix(NumberTheory/LegendreSymbol/AddCharacter): Disentangle coercion mess for AddChar
#8803
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are two things going on here: * `AddChar G R` has two syntactically different coercions to function `G → R`: * `FunLike.coe` via `AddChar.monoidHomClass` * `AddChar.toFun` via `AddChar.hasCoeToFun` * `AddChar.hasCoeToFun` and `AddChar.monoidHomClass` together create a diamond for the typeclass problem `FunLike (AddChar G R) _ _` This PR fixes both problems by * removing the `HasCoeToFun` instance and the corresponding `AddChar.toFun` * changing `MonoidHomClass (AddChar G R) (Multiplicative G) R` to `FunLike (AddChar G R) G fun _ ↦ R` (isn't the whole point of `AddChar` to go from an additive group to a multiplicative one anyway?) This PR isn't meant to be perfect. It is a stopgag to an issue that has completely startled progress on LeanAPAP. Once it is fixed, a much more thorough refactor will follow.
YaelDillies
added
the
awaiting-review
The author would like community review of the PR
label
Dec 3, 2023
eric-wieser
reviewed
Dec 3, 2023
eric-wieser
changed the title
fix: Disentangle coercion mess in
fix(NumberTheory/LegendreSymbol/AddCharacter): Disentangle coercion mess for Dec 3, 2023
AddChar
AddChar
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
eric-wieser
reviewed
Dec 3, 2023
bors d+ Just a comment request for the failing |
✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with |
github-actions
bot
added
delegated
and removed
awaiting-review
The author would like community review of the PR
labels
Dec 3, 2023
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
bors merge |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Dec 4, 2023
…ess for `AddChar` (#8803) There are two things going on here: * `AddChar G R` has two syntactically different coercions to function `G → R`: * `FunLike.coe` via `AddChar.monoidHomClass` * `AddChar.toFun` via `AddChar.hasCoeToFun` * `AddChar.hasCoeToFun` and `AddChar.monoidHomClass` together create a diamond for the typeclass problem `FunLike (AddChar G R) _ _` This PR fixes both problems by * removing the `HasCoeToFun` instance and the corresponding `AddChar.toFun` * changing `MonoidHomClass (AddChar G R) (Multiplicative G) R` to `FunLike (AddChar G R) G fun _ ↦ R` (isn't the whole point of `AddChar` to go from an additive group to a multiplicative one anyway?) This PR isn't meant to be perfect. It is a stopgag to an issue that has completely startled progress on LeanAPAP. Once it is fixed, a much more thorough refactor will follow. This breaks a rewrite downstream that now unifies to some defeq but not syntactically equal type. This is more an indication of fragility in the original proof.
Build failed (retrying...): |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Dec 4, 2023
…ess for `AddChar` (#8803) There are two things going on here: * `AddChar G R` has two syntactically different coercions to function `G → R`: * `FunLike.coe` via `AddChar.monoidHomClass` * `AddChar.toFun` via `AddChar.hasCoeToFun` * `AddChar.hasCoeToFun` and `AddChar.monoidHomClass` together create a diamond for the typeclass problem `FunLike (AddChar G R) _ _` This PR fixes both problems by * removing the `HasCoeToFun` instance and the corresponding `AddChar.toFun` * changing `MonoidHomClass (AddChar G R) (Multiplicative G) R` to `FunLike (AddChar G R) G fun _ ↦ R` (isn't the whole point of `AddChar` to go from an additive group to a multiplicative one anyway?) This PR isn't meant to be perfect. It is a stopgag to an issue that has completely startled progress on LeanAPAP. Once it is fixed, a much more thorough refactor will follow. This breaks a rewrite downstream that now unifies to some defeq but not syntactically equal type. This is more an indication of fragility in the original proof.
Pull request successfully merged into master. Build succeeded: |
mathlib-bors
bot
changed the title
fix(NumberTheory/LegendreSymbol/AddCharacter): Disentangle coercion mess for
[Merged by Bors] - fix(NumberTheory/LegendreSymbol/AddCharacter): Disentangle coercion mess for Dec 4, 2023
AddChar
AddChar
awueth
pushed a commit
that referenced
this pull request
Dec 19, 2023
…ess for `AddChar` (#8803) There are two things going on here: * `AddChar G R` has two syntactically different coercions to function `G → R`: * `FunLike.coe` via `AddChar.monoidHomClass` * `AddChar.toFun` via `AddChar.hasCoeToFun` * `AddChar.hasCoeToFun` and `AddChar.monoidHomClass` together create a diamond for the typeclass problem `FunLike (AddChar G R) _ _` This PR fixes both problems by * removing the `HasCoeToFun` instance and the corresponding `AddChar.toFun` * changing `MonoidHomClass (AddChar G R) (Multiplicative G) R` to `FunLike (AddChar G R) G fun _ ↦ R` (isn't the whole point of `AddChar` to go from an additive group to a multiplicative one anyway?) This PR isn't meant to be perfect. It is a stopgag to an issue that has completely startled progress on LeanAPAP. Once it is fixed, a much more thorough refactor will follow. This breaks a rewrite downstream that now unifies to some defeq but not syntactically equal type. This is more an indication of fragility in the original proof.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are two things going on here:
AddChar G R
has two syntactically different coercions to functionG → R
:FunLike.coe
viaAddChar.monoidHomClass
AddChar.toFun
viaAddChar.hasCoeToFun
AddChar.hasCoeToFun
andAddChar.monoidHomClass
together create a diamond for the typeclass problemFunLike (AddChar G R) _ _
This PR fixes both problems by
HasCoeToFun
instance and the correspondingAddChar.toFun
MonoidHomClass (AddChar G R) (Multiplicative G) R
toFunLike (AddChar G R) G fun _ ↦ R
(isn't the whole point ofAddChar
to go from an additive group to a multiplicative one anyway?)This PR isn't meant to be perfect. It is a stopgag to an issue that has completely startled progress on LeanAPAP. Once it is fixed, a much more thorough refactor will follow.
This breaks a rewrite downstream that now unifies to some defeq but not syntactically equal type.
This is more an indication of fragility in the original proof.