-
Notifications
You must be signed in to change notification settings - Fork 251
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 Topology.Algebra.GroupCompletion #2637
Conversation
ocfnash
commented
Mar 4, 2023
Mathbin -> Mathlib fix certain import statements move "by" to end of line add import to Mathlib.lean
I'm not completely sure this is the right approach but if it is then it will still be necessary to: * avoid dependence on auto-generated instance names (or better, on instance names at all) * add various 'porting not' comments * [maybe] investigate the failures of `rw_mod_cast`
Explicitly naming two instances to support linking from comments
/-- Automatic coercion from `α` to its completion. Not always injective. -/ | ||
instance : CoeTC α (Completion α) := | ||
⟨Quotient.mk' ∘ pureCauchy⟩ | ||
instance : Coe α (Completion α) := |
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.
Have I done the right thing here?
Before this change, the coercion was being eagerly unfolded and causing the usual problems (e.g., with rewrites).
I note also that the guidance from core regarding CoeTC
is that:
Auxiliary class implementing `Coe*`.
Users should generally not implement this directly.
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.
My imporession is that adding the @[coe] def coe'
above is sufficient, and that you don't need this instance at all. But I could be very wrong about that.
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.
I wasn't clear on this myself but your comment motivated me to look this up!
Based on what I see here I now understand that both the @[coe]
and the instance
are required. (Of course I also verified that if I remove the instance
then the coercions don't work.)
bors r+ |
Pull request successfully merged into master. Build succeeded: |