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] - feat: port LinearAlgebra.QuadraticForm.Basic #4432
Conversation
Mathbin -> Mathlib fix certain import statements move "by" to end of line add import to Mathlib.lean
It looks like the new |
-- Porting note: adding this instance prevents a timeout in `ext_ring_op` | ||
instance {σ : R →+* S} : FunLike (M →ₛₗ[σ] M₃) M (λ _ ↦ M₃) := | ||
{ AddHomClass.toFunLike with } | ||
instance instCoeFun {σ : R →+* S} : CoeFun (M →ₛₗ[σ] M₃) (λ _ ↦ M → M₃) := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the motivation for re-adding this instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is the same as we had in Lean 3: without this instance, Lean sometimes fails to find coercion to function. Note that I use FunLike.coe
, not toFun
, so it unfolds to the same expression. Possibly, we should change it everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this instance again, and fixed the 3 errors in the file-to-be-ported by making some arguments explicit.
/-- Helper instance for when there's too many metavariables to apply | ||
`FunLike.hasCoeToFun` directly. -/ | ||
instance : CoeFun (QuadraticForm R M) fun _ => M → R := | ||
⟨FunLike.coe⟩ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall that we decided to only port the FunLike
instances and skip the CoeFun
instances (as also suggested by the comment in LinearMap
). Did we change this at some point?
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
bors merge |
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Johan Commelin <johan@commelin.net>
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Johan Commelin <johan@commelin.net>
I get compile failures in a seemingly unrelated file. Possibly, because of the new
instCoeFun
.