[Merged by Bors] - refactor: don't use lambdas in CoeFun instances#21405
[Merged by Bors] - refactor: don't use lambdas in CoeFun instances#21405YaelDillies wants to merge 5 commits intomasterfrom
CoeFun instances#21405Conversation
PR summary cc3c6e85a0Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
!bench |
Line.toFun in the CoeFun instanceCoeFun instances
|
Oops, I did not realise that this was still in progress! |
|
I wish we had a |
|
Be the automation you want to see 😇 |
|
I think I got them all! |
|
Here are the benchmark results for commit c62aed9. |
|
|
!bench |
|
Here are the benchmark results for commit f0e206e. |
2 files, Instructions +2.0⬝10⁹
|
|
Wow! -1.21% on linting |
| /-- `b i` is the `i`th basis vector. -/ | ||
| instance instCoeFun : CoeFun (HilbertBasis ι 𝕜 E) fun _ => ι → E where | ||
| coe b i := b.repr.symm (lp.single 2 i (1 : 𝕜)) | ||
| @[coe] def toFun (b : HilbertBasis ι 𝕜 E) (i : ι) : E := b.repr.symm <| lp.single 2 i (1 : 𝕜) |
There was a problem hiding this comment.
I've reverted this. Changes were in commit 712d7f6
There was a problem hiding this comment.
Sorry, which "other PR" does this refer to?
There was a problem hiding this comment.
"other PR" refers to comments in #21395 on lines that were moved to this PR.
f0e206e to
e3b2d1f
Compare
This refers to the original PR, which has grown a bit. Could you make sure it is still up to date? |
|
✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with |
|
bors merge |
Hiding the lambdas behind a non-reducible `toFun` or changing the `CoeFun` instance to `FunLike` prevents many lemmas (some simp) to have a lambda as their head symbol. Arguably, those were misports because Lean 3's `has_coe_to_fun` was not reducible. Whether or not those should have become `FunLike` or `CoeFun := ⟨semireducibleDef⟩` back then is unclear. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/bad.20simp.20discrimination.20tree.20keys)
|
Build failed (retrying...): |
Hiding the lambdas behind a non-reducible `toFun` or changing the `CoeFun` instance to `FunLike` prevents many lemmas (some simp) to have a lambda as their head symbol. Arguably, those were misports because Lean 3's `has_coe_to_fun` was not reducible. Whether or not those should have become `FunLike` or `CoeFun := ⟨semireducibleDef⟩` back then is unclear. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/bad.20simp.20discrimination.20tree.20keys)
|
Build failed (retrying...): |
Hiding the lambdas behind a non-reducible `toFun` or changing the `CoeFun` instance to `FunLike` prevents many lemmas (some simp) to have a lambda as their head symbol. Arguably, those were misports because Lean 3's `has_coe_to_fun` was not reducible. Whether or not those should have become `FunLike` or `CoeFun := ⟨semireducibleDef⟩` back then is unclear. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/bad.20simp.20discrimination.20tree.20keys)
|
Build failed: |
|
bors r- |
|
✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with |
It looks like this was misported.
e3b2d1f to
cc3c6e8
Compare
|
As this PR is labelled bors merge |
Hiding the lambdas behind a non-reducible `toFun` or changing the `CoeFun` instance to `FunLike` prevents many lemmas (some simp) to have a lambda as their head symbol. Arguably, those were misports because Lean 3's `has_coe_to_fun` was not reducible. Whether or not those should have become `FunLike` or `CoeFun := ⟨semireducibleDef⟩` back then is unclear. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/bad.20simp.20discrimination.20tree.20keys)
|
This PR was included in a batch that was canceled, it will be automatically retried |
Hiding the lambdas behind a non-reducible `toFun` or changing the `CoeFun` instance to `FunLike` prevents many lemmas (some simp) to have a lambda as their head symbol. Arguably, those were misports because Lean 3's `has_coe_to_fun` was not reducible. Whether or not those should have become `FunLike` or `CoeFun := ⟨semireducibleDef⟩` back then is unclear. [Zulip](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/bad.20simp.20discrimination.20tree.20keys)
|
Pull request successfully merged into master. Build succeeded: |
CoeFun instancesCoeFun instances
Hiding the lambdas behind a non-reducible
toFunor changing theCoeFuninstance toFunLikeprevents many lemmas (some simp) to have a lambda as their head symbol.Arguably, those were misports because Lean 3's
has_coe_to_funwas not reducible. Whether or not those should have becomeFunLikeorCoeFun := ⟨semireducibleDef⟩back then is unclear.Zulip