Skip to content

Commit fbfd7f5

Browse files
committed
refactor(RingTheory/Localization/FractionRing): remove bottom ring and field from IsFractionRing.mulSemiringAction (leanprover-community#40804)
This PR removes the bottom ring and field from `IsFractionRing.mulSemiringAction` since they are unnecessary. Co-authored-by: tb65536 <thomas.l.browning@gmail.com>
1 parent 8690e4f commit fbfd7f5

5 files changed

Lines changed: 67 additions & 34 deletions

File tree

Mathlib/Algebra/Ring/Action/Group.lean

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module
77

88
public import Mathlib.Algebra.GroupWithZero.Action.Basic
99
public import Mathlib.Algebra.Ring.Action.Basic
10+
public import Mathlib.Algebra.Ring.Aut
1011
public import Mathlib.Algebra.Ring.Equiv
1112

1213
/-!
@@ -25,7 +26,24 @@ variable (R : Type*) [Semiring R]
2526

2627
/-- Each element of the group defines a semiring isomorphism. -/
2728
@[simps!]
28-
def MulSemiringAction.toRingEquiv [MulSemiringAction G R] (x : G) : R ≃+* R :=
29-
{ DistribMulAction.toAddEquiv R x, MulSemiringAction.toRingHom G R x with }
29+
def MulSemiringAction.toRingEquiv [MulSemiringAction G R] : G →* (R ≃+* R) where
30+
toFun x := { DistribMulAction.toAddEquiv R x, MulSemiringAction.toRingHom G R x with }
31+
map_one' := by ext; simp
32+
map_mul' x y := by ext; simp [mul_smul]
33+
34+
@[deprecated (since := "2026-06-19")] alias MulSemiringAction.toRingEquiv_apply :=
35+
MulSemiringAction.toRingEquiv_apply_apply
36+
37+
@[deprecated (since := "2026-06-19")] alias MulSemiringAction.toRingEquiv_symm_apply :=
38+
MulSemiringAction.toRingEquiv_apply_symm_apply
39+
40+
instance : MulSemiringAction (R ≃+* R) R where
41+
smul := (· ·)
42+
mul_smul _ _ _ := rfl
43+
one_smul _ := rfl
44+
smul_zero := map_zero
45+
smul_one := map_one
46+
smul_add := map_add
47+
smul_mul := map_mul
3048

3149
end Semiring

Mathlib/Algebra/Star/UnitaryStarAlgAut.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def conjStarAlgAut : unitary R →* (R ≃⋆ₐ[S] R) where
3838
dsimp [ConjAct.units_smul_def]
3939
simp [mul_assoc, ← Unitary.star_eq_inv] }
4040
map_one' := by ext; simp
41-
map_mul' g h := by ext; simp [mul_smul]
41+
map_mul' g h := by ext; simp
4242

4343
@[simp] theorem conjStarAlgAut_apply (u : unitary R) (x : R) :
4444
conjStarAlgAut S R u x = u * x * (star u : R) := rfl

Mathlib/FieldTheory/Galois/IsGaloisGroup.lean

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,17 @@ theorem IsGaloisGroup.iff_isFractionRing [Finite G] [IsIntegrallyClosed A] :
239239
@[deprecated (since := "2026-04-20")] alias FractionRing.mulSemiringAction_of_isGaloisGroup :=
240240
IsFractionRing.mulSemiringAction
241241

242-
attribute [local instance] FractionRing.liftAlgebra in
243242
/--
244243
If `G` is finite and `IsGaloisGroup G A B` with `A` and `B` domains, then `G` is also
245244
a Galois group for `FractionRing B / FractionRing A` for the action defined by
246245
`IsFractionRing.mulSemiringAction`.
247246
-/
248-
theorem IsGaloisGroup.toFractionRing [IsDomain A] [IsDomain B] [IsTorsionFree A B] [Finite G]
249-
[IsGaloisGroup G A B] :
250-
letI := IsFractionRing.mulSemiringAction G A B (FractionRing A) (FractionRing B)
247+
instance IsGaloisGroup.toFractionRing [IsDomain A] [IsDomain B] [IsTorsionFree A B] [Finite G]
248+
[IsGaloisGroup G A B] [Algebra (FractionRing A) (FractionRing B)]
249+
[IsScalarTower A (FractionRing A) (FractionRing B)] :
250+
letI := IsFractionRing.mulSemiringAction G B (FractionRing B)
251251
IsGaloisGroup G (FractionRing A) (FractionRing B) := by
252-
let := IsFractionRing.mulSemiringAction G A B (FractionRing A) (FractionRing B)
253-
have : SMulDistribClass G B (FractionRing B) := ⟨fun g b x ↦ by
254-
rw [Algebra.smul_def', Algebra.smul_def', smul_mul']
255-
congr
256-
exact IsFractionRing.fieldEquivOfAlgEquiv_algebraMap (FractionRing A) _ _ _ b⟩
252+
let := IsFractionRing.mulSemiringAction G B (FractionRing B)
257253
apply IsGaloisGroup.to_isFractionRing G A B _ _
258254

259255
open NumberField
@@ -314,7 +310,7 @@ protected theorem finite (R B : Type*) [CommRing R] [CommRing B] [Algebra R B] [
314310
[IsDomain B] [MulSemiringAction G B] [IsGaloisGroup G R B] : Finite G := by
315311
let A : Subring B := (algebraMap R B).range
316312
let := FractionRing.liftAlgebra A (FractionRing B)
317-
let := IsFractionRing.mulSemiringAction G A B (FractionRing A) (FractionRing B)
313+
let := IsFractionRing.mulSemiringAction G B (FractionRing B)
318314
let : Algebra R A := (algebraMap R B).rangeRestrict.toAlgebra
319315
have : IsScalarTower R A B := IsScalarTower.of_algebraMap_eq' rfl
320316
have : Module.Finite A B := Module.Finite.of_restrictScalars_finite R A B
@@ -331,9 +327,9 @@ theorem card_eq_finrank' (A B : Type*) [CommRing A] [CommRing B] [Algebra A B] [
331327
Nat.card G = Module.finrank A B := by
332328
have := IsDomain.of_faithfulSMul A B
333329
let := FractionRing.liftAlgebra A (FractionRing B)
334-
let := IsFractionRing.mulSemiringAction G A B (FractionRing A) (FractionRing B)
330+
let := IsFractionRing.mulSemiringAction G B (FractionRing B)
335331
have : Algebra.IsIntegral A B := IsGaloisGroup.isInvariant.isIntegral A B G
336-
rw [(IsGaloisGroup.toFractionRing G A B).card_eq_finrank,
332+
rw [IsGaloisGroup.card_eq_finrank G (FractionRing A) (FractionRing B),
337333
Algebra.IsAlgebraic.finrank_of_isFractionRing A (FractionRing A) B (FractionRing B)]
338334

339335
/-- If `G` is a finite Galois group for `L/K`, then `G` is isomorphic to `Gal(L/K)`. -/
@@ -374,10 +370,8 @@ noncomputable def mulEquivCongr [Finite G] [Finite G'] (A B : Type*) [CommRing A
374370
haveI : IsDomain A := (FaithfulSMul.algebraMap_injective A B).isDomain
375371
letI K := FractionRing A
376372
letI L := FractionRing B
377-
letI : MulSemiringAction G L := IsFractionRing.mulSemiringAction G A B K L
378-
letI : MulSemiringAction G' L := IsFractionRing.mulSemiringAction G' A B K L
379-
haveI : IsGaloisGroup G K L := IsGaloisGroup.toFractionRing G A B
380-
haveI : IsGaloisGroup G' K L := IsGaloisGroup.toFractionRing G' A B
373+
letI : MulSemiringAction G L := IsFractionRing.mulSemiringAction G B L
374+
letI : MulSemiringAction G' L := IsFractionRing.mulSemiringAction G' B L
381375
mulEquivCongr' G G' K L
382376

383377
attribute [local instance] FractionRing.liftAlgebra in
@@ -389,10 +383,8 @@ theorem mulEquivCongr_apply_smul [Finite G] [Finite G'] (A B : Type*) [CommRing
389383
haveI : IsDomain A := (FaithfulSMul.algebraMap_injective A B).isDomain
390384
letI K := FractionRing A
391385
letI L := FractionRing B
392-
letI : MulSemiringAction G L := IsFractionRing.mulSemiringAction G A B K L
393-
letI : MulSemiringAction G' L := IsFractionRing.mulSemiringAction G' A B K L
394-
haveI : IsGaloisGroup G K L := IsGaloisGroup.toFractionRing G A B
395-
haveI : IsGaloisGroup G' K L := IsGaloisGroup.toFractionRing G' A B
386+
letI : MulSemiringAction G L := IsFractionRing.mulSemiringAction G B L
387+
letI : MulSemiringAction G' L := IsFractionRing.mulSemiringAction G' B L
396388
apply FaithfulSMul.algebraMap_injective B L
397389
rw [algebraMap.smul', algebraMap.smul']
398390
exact mulEquivCongr'_apply_smul G G' K L g _
@@ -576,8 +568,7 @@ theorem fixingSubgroup_range_algebraMap [Finite G] (A B C : Type*) (H : Subgroup
576568
have : IsDomain A := (FaithfulSMul.algebraMap_injective A C).isDomain
577569
let K := FractionRing A
578570
let L := FractionRing C
579-
let : MulSemiringAction G L := IsFractionRing.mulSemiringAction G A C K L
580-
have : IsGaloisGroup G K L := IsGaloisGroup.toFractionRing G A C
571+
let : MulSemiringAction G L := IsFractionRing.mulSemiringAction G C L
581572
have : IsGaloisGroup H (FractionRing B) L := IsGaloisGroup.toFractionRing H B C
582573
rw [← fixingSubgroup_range_algebraMap' G K L H (FractionRing B)]
583574
ext g

Mathlib/NumberTheory/RamificationInertia/Galois.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ variable {A B : Type*} [CommRing A] [IsDomain A] [CommRing B] [IsDomain B]
244244
include G GAC GBC in
245245
theorem ncard_primesOver_mul_ncard_primesOver :
246246
(p.primesOver B).ncard * (P.primesOver C).ncard = (p.primesOver C).ncard := by
247-
let := IsFractionRing.mulSemiringAction G A B (FractionRing A) (FractionRing B)
248-
let := IsFractionRing.mulSemiringAction GAC A C (FractionRing A) (FractionRing C)
249-
let := IsFractionRing.mulSemiringAction GBC B C (FractionRing B) (FractionRing C)
247+
let := IsFractionRing.mulSemiringAction G B (FractionRing B)
248+
let := IsFractionRing.mulSemiringAction GAC C (FractionRing C)
249+
let := IsFractionRing.mulSemiringAction GBC C (FractionRing C)
250250
have : p.ramificationIdxIn C * p.inertiaDegIn C ≠ 0 :=
251251
mul_ne_zero (ramificationIdxIn_ne_zero GAC) (inertiaDegIn_ne_zero GAC)
252252
rw [← Nat.mul_left_inj this, ncard_primesOver_mul_ramificationIdxIn_mul_inertiaDegIn p C GAC]

Mathlib/RingTheory/Localization/FractionRing.lean

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ lemma ringEquivOfRingEquiv_algebraMap
437437
(a : A) : ringEquivOfRingEquiv h (algebraMap A K a) = algebraMap B L (h a) := by
438438
simp
439439

440+
@[simp]
441+
lemma ringEquivOfRingEquiv_refl :
442+
ringEquivOfRingEquiv (.refl A) = .refl K := by ext; simp
443+
440444
@[simp]
441445
lemma ringEquivOfRingEquiv_symm :
442446
(ringEquivOfRingEquiv h : K ≃+* L).symm = ringEquivOfRingEquiv h.symm := rfl
@@ -449,6 +453,26 @@ theorem ringEquivOfRingEquiv_comp {C : Type*} (M : Type*) [CommRing C]
449453
ext a
450454
simp [IsLocalization.map_map]
451455

456+
variable (A K)
457+
458+
/-- A ring automorphism of a ring induces an ring automorphism of its fraction field.
459+
460+
This is a bundled version of `ringEquivOfRingEquiv`. -/
461+
noncomputable def ringEquivOfRingEquivHom : (A ≃+* A) →* (K ≃+* K) where
462+
toFun := ringEquivOfRingEquiv
463+
map_one' := ringEquivOfRingEquiv_refl
464+
map_mul' f g := ringEquivOfRingEquiv_comp K K K g f
465+
466+
@[simp]
467+
lemma ringEquivOfRingEquivHom_apply (f : A ≃+* A) :
468+
ringEquivOfRingEquivHom A K f = ringEquivOfRingEquiv f :=
469+
rfl
470+
471+
lemma ringEquivOfRingEquivHom_injective : Function.Injective (ringEquivOfRingEquivHom A K) := by
472+
intro f g h
473+
ext b
474+
simpa using RingEquiv.ext_iff.mp h (algebraMap A K b)
475+
452476
end ringEquivOfRingEquiv
453477

454478
section semilinearEquivOfRingEquiv
@@ -624,21 +648,21 @@ variable (G A B K L : Type*) [Group G] [CommRing A] [CommRing B] [MulSemiringAct
624648
/-- Given a `MulSemiringAction G B`, extend the action of `G` on `B` to a `MulSemiringAction G L`
625649
on the fraction field `L` of `B`. -/
626650
@[implicit_reducible]
627-
noncomputable def mulSemiringAction [SMulCommClass G A B] :
651+
noncomputable def mulSemiringAction :
628652
MulSemiringAction G L :=
629653
MulSemiringAction.compHom L
630-
((fieldEquivOfAlgEquivHom K L).comp (MulSemiringAction.toAlgAut G A B))
654+
((ringEquivOfRingEquivHom B L).comp (MulSemiringAction.toRingEquiv G B))
631655

632656
/-- The action of `G` on the fraction field `L` of `B` given by `IsFractionRing.mulSemiringAction`
633657
is compatible with the embedding `B ⊆ L`. -/
634-
instance smulDistribClass [SMulCommClass G A B] :
635-
letI := mulSemiringAction G A B K L
658+
instance smulDistribClass :
659+
letI := mulSemiringAction G B L
636660
SMulDistribClass G B L :=
637-
let := mulSemiringAction G A B K L
661+
let := mulSemiringAction G B L
638662
fun g b x ↦ by
639663
rw [Algebra.smul_def', Algebra.smul_def', smul_mul']
640664
congr
641-
apply fieldEquivOfAlgEquiv_algebraMap
665+
apply ringEquivOfRingEquiv_algebraMap
642666

643667
variable [MulSemiringAction G L] [SMulDistribClass G B L]
644668

0 commit comments

Comments
 (0)