Skip to content

[Merged by Bors] - refactor: generalize CharP+Prime to ExpChar in frobenius - #10016

Closed
alreadydone wants to merge 17 commits into
masterfrom
frobenius_expChar
Closed

alreadydone wants to merge 17 commits into
masterfrom
frobenius_expChar

Conversation

@alreadydone

@alreadydone alreadydone commented Jan 26, 2024 •

Copy link
Copy Markdown
Contributor

Consequently, the part about frobenius in Algebra/CharP/Basic is moved to CharP/ExpChar, and imports are adjusted as necessary.

  • Add instances from CharP+Fact(Nat.Prime) and CharZero to ExpChar, to allow lemmas generalized to ExpChar still apply to CharP.

  • Remove lemmas in Algebra/CharP/ExpChar from #9799 because they coincide with the generalized lemmas, and golf the other lemmas (in Algebra/CharP/Basic).

  • Define the RingHom iterateFrobenius and the semilinear map LinearMap.(iterate)Frobenius for an algebra. When the characteristic is zero (ExpChar is 1), these are all equal to the identity map (· ^ 1). Also define iterateFrobeniusEquiv for perfect rings.

  • Fix and/or generalize other files.


Open in Gitpod

@alreadydone alreadydone added WIP Work in progress awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. t-algebra Algebra (groups, rings, fields, etc) labels Jan 26, 2024
@alreadydone
alreadydone requested a review from acmepjz January 26, 2024 00:40
@alreadydone alreadydone added WIP Work in progress awaiting-review and removed WIP Work in progress labels Jan 26, 2024
@alreadydone alreadydone changed the title refactor: generalize CharP to ExpChar in frobenius refactor: generalize CharP + Prime to ExpChar in frobenius Jan 26, 2024
@alreadydone alreadydone changed the title refactor: generalize CharP + Prime to ExpChar in frobenius refactor: generalize CharP+Prime to ExpChar in frobenius Jan 26, 2024
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jan 26, 2024
@alreadydone alreadydone removed the WIP Work in progress label Jan 26, 2024

@acmepjz acmepjz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me.

Comment thread Mathlib/Algebra/CharP/ExpChar.lean Resolved
@acmepjz

acmepjz commented Jan 26, 2024

Copy link
Copy Markdown
Collaborator

Maybe we should also replace the CharP in Mathlib.FieldTheory.Perfect by ExpChar as much as possible. Looks like that this will affect a lot of files, though.

@alreadydone

alreadydone commented Jan 27, 2024 •

Copy link
Copy Markdown
Contributor Author

You should not need to fix any file if you only replace CharP+Prime by ExpChar; I added an instance so that any declaration about ExpChar will continue to apply for CharP+Prime. If you replace CharP without an associated Nat.Prime assumption by ExpChar, then the declaration will be less general and may not apply in certain situations, and you'll need to keep the original lemma, but may still add an ExpChar version (for example expand_contract' in this PR).

Every CharP is associated with a Nat.Prime assumption in FieldTheory/Perfect though. However, there are declarations in the file that are tricky to generalize: for example not_irreducible_expand isn't true when p=1, and PerfectRing (R × S) p requires a ExpChar (R × S) p instance which in turn requires CharZero (R × S) but both are missing. Moreover, even though a characteristic 0 field is a perfect field, I don't think people talk about characteristic 0 perfect rings (https://en.wikipedia.org/wiki/Perfect_ring is a different notion). So maybe there's not a good idea to generalize PerfectRing. But I find it makes developments smoother to treat char 0 and char p cases uniformly, in particular it's nice that the equivalence between PerfectRing and PerfectField holds in any characteristic. So I've done the generalization.

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 31, 2024
@alreadydone alreadydone removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jan 31, 2024
@alreadydone

Copy link
Copy Markdown
Contributor Author

In the end, I went ahead to generalize the whole file FieldTheory/Perfect, because it makes it smoother merging this into #9311.

@jcommelin jcommelin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@ghost ghost added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Feb 2, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Feb 2, 2024
Consequently, the part about `frobenius` in Algebra/CharP/Basic is moved to CharP/ExpChar, and imports are adjusted as necessary.

+ Add instances from `CharP+Fact(Nat.Prime)` and `CharZero` to `ExpChar`, to allow lemmas generalized to ExpChar still apply to CharP.

+ Remove lemmas in Algebra/CharP/ExpChar from [#9799](1e74fcf) because they coincide with the generalized lemmas, and golf the other lemmas (in Algebra/CharP/Basic).

+ Define the RingHom `iterateFrobenius` and the semilinear map `LinearMap.(iterate)Frobenius` for an algebra. When the characteristic is zero (ExpChar is 1), these are all equal to the identity map (· ^ 1). Also define `iterateFrobeniusEquiv` for perfect rings.

+ Fix and/or generalize other files.



Co-authored-by: Junyan Xu <[email protected]>
Co-authored-by: acmepjz <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Feb 2, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title refactor: generalize CharP+Prime to ExpChar in frobenius [Merged by Bors] - refactor: generalize CharP+Prime to ExpChar in frobenius Feb 2, 2024
@mathlib-bors mathlib-bors Bot closed this Feb 2, 2024
@mathlib-bors
mathlib-bors Bot deleted the frobenius_expChar branch February 2, 2024 21:55
atarnoam pushed a commit that referenced this pull request Feb 9, 2024
Consequently, the part about `frobenius` in Algebra/CharP/Basic is moved to CharP/ExpChar, and imports are adjusted as necessary.

+ Add instances from `CharP+Fact(Nat.Prime)` and `CharZero` to `ExpChar`, to allow lemmas generalized to ExpChar still apply to CharP.

+ Remove lemmas in Algebra/CharP/ExpChar from [#9799](1e74fcf) because they coincide with the generalized lemmas, and golf the other lemmas (in Algebra/CharP/Basic).

+ Define the RingHom `iterateFrobenius` and the semilinear map `LinearMap.(iterate)Frobenius` for an algebra. When the characteristic is zero (ExpChar is 1), these are all equal to the identity map (· ^ 1). Also define `iterateFrobeniusEquiv` for perfect rings.

+ Fix and/or generalize other files.



Co-authored-by: Junyan Xu <[email protected]>
Co-authored-by: acmepjz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants