feat: virtual one-field structures - #15066
Conversation
|
The adaptation PR for this PR is leanprover/downstream-lean4#59. |
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
|
!bench |
|
Benchmark results for 0c8bed4 against c155094 are in. There are significant results. @Rob23oba
Large changes (3🟥)
Medium changes (3🟥)
Small changes (436🟥)
|
|
@Rob23oba I'm aware that it's significantly slower right now; if this turns out to be a good idea, I'll invest into the performance :) |
|
Can you help me understand what this is for? My first thought would be all those type |
|
@Rob23oba Mathlib currently has many semireducible or implicit-reducible definitions. These are footguns. They make forms of defeq abuse all to easy that interfere with automation, unificaiton and instance synthesis. Not all of them are easily/nicely converted into one-field structures. The idea here is to provide something similar to a one-field structure, but with an escape hatch inside of tactic blocks ( Of course, it would be best if no defeq abuse was present at all, but having a If Does that make sense to you? |
|
Well my question is I guess: what does |
|
It allows you to do defeq abuse in tactic blocks, identifying |
|
Oh no I totally understand that this is how these work. I'm just not sure why you would need that? Do you have an example? |
|
I'm thinking, for example, of You can see how this plays out for |
This PR introduces type aliases that behave like one-field structures, except that they allow for isolated defeq abuses.