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: generalize CharP+Prime to ExpChar in frobenius #10016

Closed
wants to merge 17 commits into from

Conversation

alreadydone
Copy link
Contributor

@alreadydone alreadydone commented Jan 26, 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 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 t-algebra Algebra (groups, rings, fields etc) labels Jan 26, 2024
@alreadydone alreadydone added WIP Work in progress awaiting-review The author would like community review of the PR 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
Copy link
Collaborator

@acmepjz acmepjz left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Mathlib/Algebra/CharP/ExpChar.lean Outdated Show resolved Hide resolved
@acmepjz
Copy link
Collaborator

acmepjz commented Jan 26, 2024

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
Copy link
Contributor Author

alreadydone commented Jan 27, 2024

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.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jan 31, 2024
@alreadydone alreadydone removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jan 31, 2024
@alreadydone
Copy link
Contributor Author

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

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-mathlib4-bot leanprover-community-mathlib4-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 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 <junyanxu.math@gmail.com>
Co-authored-by: acmepjz <acme_pjz@hotmail.com>
@mathlib-bors
Copy link

mathlib-bors bot commented Feb 2, 2024

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 <junyanxu.math@gmail.com>
Co-authored-by: acmepjz <acme_pjz@hotmail.com>
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.

None yet

4 participants