Skip to content
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

Closed
wants to merge 12 commits into from

Conversation

urkud
Copy link
Member

@urkud urkud commented May 28, 2023


I get compile failures in a seemingly unrelated file. Possibly, because of the new instCoeFun.

Open in Gitpod

urkud added 6 commits May 27, 2023 21:21
Mathbin -> Mathlib
fix certain import statements
move "by" to end of line
add import to Mathlib.lean
@urkud urkud added help-wanted The author needs attention to resolve issues mathlib-port This is a port of a theory file from mathlib. labels May 28, 2023
@Ruben-VandeVelde Ruben-VandeVelde added awaiting-review The author would like community review of the PR and removed help-wanted The author needs attention to resolve issues labels May 30, 2023
@urkud
Copy link
Member Author

urkud commented May 30, 2023

It looks like the new CoeFun instance causes a timeout elsewhere.

@Vierkantor Vierkantor self-assigned this Jun 1, 2023
-- 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₃) :=
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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.

Comment on lines +153 to +156
/-- Helper instance for when there's too many metavariables to apply
`FunLike.hasCoeToFun` directly. -/
instance : CoeFun (QuadraticForm R M) fun _ => M → R :=
⟨FunLike.coe⟩
Copy link
Contributor

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?

Mathlib/LinearAlgebra/QuadraticForm/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/QuadraticForm/Basic.lean Outdated Show resolved Hide resolved
@Vierkantor Vierkantor added awaiting-author A reviewer has asked the author a question or requested changes awaiting-CI and removed awaiting-review The author would like community review of the PR labels Jun 1, 2023
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@urkud urkud added awaiting-review The author would like community review of the PR help-wanted The author needs attention to resolve issues and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jun 1, 2023
@jcommelin jcommelin removed the help-wanted The author needs attention to resolve issues label Jun 5, 2023
@ChrisHughes24
Copy link
Member

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Jun 5, 2023
bors bot pushed a commit that referenced this pull request Jun 5, 2023
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
@bors
Copy link

bors bot commented Jun 5, 2023

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.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: port LinearAlgebra.QuadraticForm.Basic [Merged by Bors] - feat: port LinearAlgebra.QuadraticForm.Basic Jun 5, 2023
@bors bors bot closed this Jun 5, 2023
@bors bors bot deleted the port/LinearAlgebra.QuadraticForm.Basic branch June 5, 2023 13:56
qawbecrdtey pushed a commit to qawbecrdtey/greedoid-mathlib4 that referenced this pull request Jun 12, 2023
Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mathlib-port This is a port of a theory file from mathlib. ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants