Skip to content

Commit 23aaca0

Browse files
authored
Merge branch 'master' into characteristicgroup
2 parents 2852728 + 1b7f970 commit 23aaca0

211 files changed

Lines changed: 4863 additions & 1821 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_template.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,10 @@ jobs:
774774
echo "username=$USERNAME" >> "$GITHUB_OUTPUT"
775775
echo "Found label actor: $USERNAME"
776776
777-
- if: contains(steps.PR.outputs.pr_labels, 'auto-merge-after-CI')
777+
- if: >- # bot usernames will cause this step to error with "Could not resolve to a User..."
778+
contains(steps.PR.outputs.pr_labels, 'auto-merge-after-CI') &&
779+
steps.get-label-actor.outputs.username != 'mathlib-nolints' &&
780+
steps.get-label-actor.outputs.username != 'mathlib-update-dependencies'
778781
name: check team membership
779782
uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3.0.0
780783
id: actorTeams
@@ -784,11 +787,18 @@ jobs:
784787
username: ${{ steps.get-label-actor.outputs.username }}
785788
GITHUB_TOKEN: ${{ secrets.MATHLIB_REVIEWERS_TEAM_KEY }} # (Requires scope: `read:org`)
786789
787-
# The create-github-app-token README states that this token is masked and will not be logged accidentally.
788-
- if: ${{ contains(steps.PR.outputs.pr_labels, 'auto-merge-after-CI') && (contains(steps.actorTeams.outputs.teams, 'mathlib-maintainers') || contains(steps.actorTeams.outputs.teams, 'bot-users')) }}
790+
- if: >-
791+
contains(steps.PR.outputs.pr_labels, 'auto-merge-after-CI') &&
792+
(
793+
steps.get-label-actor.outputs.username == 'mathlib-nolints' ||
794+
steps.get-label-actor.outputs.username == 'mathlib-update-dependencies' ||
795+
contains(steps.actorTeams.outputs.teams, 'mathlib-maintainers') ||
796+
contains(steps.actorTeams.outputs.teams, 'bot-users')
797+
)
789798
name: If `auto-merge-after-CI` is present, add a `bors merge` comment.
790799
uses: GrantBirki/comment@608e41b19bc973020ec0e189ebfdae935d7fe0cc # v2.1.1
791800
with:
801+
# The create-github-app-token README states that this token is masked and will not be logged accidentally.
792802
token: ${{ steps.auto-merge-app-token.outputs.token }}
793803
issue-number: ${{ steps.PR.outputs.number }}
794804
body: |

.github/workflows/nightly_detect_failure.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,22 @@ jobs:
326326
if: steps.check_branch.outputs.result == 'false'
327327
run: |
328328
sudo rm -rf -- *
329+
# Regenerate the app token just before use.
330+
# GitHub App tokens expire after 1 hour, and the preceding steps can take longer than that.
331+
- name: Regenerate app token for Mathlib4 checkout
332+
if: steps.check_branch.outputs.result == 'false'
333+
id: app-token-2
334+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
335+
with:
336+
app-id: ${{ secrets.MATHLIB_NIGHTLY_TESTING_APP_ID }}
337+
private-key: ${{ secrets.MATHLIB_NIGHTLY_TESTING_PRIVATE_KEY }}
329338
- name: Checkout Mathlib4 repository
330339
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
331340
if: steps.check_branch.outputs.result == 'false'
332341
with:
333342
ref: nightly-testing # checkout nightly-testing branch (shouldn't matter which)
334343
fetch-depth: 0 # checkout all branches
335-
token: ${{ steps.app-token.outputs.token }}
344+
token: ${{ steps.app-token-2.outputs.token }}
336345

337346
- name: Attempt automatic PR creation
338347
id: auto_pr
@@ -342,7 +351,7 @@ jobs:
342351
BUMP_VERSION: ${{ steps.bump_version.outputs.result }}
343352
BUMP_BRANCH: ${{ steps.latest_bump_branch.outputs.result }}
344353
SHA: ${{ env.SHA }}
345-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
354+
GH_TOKEN: ${{ steps.app-token-2.outputs.token }}
346355
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }}
347356
run: |
348357
echo "Current version: ${NIGHTLY}"

Mathlib.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,6 +1967,7 @@ public import Mathlib.Analysis.Normed.Group.Completion
19671967
public import Mathlib.Analysis.Normed.Group.Constructions
19681968
public import Mathlib.Analysis.Normed.Group.Continuity
19691969
public import Mathlib.Analysis.Normed.Group.ControlledClosure
1970+
public import Mathlib.Analysis.Normed.Group.Defs
19701971
public import Mathlib.Analysis.Normed.Group.FunctionSeries
19711972
public import Mathlib.Analysis.Normed.Group.Hom
19721973
public import Mathlib.Analysis.Normed.Group.HomCompletion
@@ -1978,6 +1979,7 @@ public import Mathlib.Analysis.Normed.Group.NullSubmodule
19781979
public import Mathlib.Analysis.Normed.Group.Pointwise
19791980
public import Mathlib.Analysis.Normed.Group.Quotient
19801981
public import Mathlib.Analysis.Normed.Group.Rat
1982+
public import Mathlib.Analysis.Normed.Group.Real
19811983
public import Mathlib.Analysis.Normed.Group.SemiNormedGrp
19821984
public import Mathlib.Analysis.Normed.Group.SemiNormedGrp.Completion
19831985
public import Mathlib.Analysis.Normed.Group.SemiNormedGrp.Kernels
@@ -2633,6 +2635,7 @@ public import Mathlib.CategoryTheory.Limits.Final.Type
26332635
public import Mathlib.CategoryTheory.Limits.FinallySmall
26342636
public import Mathlib.CategoryTheory.Limits.FintypeCat
26352637
public import Mathlib.CategoryTheory.Limits.FormalCoproducts
2638+
public import Mathlib.CategoryTheory.Limits.FormalCoproducts.Basic
26362639
public import Mathlib.CategoryTheory.Limits.Fubini
26372640
public import Mathlib.CategoryTheory.Limits.FullSubcategory
26382641
public import Mathlib.CategoryTheory.Limits.FunctorCategory.Basic
@@ -4400,6 +4403,7 @@ public import Mathlib.GroupTheory.EckmannHilton
44004403
public import Mathlib.GroupTheory.Exponent
44014404
public import Mathlib.GroupTheory.FiniteAbelian.Basic
44024405
public import Mathlib.GroupTheory.FiniteAbelian.Duality
4406+
public import Mathlib.GroupTheory.FiniteIndexNormalSubgroup
44034407
public import Mathlib.GroupTheory.Finiteness
44044408
public import Mathlib.GroupTheory.FixedPointFree
44054409
public import Mathlib.GroupTheory.Frattini
@@ -5017,6 +5021,7 @@ public import Mathlib.MeasureTheory.Function.LpSeminorm.ChebyshevMarkov
50175021
public import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp
50185022
public import Mathlib.MeasureTheory.Function.LpSeminorm.Defs
50195023
public import Mathlib.MeasureTheory.Function.LpSeminorm.Indicator
5024+
public import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm
50205025
public import Mathlib.MeasureTheory.Function.LpSeminorm.Monotonicity
50215026
public import Mathlib.MeasureTheory.Function.LpSeminorm.Prod
50225027
public import Mathlib.MeasureTheory.Function.LpSeminorm.SMul
@@ -6356,6 +6361,7 @@ public import Mathlib.RingTheory.Polynomial.Selmer
63566361
public import Mathlib.RingTheory.Polynomial.SeparableDegree
63576362
public import Mathlib.RingTheory.Polynomial.ShiftedLegendre
63586363
public import Mathlib.RingTheory.Polynomial.SmallDegreeVieta
6364+
public import Mathlib.RingTheory.Polynomial.Subring
63596365
public import Mathlib.RingTheory.Polynomial.Tower
63606366
public import Mathlib.RingTheory.Polynomial.UniqueFactorization
63616367
public import Mathlib.RingTheory.Polynomial.UniversalFactorizationRing
@@ -6388,6 +6394,7 @@ public import Mathlib.RingTheory.Prime
63886394
public import Mathlib.RingTheory.PrincipalIdealDomain
63896395
public import Mathlib.RingTheory.PrincipalIdealDomainOfPrime
63906396
public import Mathlib.RingTheory.QuasiFinite.Basic
6397+
public import Mathlib.RingTheory.QuasiFinite.Polynomial
63916398
public import Mathlib.RingTheory.QuotSMulTop
63926399
public import Mathlib.RingTheory.Radical
63936400
public import Mathlib.RingTheory.ReesAlgebra
@@ -6495,6 +6502,7 @@ public import Mathlib.RingTheory.TwoSidedIdeal.Kernel
64956502
public import Mathlib.RingTheory.TwoSidedIdeal.Lattice
64966503
public import Mathlib.RingTheory.TwoSidedIdeal.Operations
64976504
public import Mathlib.RingTheory.UniqueFactorizationDomain.Basic
6505+
public import Mathlib.RingTheory.UniqueFactorizationDomain.ClassGroup
64986506
public import Mathlib.RingTheory.UniqueFactorizationDomain.Defs
64996507
public import Mathlib.RingTheory.UniqueFactorizationDomain.FactorSet
65006508
public import Mathlib.RingTheory.UniqueFactorizationDomain.Finite
@@ -6953,6 +6961,7 @@ public import Mathlib.Topology.Algebra.Algebra.Equiv
69536961
public import Mathlib.Topology.Algebra.Algebra.Rat
69546962
public import Mathlib.Topology.Algebra.AsymptoticCone
69556963
public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Basic
6964+
public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Completion
69566965
public import Mathlib.Topology.Algebra.Category.ProfiniteGrp.Limits
69576966
public import Mathlib.Topology.Algebra.ClopenNhdofOne
69586967
public import Mathlib.Topology.Algebra.ConstMulAction
@@ -7159,6 +7168,7 @@ public import Mathlib.Topology.Category.TopCat.Adjunctions
71597168
public import Mathlib.Topology.Category.TopCat.Basic
71607169
public import Mathlib.Topology.Category.TopCat.EffectiveEpi
71617170
public import Mathlib.Topology.Category.TopCat.EpiMono
7171+
public import Mathlib.Topology.Category.TopCat.GrothendieckTopology
71627172
public import Mathlib.Topology.Category.TopCat.Limits.Basic
71637173
public import Mathlib.Topology.Category.TopCat.Limits.Cofiltered
71647174
public import Mathlib.Topology.Category.TopCat.Limits.Konig

Mathlib/Algebra/Category/AlgCat/Monoidal.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ instance : MonoidalCategoryStruct (AlgCat.{u} R) where
5353
whiskerRight {X₁ X₂} (f : X₁ ⟶ X₂) Y := tensorHom f (𝟙 Y)
5454
tensorHom := tensorHom
5555
tensorUnit := of R R
56-
associator X Y Z := (Algebra.TensorProduct.assoc R R X Y Z).toAlgebraIso
56+
associator X Y Z := (Algebra.TensorProduct.assoc R R R X Y Z).toAlgebraIso
5757
leftUnitor X := (Algebra.TensorProduct.lid R X).toAlgebraIso
5858
rightUnitor X := (Algebra.TensorProduct.rid R R X).toAlgebraIso
5959

@@ -86,11 +86,11 @@ theorem hom_inv_rightUnitor {M : AlgCat.{u} R} :
8686
rfl
8787

8888
theorem hom_hom_associator {M N K : AlgCat.{u} R} :
89-
(α_ M N K).hom.hom = (Algebra.TensorProduct.assoc R R M N K).toAlgHom :=
89+
(α_ M N K).hom.hom = (Algebra.TensorProduct.assoc R R R M N K).toAlgHom :=
9090
rfl
9191

9292
theorem hom_inv_associator {M N K : AlgCat.{u} R} :
93-
(α_ M N K).inv.hom = (Algebra.TensorProduct.assoc R R M N K).symm.toAlgHom :=
93+
(α_ M N K).inv.hom = (Algebra.TensorProduct.assoc R R R M N K).symm.toAlgHom :=
9494
rfl
9595

9696
noncomputable instance instMonoidalCategory : MonoidalCategory (AlgCat.{u} R) :=

Mathlib/Algebra/Category/CommAlgCat/Monoidal.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ instance : MonoidalCategory (CommAlgCat.{u} R) where
5858
whiskerRight f T := ofHom (map f.hom (.id _ _))
5959
tensorHom f g := ofHom (map f.hom g.hom)
6060
tensorUnit := .of R R
61-
associator _ _ _ := isoMk (assoc R R _ _ _)
61+
associator _ _ _ := isoMk (assoc R R R _ _ _)
6262
leftUnitor _ := isoMk (lid R _)
6363
rightUnitor _ := isoMk (rid R R _)
6464

@@ -77,10 +77,10 @@ variable (C) in
7777
@[simp] lemma whiskerLeft_hom (f : A ⟶ B) : (C ◁ f).hom = map (.id _ _) f.hom := rfl
7878

7979
variable (A B C) in
80-
@[simp] lemma associator_hom_hom : (α_ A B C).hom.hom = (assoc R R A B C).toAlgHom := rfl
80+
@[simp] lemma associator_hom_hom : (α_ A B C).hom.hom = (assoc R R R A B C).toAlgHom := rfl
8181

8282
variable (A B C) in
83-
@[simp] lemma associator_inv_hom : (α_ A B C).inv.hom = (assoc R R A B C).symm.toAlgHom := rfl
83+
@[simp] lemma associator_inv_hom : (α_ A B C).inv.hom = (assoc R R R A B C).symm.toAlgHom := rfl
8484

8585
instance : BraidedCategory (CommAlgCat.{u} R) where
8686
braiding S T := isoMk (comm R _ _)

Mathlib/Algebra/Category/ModuleCat/Injective.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ theorem injective_iff_injective_object :
4444

4545
end Module
4646

47-
48-
instance ModuleCat.ulift_injective_of_injective.{v'}
49-
[Small.{v} R] [AddCommGroup M] [Module R M]
47+
instance ModuleCat.ulift_injective_of_injective.{v'} [Small.{v} R]
5048
[CategoryTheory.Injective <| ModuleCat.of R M] :
5149
CategoryTheory.Injective <| ModuleCat.of R (ULift.{v'} M) :=
5250
Module.injective_object_of_injective_module

Mathlib/Algebra/Category/ModuleCat/Limits.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ def directLimitDiagram : ι ⥤ ModuleCat R where
225225
symm
226226
apply Module.DirectedSystem.map_map f
227227

228-
variable [DecidableEq ι]
229-
230228
/-- The `Cocone` on `directLimitDiagram` corresponding to
231229
the unbundled `directLimit` of modules.
232230

Mathlib/Algebra/Category/ModuleCat/Topology/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ instance {X Y : TopModuleCat S} : Module S (X ⟶ Y) where
160160
smul r f := ofHom (r • f.hom)
161161
__ := Equiv.module _ CategoryTheory.ConcreteCategory.homEquiv
162162

163-
instance [CommRing S] : Linear S (TopModuleCat S) where
163+
instance : Linear S (TopModuleCat S) where
164164
smul_comp _ _ _ _ _ _ := ConcreteCategory.ext (ContinuousLinearMap.comp_smul _ _ _)
165165
comp_smul _ _ _ _ _ _ := ConcreteCategory.ext (ContinuousLinearMap.smul_comp _ _ _)
166166

Mathlib/Algebra/CharP/Algebra.lean

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ Instances constructed from this result:
3232

3333
@[expose] public section
3434

35+
variable {R A : Type*}
36+
3537
/-- Given `R →+* A`, then `char A ∣ char R`. -/
36-
theorem CharP.dvd_of_ringHom {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A]
38+
theorem CharP.dvd_of_ringHom [NonAssocSemiring R] [NonAssocSemiring A]
3739
(f : R →+* A) (p q : ℕ) [CharP R p] [CharP A q] : q ∣ p := by
3840
refine (CharP.cast_eq_zero_iff A q p).mp ?_
3941
rw [← map_natCast f p, CharP.cast_eq_zero, map_zero]
4042

4143
/-- Given `R →+* A`, where `R` is a domain with `char R > 0`, then `char A = char R`. -/
42-
theorem CharP.of_ringHom_of_ne_zero {R A : Type*} [NonAssocSemiring R] [NoZeroDivisors R]
44+
theorem CharP.of_ringHom_of_ne_zero [NonAssocSemiring R] [NoZeroDivisors R]
4345
[NonAssocSemiring A] [Nontrivial A]
4446
(f : R →+* A) (p : ℕ) (hp : p ≠ 0) [CharP R p] : CharP A p := by
4547
have := f.domain_nontrivial
@@ -51,47 +53,47 @@ theorem CharP.of_ringHom_of_ne_zero {R A : Type*} [NonAssocSemiring R] [NoZeroDi
5153
exact e ▸ hq
5254

5355
/-- If a ring homomorphism `R →+* A` is injective then `A` has the same characteristic as `R`. -/
54-
theorem charP_of_injective_ringHom {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A]
56+
theorem charP_of_injective_ringHom [NonAssocSemiring R] [NonAssocSemiring A]
5557
{f : R →+* A} (h : Function.Injective f) (p : ℕ) [CharP R p] : CharP A p where
5658
cast_eq_zero_iff x := by
5759
rw [← CharP.cast_eq_zero_iff R p x, ← map_natCast f x, map_eq_zero_iff f h]
5860

5961
/-- If the algebra map `R →+* A` is injective then `A` has the same characteristic as `R`. -/
60-
theorem charP_of_injective_algebraMap {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
62+
theorem charP_of_injective_algebraMap [CommSemiring R] [Semiring A] [Algebra R A]
6163
(h : Function.Injective (algebraMap R A)) (p : ℕ) [CharP R p] : CharP A p :=
6264
charP_of_injective_ringHom h p
6365

64-
theorem charP_of_injective_algebraMap' (R : Type*) {A : Type*} [CommRing R] [Semiring A]
66+
theorem charP_of_injective_algebraMap' (R : Type*) [CommRing R] [Semiring A]
6567
[Algebra R A] [FaithfulSMul R A] (p : ℕ) [CharP R p] : CharP A p :=
6668
charP_of_injective_ringHom (FaithfulSMul.algebraMap_injective R A) p
6769

6870
/-- If a ring homomorphism `R →+* A` is injective and `R` has characteristic zero
6971
then so does `A`. -/
70-
theorem charZero_of_injective_ringHom {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A]
72+
theorem charZero_of_injective_ringHom [NonAssocSemiring R] [NonAssocSemiring A]
7173
{f : R →+* A} (h : Function.Injective f) [CharZero R] : CharZero A where
7274
cast_injective _ _ _ := CharZero.cast_injective <| h <| by simpa only [map_natCast f]
7375

7476
/-- If the algebra map `R →+* A` is injective and `R` has characteristic zero then so does `A`. -/
75-
theorem charZero_of_injective_algebraMap {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
77+
theorem charZero_of_injective_algebraMap [CommSemiring R] [Semiring A] [Algebra R A]
7678
(h : Function.Injective (algebraMap R A)) [CharZero R] : CharZero A :=
7779
charZero_of_injective_ringHom h
7880

7981
/-- If `R →+* A` is injective, and `A` is of characteristic `p`, then `R` is also of
8082
characteristic `p`. Similar to `RingHom.charZero`. -/
81-
theorem RingHom.charP {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A)
83+
theorem RingHom.charP [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A)
8284
(H : Function.Injective f) (p : ℕ) [CharP A p] : CharP R p := by
8385
obtain ⟨q, h⟩ := CharP.exists R
8486
exact CharP.eq _ (charP_of_injective_ringHom H q) ‹CharP A p› ▸ h
8587

8688
/-- If `R →+* A` is injective, then `R` is of characteristic `p` if and only if `A` is also of
8789
characteristic `p`. Similar to `RingHom.charZero_iff`. -/
88-
protected theorem RingHom.charP_iff {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A]
90+
protected theorem RingHom.charP_iff [NonAssocSemiring R] [NonAssocSemiring A]
8991
(f : R →+* A) (H : Function.Injective f) (p : ℕ) : CharP R p ↔ CharP A p :=
9092
fun _ ↦ charP_of_injective_ringHom H p, fun _ ↦ f.charP H p⟩
9193

9294
/-- If a ring homomorphism `R →+* A` is injective then `A` has the same exponential characteristic
9395
as `R`. -/
94-
lemma expChar_of_injective_ringHom {R A : Type*}
96+
lemma expChar_of_injective_ringHom
9597
[NonAssocSemiring R] [NonAssocSemiring A] {f : R →+* A} (h : Function.Injective f)
9698
(q : ℕ) [hR : ExpChar R q] : ExpChar A q := by
9799
rcases hR with _ | hprime
@@ -100,33 +102,42 @@ lemma expChar_of_injective_ringHom {R A : Type*}
100102

101103
/-- If `R →+* A` is injective, and `A` is of exponential characteristic `p`, then `R` is also of
102104
exponential characteristic `p`. Similar to `RingHom.charZero`. -/
103-
lemma RingHom.expChar {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A)
105+
lemma RingHom.expChar [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A)
104106
(H : Function.Injective f) (p : ℕ) [ExpChar A p] : ExpChar R p := by
105107
cases ‹ExpChar A p› with
106108
| zero => haveI := f.charZero; exact .zero
107109
| prime hp => haveI := f.charP H p; exact .prime hp
108110

109111
/-- If `R →+* A` is injective, then `R` is of exponential characteristic `p` if and only if `A` is
110112
also of exponential characteristic `p`. Similar to `RingHom.charZero_iff`. -/
111-
lemma RingHom.expChar_iff {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A)
113+
lemma RingHom.expChar_iff [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A)
112114
(H : Function.Injective f) (p : ℕ) : ExpChar R p ↔ ExpChar A p :=
113115
fun _ ↦ expChar_of_injective_ringHom H p, fun _ ↦ f.expChar H p⟩
114116

115117
/-- If the algebra map `R →+* A` is injective then `A` has the same exponential characteristic
116118
as `R`. -/
117-
lemma expChar_of_injective_algebraMap {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
119+
lemma expChar_of_injective_algebraMap [CommSemiring R] [Semiring A] [Algebra R A]
118120
(h : Function.Injective (algebraMap R A)) (q : ℕ) [ExpChar R q] : ExpChar A q :=
119121
expChar_of_injective_ringHom h q
120122

121-
theorem ExpChar.of_injective_algebraMap' (R : Type*) {A : Type*} [CommRing R] [CommRing A]
123+
variable (R) in
124+
theorem ExpChar.of_injective_algebraMap' [CommRing R] [CommRing A]
122125
[Algebra R A] [FaithfulSMul R A] (q : ℕ) [ExpChar R q] : ExpChar A q :=
123126
expChar_of_injective_ringHom (FaithfulSMul.algebraMap_injective R A) q
124127

128+
namespace Subfield
129+
130+
variable [DivisionRing R] (L : Subfield R) (p : ℕ)
131+
132+
instance charP [CharP R p] : CharP L p := L.subtype.charP L.subtype_injective p
133+
instance expChar [ExpChar R p] : ExpChar L p := L.subtype.expChar L.subtype_injective p
134+
135+
end Subfield
136+
125137
/-!
126138
As an application, a `ℚ`-algebra has characteristic zero.
127139
-/
128140

129-
130141
-- `CharP.charP_to_charZero A _ (charP_of_injective_algebraMap h 0)` does not work
131142
-- here as it would require `Ring A`.
132143
section QAlgebra

Mathlib/Algebra/CharP/IntermediateField.lean

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ covered by `SubsemiringClass.instCharZero`.
2222

2323
variable {F E : Type*} [Field F] [Field E] [Algebra F E]
2424

25-
namespace Subfield
26-
27-
variable (L : Subfield F) (p : ℕ)
28-
29-
instance charP [CharP F p] : CharP L p := RingHom.charP _ (algebraMap _ F).injective p
30-
31-
instance expChar [ExpChar F p] : ExpChar L p := RingHom.expChar _ (algebraMap _ F).injective p
32-
33-
end Subfield
34-
3525
namespace IntermediateField
3626

3727
variable (L : IntermediateField F E) (p : ℕ)

0 commit comments

Comments
 (0)