Skip to content

fix: reenable structure eta during tc search#2093

Merged
gebner merged 1 commit intomasterfrom
tceta
Feb 5, 2023
Merged

fix: reenable structure eta during tc search#2093
gebner merged 1 commit intomasterfrom
tceta

Conversation

@gebner
Copy link
Copy Markdown
Member

@gebner gebner commented Feb 5, 2023

Fixes #2074 Structure eta is for TC instances is required to see that subobject projections are defeq with constructor applications. These diamonds occur with fine-grained instance hierarchies like the algebraic hierarchy in mathlib, and they need to be defeq during TC search if the instances occur as a parameter to another type class.

Structure eta was disabled as a quick fix for the issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60constructor.60.20and.20.60Applicative.60/near/279984801
However the example in that issue had two non-defeq Functor instances. We do not support non-defeq instance diamonds in general and lots of other modules will break with them. For example simp lemmas won't fire (because the instances don't match), the elaborator will error out, etc. Therefore I have decided to change the example from that issue to remove the non-defeq diamond, and reenabled structure eta during TC search.

@gebner
Copy link
Copy Markdown
Member Author

gebner commented Feb 5, 2023

!bench

@gebner gebner mentioned this pull request Feb 5, 2023
1 task
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 09cde79.
There were no significant changes against commit 4b974fd.

@gebner gebner enabled auto-merge (rebase) February 5, 2023 19:22
@gebner gebner merged commit 15a045e into master Feb 5, 2023
@kbuzzard
Copy link
Copy Markdown
Contributor

kbuzzard commented Feb 5, 2023

Thanks Gabriel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typeclass inference failure

3 participants