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] - chore(algebra/algebra/subalgebra): Add missing coe_sort for subalgebra #6800

Closed
wants to merge 15 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Mar 21, 2021

Unlike all the other subobject types, subalgebra does not implement has_coe_to_sort directly, instead going via a coercion to one of submodule and subsemiring.

This removes the has_coe (subalgebra R A) (subsemiring A) and has_coe (subalgebra R A) (submodule R A) instances; we don't have these for any other subobjects, and they cause the elaborator more difficulty than the corresponding to_subsemiring and to_submodule projections.

This changes the definition of le to not involve coercions, which matches submodule but requires a few proofs to change.

This speeds up the lift_of_splits proof by adding finite_dimensional.of_subalgebra_to_submodule.


Open in Gitpod

Split from #6768.

@eric-wieser eric-wieser added the WIP Work in progress label Mar 21, 2021
@github-actions github-actions bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Mar 21, 2021
@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Mar 21, 2021
@github-actions github-actions bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Mar 22, 2021
@github-actions
Copy link

🎉 Great news! Looks like all the dependencies have been resolved:

💡 To add or remove a dependency please update this issue/PR description.

Brought to you by Dependent Issues (:robot: ). Happy coding!

Comment on lines 37 to 39
instance : has_coe (subalgebra R A) (subsemiring A) :=
⟨λ S, { ..S }⟩
instance : has_coe_t (subalgebra R A) (set A) := ⟨λ s, s.carrier⟩
instance : has_mem A (subalgebra R A) := ⟨λ x p, x ∈ (p : set A)⟩
instance : has_coe_to_sort (subalgebra R A) := ⟨_, λ p, {x : A // x ∈ p}⟩
Copy link
Collaborator

@semorrison semorrison Mar 23, 2021

Choose a reason for hiding this comment

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

Can we add a comment here, explaining why we don't want to define coercions to submodule and subsemiring?

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 main reason is just "none of the other objects do it, and it creates more API that we have to write"

@semorrison
Copy link
Collaborator

bors d+

@bors
Copy link

bors bot commented Mar 23, 2021

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

@eric-wieser
Copy link
Member Author

bors r+

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Mar 23, 2021
@eric-wieser
Copy link
Member Author

bors r+ dontcrashthistime+

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 23, 2021
@bryangingechen bryangingechen added awaiting-author A reviewer has asked the author a question or requested changes and removed ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) labels Mar 23, 2021
@bryangingechen
Copy link
Collaborator

merge conflict
bors r-

@bors
Copy link

bors bot commented Mar 23, 2021

Canceled.

@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Mar 24, 2021
@eric-wieser
Copy link
Member Author

bors r+

@eric-wieser eric-wieser added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-author A reviewer has asked the author a question or requested changes labels Mar 24, 2021
bors bot pushed a commit that referenced this pull request Mar 24, 2021
#6800)

Unlike all the other subobject types, `subalgebra` does not implement `has_coe_to_sort` directly, instead going via a coercion to one of `submodule` and `subsemiring`.

This removes the `has_coe (subalgebra R A) (subsemiring A)` and `has_coe (subalgebra R A) (submodule R A)` instances; we don't have these for any other subobjects, and they cause the elaborator more difficulty than the corresponding `to_subsemiring` and `to_submodule` projections.

This changes the definition of `le` to not involve coercions, which matches `submodule` but requires a few proofs to change.

This speeds up the `lift_of_splits` proof by adding `finite_dimensional.of_subalgebra_to_submodule`.
@bors
Copy link

bors bot commented Mar 24, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(algebra/algebra/subalgebra): Add missing coe_sort for subalgebra [Merged by Bors] - chore(algebra/algebra/subalgebra): Add missing coe_sort for subalgebra Mar 24, 2021
@bors bors bot closed this Mar 24, 2021
@bors bors bot deleted the eric-wieser/subalgebra-coe branch March 24, 2021 16:04
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
#6800)

Unlike all the other subobject types, `subalgebra` does not implement `has_coe_to_sort` directly, instead going via a coercion to one of `submodule` and `subsemiring`.

This removes the `has_coe (subalgebra R A) (subsemiring A)` and `has_coe (subalgebra R A) (submodule R A)` instances; we don't have these for any other subobjects, and they cause the elaborator more difficulty than the corresponding `to_subsemiring` and `to_submodule` projections.

This changes the definition of `le` to not involve coercions, which matches `submodule` but requires a few proofs to change.

This speeds up the `lift_of_splits` proof by adding `finite_dimensional.of_subalgebra_to_submodule`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants