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(algebra/char_p/mixed_char_zero): define mixed/equal characteristic zero #14672

Closed
wants to merge 39 commits into from

Conversation

joneugster
Copy link
Collaborator

@joneugster joneugster commented Jun 10, 2022

API for equal/mixed characteristic zero with main theorem to split propositions by characteristics.


This is a stand-alone PR contained in one file and should therefore be rather quick to review. The main result of this PR is theorem split_by_characteristic.

Often it is useful to consider mixed characteristic (0, p) and equal characteristic zero independently. This document provides the definitions and API.

This definition exists for example in nLab.

A commutative ring R of characteristic 0 is called a ring of mixed characteristic if R has an Ideal I such that the quotient R/I is of prime characteristic.

Similar the definition exists in Stacks Project (Tag 09EK), although in a slightly less general context.

Let A be a discrete valuation ring. We say A has mixed characteristic if the characteristic of the residue field of A is p>0 and the characteristic of the fraction field of A is 0. In this case we obtain an extension of discrete valuation rings Z(p)⊂A and the absolute ramification index of A is the ramification index of this extension.

Open in Gitpod

@joneugster joneugster added the WIP Work in progress label Jun 10, 2022
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 10, 2022
@joneugster joneugster added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Jun 11, 2022
@joneugster joneugster added WIP Work in progress and removed awaiting-review The author would like community review of the PR labels Jun 15, 2022
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 26, 2022
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 30, 2022
@joneugster joneugster added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Jul 2, 2022
@joneugster joneugster changed the title feat(algebra/char_p/mixed_char_zero): theorem to split statements into mixed/equal characteristic feat(algebra/char_p/mixed_char_zero): define mixed/equal characteristic zero Jul 4, 2022
@joneugster joneugster added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Sep 16, 2022
@joneugster joneugster added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Sep 23, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Sep 23, 2022
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
Comment on lines 74 to 78
lemma Q_algebra_char_p_zero [semiring R] [algebra ℚ R] : char_p R 0 :=
char_p_of_injective_algebra_map (algebra_map ℚ R).injective 0

lemma Q_algebra_char_zero [ring R] [algebra ℚ R] : char_zero R :=
@char_p.char_p_to_char_zero R _ (Q_algebra_char_p_zero R)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I must say that I can't really think of a case where we already have an instance algebra ℚ R on our hands but no char_zero. Do you have a specific use case in mind? (I was thinking along the lines of polynomial ℚ, but we already directly show that polynomial has the same characteristic without going through algebra.)

Otherwise these definitions are definitely not suitable as (local) instances as you remark above, so let's add a docstring to warn the users. (I believe using it as haveI : char_zero R := Q_algebra_char_zero R is safe, since char_zero lives in Prop there won't be any defeq issues.)

Another remark is that we assume semiring R in the first lemma but algebra ℚ R means that R contains -1 so it is at least a ring. This is probably fine, but a little surprising.

A final little thing is that I don't really like the names. How about these?

Suggested change
lemma Q_algebra_char_p_zero [semiring R] [algebra ℚ R] : char_p R 0 :=
char_p_of_injective_algebra_map (algebra_map ℚ R).injective 0
lemma Q_algebra_char_zero [ring R] [algebra ℚ R] : char_zero R :=
@char_p.char_p_to_char_zero R _ (Q_algebra_char_p_zero R)
/-- A nontrivial `ℚ`-algebra has `char_p` equal to zero.
This cannot be a (local) instance because it would immediately form a loop with the instance `algebra_rat`.
It's probably easier to go the other way: prove `char_zero R` and automatically receive an `algebra ℚ R` instance.
-/
lemma algebra_rat.char_p_zero [semiring R] [algebra ℚ R] : char_p R 0 :=
char_p_of_injective_algebra_map (algebra_map ℚ R).injective 0
/-- A nontrivial `ℚ`-algebra has characteristic zero.
This cannot be a (local) instance because it would immediately form a loop with the instance `algebra_rat`.
It's probably easier to go the other way: prove `char_zero R` and automatically receive an `algebra ℚ R` instance.
-/
lemma algebra_rat.char_zero [ring R] [algebra ℚ R] : char_zero R :=
@char_p.char_p_to_char_zero R _ (Q_algebra_char_p_zero R)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Update: I see, something like this gets used for example in Q_algebra_to_equal_char_zero.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Another remark is that we assume semiring R in the first lemma but algebra ℚ R means that R contains -1 so it is at least a ring. This is probably fine, but a little surprising.
Would it be worth adding that comment as something like instance xyz [semiring R] [algebra ℚ R] : ring R := sorry in a new PR?

I personally don't care (here in this PR) about semirings and that first lemma, just added it because char_p _ 0 and char_zero run somewhat parallel.

src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
intros a b,
field_simp,
repeat { rw equal_char_zero.pnat_coe_units_coe_eq_coe R },
convert_to (↑((a * b).num * (a.denom) * (b.denom)) : R) = _,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The nicer way I know is the transitivity tactic.

src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
src/algebra/char_p/mixed_char_zero.lean Outdated Show resolved Hide resolved
@Vierkantor Vierkantor added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Sep 29, 2022
joneugster and others added 3 commits October 3, 2022 21:16
Co-authored-by: Johan Commelin <johan@commelin.net>
Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
@joneugster
Copy link
Collaborator Author

Thank you @Vierkantor and @jcommelin ! (especially also for the tactics-tutorial)
I've now incorporated all suggestions you've made.

@joneugster joneugster added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Oct 3, 2022
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Oct 5, 2022
bors bot pushed a commit that referenced this pull request Oct 5, 2022
…ic zero (#14672)

API for equal/mixed characteristic zero with main theorem to split propositions by characteristics.



Co-authored-by: Jon <jon.eugster@gmx.ch>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
@bors
Copy link

bors bot commented Oct 5, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(algebra/char_p/mixed_char_zero): define mixed/equal characteristic zero [Merged by Bors] - feat(algebra/char_p/mixed_char_zero): define mixed/equal characteristic zero Oct 5, 2022
@bors bors bot closed this Oct 5, 2022
@bors bors bot deleted the mixed_char_main_theorem branch October 5, 2022 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants