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] - fix(data/complex/basic): ensure algebra ℝ ℂ
is computable
#8166
Conversation
Without this instance, `normed_field.to_normed_space` and `normed_space.to_module` is tried first, but this results in a noncomputable instance.
algebra ℝ ℂ
is computable
Sorry, but isn't everything about real and complex numbers non-computable already? What are you tring to gain here? (I realize it can sound aggressive, but it's not meant to be, that's a real question). |
No, only |
Yes, but what is gained by Lean realizing that addition is computable on the complexes (apart from the fact that you don't need to mark any other stuff as noncomputable)? |
The motivation was primarily to avoid having to mark things noncomputable erroneously: especially since the existing shortcut instances for Is it possible to construct some decidably-equal subtype of the complex numbers though, such as the submonoid containing the cube roots of 1? If so, then you can compute with things like Is there any harm in adding the instances in this PR, even if the use-case seems largely academic? |
I don't think there's any harm. I am not convinced there is a real gain either, globally it's probably +\epsilon so still slightly positive :-) |
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.
Since you already have done the work, I see no disadvantage to merging this.
🎉 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! |
bors r+ |
Without this `complex.ring` instance, `ring ℂ` is found via `division_ring.to_ring` and `field.to_division_ring`, and `complex.field` is non-computable. The non-computable-ness previously contaminated `distrib_mul_action R ℂ` and even some properties of `finset.sum` on complex numbers! To avoid this type of mistake again, we remove `noncomputable theory` and manually flag the parts we actually expect to be computable.
Pull request successfully merged into master. Build succeeded: |
algebra ℝ ℂ
is computablealgebra ℝ ℂ
is computable
(I didn't do |
Oh, whoops! |
Without this
complex.ring
instance,ring ℂ
is found viadivision_ring.to_ring
andfield.to_division_ring
, andcomplex.field
is non-computable.The non-computable-ness previously contaminated
distrib_mul_action R ℂ
and even some properties offinset.sum
on complex numbers! To avoid this type of mistake again, we removenoncomputable theory
and manually flag the parts we actually expect to be computable.module
instance #8164