-
Notifications
You must be signed in to change notification settings - Fork 297
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
Conversation
🎉 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! |
src/algebra/algebra/subalgebra.lean
Outdated
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}⟩ |
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.
Can we add a comment here, explaining why we don't want to define coercions to submodule and subsemiring?
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 main reason is just "none of the other objects do it, and it creates more API that we have to write"
bors d+ |
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
bors r+ dontcrashthistime+ |
merge conflict |
Canceled. |
bors r+ |
#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`.
Pull request successfully merged into master. Build succeeded: |
#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`.
Unlike all the other subobject types,
subalgebra
does not implementhas_coe_to_sort
directly, instead going via a coercion to one ofsubmodule
andsubsemiring
.This removes the
has_coe (subalgebra R A) (subsemiring A)
andhas_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 correspondingto_subsemiring
andto_submodule
projections.This changes the definition of
le
to not involve coercions, which matchessubmodule
but requires a few proofs to change.This speeds up the
lift_of_splits
proof by addingfinite_dimensional.of_subalgebra_to_submodule
.Split from #6768.