Skip to content

[Merged by Bors] - feat(Algebra/Module): Use coercion from SemilinearEquivClass to SemilinearEquiv - #11966

Closed
101damnations wants to merge 1 commit into
masterfrom
semilinearequivcoe
Closed

101damnations wants to merge 1 commit into
masterfrom
semilinearequivcoe

Conversation

@101damnations

@101damnations 101damnations commented Apr 6, 2024 •

Copy link
Copy Markdown
Contributor

Add the coercion from types with a SemilinearEquivClass instance to linear equivs, a la #10758.

Open in Gitpod


/-- Reinterpret an element of a type of semilinear equivalences as a semilinear equivalence. -/
instance instCoeToSemilinearEquiv [RingHomInvPair σ σ'] [RingHomInvPair σ' σ]
[EquivLike F M M₂] [SemilinearEquivClass F σ M M₂] : CoeHead F (M ≃ₛₗ[σ] M₂) where

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[EquivLike F M M₂] [SemilinearEquivClass F σ M M₂] : CoeHead F (M ≃ₛₗ[σ] M₂) where
[EquivLike F M M₂] [SemilinearEquivClass F σ M M₂] : CoeTC F (M ≃ₛₗ[σ] M₂) where

For Equiv and MulEquiv this was done using CoeTC, so I imagine we want that everywhere?

bors d+

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand this stuff but judging by this comment it looks like CoeHead is preferred here

@mathlib-bors

mathlib-bors Bot commented Apr 7, 2024

Copy link
Copy Markdown
Contributor

✌️ 101damnations can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@101damnations

101damnations commented Apr 7, 2024 •

Copy link
Copy Markdown
Contributor Author

So there's already a coercion from linear equivs to linear maps given by the projection LinearEquiv.toLinearMap, and the following fails if I put it where it makes sense (e.g. after line 202)

example (f : M ≃ₛₗ[σ] M₂) :
    f.toLinearMap = SemilinearMapClass.semilinearMap f := by
  with_reducible rfl

I don't really understand with_reducible, but I guess maybe I should redefine

instance : Coe (M ≃ₛₗ[σ] M₂) (M →ₛₗ[σ] M₂) :=
  ⟨toLinearMap⟩

on line 153 using SemilinearMapClass.semilinearMap, and deal with the fall out? I guess this potentially means removing a lot of toLinearMaps (and frequently having to replace them with type ascriptions....)

@fpvandoorn

Copy link
Copy Markdown
Member

Thanks for the link. In that case, we should try to fix the existing coercions.

bors merge

@github-actions github-actions Bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Apr 7, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Apr 7, 2024
@mathlib-bors

mathlib-bors Bot commented Apr 7, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat(Algebra/Module): Use coercion from SemilinearEquivClass to SemilinearEquiv [Merged by Bors] - feat(Algebra/Module): Use coercion from SemilinearEquivClass to SemilinearEquiv Apr 7, 2024
@mathlib-bors mathlib-bors Bot closed this Apr 7, 2024
@mathlib-bors
mathlib-bors Bot deleted the semilinearequivcoe branch April 7, 2024 18:52
xgenereux pushed a commit that referenced this pull request Apr 15, 2024
atarnoam pushed a commit that referenced this pull request Apr 16, 2024
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants