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] - refactor(ring_theory/perfection): remove coercion in the definition of the type #7583

Closed
wants to merge 6 commits into from

Conversation

sgouezel
Copy link
Collaborator

Defining the type ring.perfection R p as a plain subtype (but inheriting the semiring or ring instances from a subsemiring structure) removes several coercions and helps Lean a lot when elaborating or unifying.

@sgouezel sgouezel added the awaiting-review The author would like community review of the PR label May 12, 2021
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors d+

Up to you if you want to wait for a comment from Kenny

src/ring_theory/perfection.lean Outdated Show resolved Hide resolved
@bors
Copy link

bors bot commented May 12, 2021

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

@github-actions github-actions bot added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels May 12, 2021
Comment on lines +49 to +56
/-- The perfection of a ring `R` with characteristic `p`, as a subring,
defined to be the projective limit of `R` using the Frobenius maps `R → R`
indexed by the natural numbers, implemented as `{ f : ℕ → R | ∀ n, f (n + 1) ^ p = f n }`. -/
def ring.perfection_subring (R : Type u₁) [comm_ring R]
(p : ℕ) [hp : fact p.prime] [char_p R p] :
subring (ℕ → R) :=
(ring.perfection_subsemiring R p).to_subring $ λ n, by simp_rw [← frobenius_def, pi.neg_apply,
pi.one_apply, ring_hom.map_neg, ring_hom.map_one]
Copy link
Member

@eric-wieser eric-wieser May 12, 2021

Choose a reason for hiding this comment

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

Note that we actually had this definition before (https://github.com/leanprover-community/mathlib/pull/5386/files#r544380327) and with a shorter proof too; but it was deemed not useful and inlined into the two places that used it.

@sgouezel
Copy link
Collaborator Author

bors r+

bors bot pushed a commit that referenced this pull request May 12, 2021
…f the type (#7583)

Defining the type `ring.perfection R p` as a plain subtype (but inheriting the semiring or ring instances from a `subsemiring` structure) removes several coercions and helps Lean a lot when elaborating or unifying.
@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label May 12, 2021
@bors
Copy link

bors bot commented May 12, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title refactor(ring_theory/perfection): remove coercion in the definition of the type [Merged by Bors] - refactor(ring_theory/perfection): remove coercion in the definition of the type May 12, 2021
@bors bors bot closed this May 12, 2021
@bors bors bot deleted the test_perfection branch May 12, 2021 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. 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

2 participants