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] - feat: port Topology.Algebra.GroupCompletion #2637

Closed
wants to merge 10 commits into from

Conversation

ocfnash
Copy link
Contributor

@ocfnash ocfnash commented Mar 4, 2023


Open in Gitpod

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`
@ocfnash ocfnash added WIP Work in progress mathlib-port This is a port of a theory file from mathlib. labels Mar 4, 2023
This still needs work to check the fixes are appropriate and to
document with porting note comments. See also remarks in the commit
aa1f642
Explicitly naming two instances to support linking from comments
@ocfnash ocfnash added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Mar 5, 2023
/-- Automatic coercion from `α` to its completion. Not always injective. -/
instance : CoeTC α (Completion α) :=
⟨Quotient.mk' ∘ pureCauchy⟩
instance : Coe α (Completion α) :=
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

@ocfnash ocfnash Mar 6, 2023

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.)

@ChrisHughes24
Copy link
Member

bors r+

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Mar 6, 2023
bors bot pushed a commit that referenced this pull request Mar 6, 2023
@bors
Copy link

bors bot commented Mar 6, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: port Topology.Algebra.GroupCompletion [Merged by Bors] - feat: port Topology.Algebra.GroupCompletion Mar 6, 2023
@bors bors bot closed this Mar 6, 2023
@bors bors bot deleted the port/Topology.Algebra.GroupCompletion branch March 6, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mathlib-port This is a port of a theory file from mathlib. ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants