Skip to content

Commit 313e59a

Browse files
committed
refactor(RingTheory/RamificationInertia/Inertia): remove last occurances of inertiaDeg_eq_inertiaDeg' (leanprover-community#41320)
This PR adds a bit more API for `RingTheory/RamificationInertia/Inertia` in order to remove the last occurances of `inertiaDeg_eq_inertiaDeg'`. Co-authored-by: tb65536 <thomas.l.browning@gmail.com>
1 parent 5f4b499 commit 313e59a

4 files changed

Lines changed: 52 additions & 23 deletions

File tree

Mathlib/NumberTheory/NumberField/Completion/Ramification.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Authors: Salvatore Mercuri
66
module
77

88
public import Mathlib.NumberTheory.NumberField.Completion.LiesOverInstances
9-
public import Mathlib.NumberTheory.RamificationInertia.Basic
9+
public import Mathlib.RingTheory.RamificationInertia.Inertia
1010

1111
/-!
1212
# Ramification theory of completions of number fields
@@ -86,16 +86,15 @@ variable (w)
8686
open scoped Classical in
8787
/-- The inertia degree of `w` over `v`. -/
8888
protected noncomputable def inertiaDeg : ℕ :=
89-
if _ : w.1.LiesOver v.1 then (⊥ : Ideal v.Completion).inertiaDeg (⊥ : Ideal w.Completion) else 0
89+
if _ : w.1.LiesOver v.1 then (⊥ : Ideal w.Completion).inertiaDeg' v.Completion else 0
9090

9191
theorem inertiaDeg_of_liesOver [w.1.LiesOver v.1] :
92-
v.inertiaDeg w = (⊥ : Ideal v.Completion).inertiaDeg (⊥ : Ideal w.Completion) := by
92+
v.inertiaDeg w = (⊥ : Ideal w.Completion).inertiaDeg' v.Completion := by
9393
simp only [InfinitePlace.inertiaDeg, dif_pos]
9494

9595
theorem inertiaDeg_eq_finrank [w.1.LiesOver v.1] :
9696
v.inertiaDeg w = Module.finrank v.Completion w.Completion := by
97-
simp only [inertiaDeg_of_liesOver, Ideal.inertiaDeg, Ideal.comap_bot_of_injective _ <|
98-
FaithfulSMul.algebraMap_injective v.Completion w.Completion]
97+
rw [inertiaDeg_of_liesOver, Ideal.inertiaDeg'_eq_of_isMaximal ⊥]
9998
exact Algebra.finrank_eq_of_equiv_equiv (RingEquiv.quotientBot v.Completion)
10099
(RingEquiv.quotientBot w.Completion) (by ext; simp [RingHom.algebraMap_toAlgebra])
101100

Mathlib/NumberTheory/NumberField/Ideal/KummerDedekind.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ theorem inertiaDeg_primesOverSpanEquivMonicFactorsMod_symm_apply (hp : ¬ p ∣
218218
apply Ideal.primesOver.isMaximal
219219
have := liesOver_primesOverSpanEquivMonicFactorsMod_symm hp hQ
220220
rw [primesOverSpanEquivMonicFactorsMod_symm_apply_eq_span,
221-
← inertiaDeg_eq_inertiaDeg' (span {(p : ℤ)}), inertiaDeg_algebraMap,
221+
inertiaDeg'_eq_of_isMaximal (span {(p : ℤ)}),
222222
← finrank_quotient_span_eq_natDegree]
223223
refine Algebra.finrank_eq_of_equiv_equiv (Int.quotientSpanNatEquivZMod p) ?_ (by ext; simp)
224224
exact (ZModXQuotSpanEquivQuotSpanPair hp hQ).symm

Mathlib/NumberTheory/RamificationInertia/HilbertTheory.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ private lemma instances (hp : p ≠ ⊥) :
283283
exact ⟨inst₁, inst₂, inst₃, inst₄, inst₅, Ideal.ne_bot_of_liesOver_of_ne_bot hp 𝓟D⟩
284284

285285
variable [FiniteDimensional K L] [Ring.HasFiniteQuotients A] [𝓟D.IsMaximal] [P.IsMaximal]
286-
[p.IsMaximal]
287286

288287
include K L D P in
289288
private lemma ramificationIdxIn_eq_and_inertiaDegIn_eq (hp : p ≠ ⊥) :
@@ -297,8 +296,7 @@ private lemma ramificationIdxIn_eq_and_inertiaDegIn_eq (hp : p ≠ ⊥) :
297296
exact 𝓟D.ramificationIdx_above_le P
298297
· rw [inertiaDegIn_eq_inertiaDeg p P Gal(L/K),
299298
inertiaDegIn_eq_inertiaDeg _ P (stabilizer Gal(L/K) P)]
300-
rw [← inertiaDeg_eq_inertiaDeg' p, ← inertiaDeg_eq_inertiaDeg' 𝓟D]
301-
exact inertiaDeg_le_inertiaDeg p 𝓟D P
299+
exact inertiaDeg'_above_le 𝓟D P
302300
· have := ncard_primesOver_mul_ramificationIdxIn_mul_inertiaDegIn 𝓟D B (stabilizer Gal(L/K) P)
303301
rw [primesOver_eq_singleton K L P D 𝓞D, Set.ncard_singleton, one_mul] at this
304302
rw [this, IsGaloisGroup.card_eq_finrank (stabilizer Gal(L/K) P) D L,

Mathlib/RingTheory/RamificationInertia/Inertia.lean

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,36 @@ theorem inertiaDeg'_eq [q.LiesOver p] [q.IsPrime] [p.IsPrime]
7676
subst this
7777
exact inertiaDeg'_def q R
7878

79-
theorem inertiaDeg_eq_inertiaDeg' [q.LiesOver p] [p.IsMaximal] [q.IsMaximal] :
80-
p.inertiaDeg q = q.inertiaDeg' R := by
79+
theorem inertiaDeg'_eq_of_isFractionRing [q.LiesOver p] [p.IsPrime] [q.IsPrime]
80+
(K L : Type*) [Field K] [Field L]
81+
[Algebra (R ⧸ p) K] [IsFractionRing (R ⧸ p) K]
82+
[Algebra (S ⧸ q) L] [IsFractionRing (S ⧸ q) L]
83+
[Algebra R K] [IsScalarTower R (R ⧸ p) K]
84+
[Algebra S L] [IsScalarTower S (S ⧸ q) L]
85+
[Algebra R L] [IsScalarTower R S L]
86+
[Algebra K L] [IsScalarTower R K L] :
87+
q.inertiaDeg' R = Module.finrank K L := by
88+
let := Localization.AtPrime.algebraOfLiesOver p q
89+
rw [inertiaDeg'_eq p q]
90+
apply Algebra.finrank_eq_of_equiv_equiv
91+
(IsFractionRing.algEquivOfAlgEquiv (R := R) (A := R ⧸ p) (K := p.ResidueField) (L := K) .refl)
92+
(IsFractionRing.algEquivOfAlgEquiv (R := S) (A := S ⧸ q) (K := q.ResidueField) (L := L) .refl)
93+
apply IsFractionRing.ringHom_ext (A := R ⧸ p)
94+
intro x
95+
obtain ⟨x, rfl⟩ := Ideal.Quotient.mk_surjective x
96+
simp [← IsScalarTower.algebraMap_apply R p.ResidueField q.ResidueField,
97+
IsScalarTower.algebraMap_apply R S q.ResidueField,
98+
← IsScalarTower.algebraMap_apply R K L, ← IsScalarTower.algebraMap_apply R S L]
99+
100+
theorem inertiaDeg'_eq_of_isMaximal [q.LiesOver p] [p.IsMaximal] [q.IsMaximal] :
101+
q.inertiaDeg' R = Module.finrank (R ⧸ p) (S ⧸ q) := by
81102
let : Field (R ⧸ p) := Quotient.field p
82103
let : Field (S ⧸ q) := Quotient.field q
83-
let := Localization.AtPrime.algebraOfLiesOver p q
84-
rw [inertiaDeg'_eq p q, inertiaDeg_algebraMap]
85-
let f := (algebraMap (S ⧸ q) q.ResidueField).comp (algebraMap (R ⧸ p) (S ⧸ q))
86-
let g := (algebraMap p.ResidueField q.ResidueField).comp (algebraMap (R ⧸ p) p.ResidueField)
87-
have h : f = g := by ext; simp [f, g, ← IsScalarTower.algebraMap_apply]
88-
let : Algebra (R ⧸ p) q.ResidueField := f.toAlgebra
89-
have : IsScalarTower (R ⧸ p) (S ⧸ q) q.ResidueField := IsScalarTower.of_algebraMap_eq' rfl
90-
have : IsScalarTower (R ⧸ p) p.ResidueField q.ResidueField := IsScalarTower.of_algebraMap_eq' h
91-
rw [← mul_one (Module.finrank (R ⧸ p) (S ⧸ q)),
92-
← Module.finrank_of_bijective_algebraMap (bijective_algebraMap_quotient_residueField q),
93-
Module.finrank_mul_finrank, ← Module.finrank_mul_finrank (R ⧸ p) p.ResidueField q.ResidueField,
94-
Module.finrank_of_bijective_algebraMap (bijective_algebraMap_quotient_residueField p), one_mul]
104+
exact inertiaDeg'_eq_of_isFractionRing p q (R ⧸ p) (S ⧸ q)
105+
106+
theorem inertiaDeg_eq_inertiaDeg' [q.LiesOver p] [p.IsMaximal] [q.IsMaximal] :
107+
p.inertiaDeg q = q.inertiaDeg' R := by
108+
rw [inertiaDeg_algebraMap, inertiaDeg'_eq_of_isMaximal p q]
95109

96110
theorem inertiaDeg'_tower [r.LiesOver q] :
97111
r.inertiaDeg' R = q.inertiaDeg' R * r.inertiaDeg' S := by
@@ -105,6 +119,24 @@ theorem inertiaDeg'_tower [r.LiesOver q] :
105119
apply Module.finrank_mul_finrank
106120
· rw [inertiaDeg'_of_not_isPrime r R hr, inertiaDeg'_of_not_isPrime r S hr, mul_zero]
107121

122+
theorem inertiaDeg'_below_dvd [r.LiesOver q] :
123+
q.inertiaDeg' R ∣ r.inertiaDeg' R := by
124+
use r.inertiaDeg' S
125+
rw [← inertiaDeg'_tower]
126+
127+
theorem inertiaDeg'_above_dvd [r.LiesOver q] :
128+
r.inertiaDeg' S ∣ r.inertiaDeg' R := by
129+
use q.inertiaDeg' R
130+
rw [mul_comm, ← inertiaDeg'_tower]
131+
132+
theorem inertiaDeg'_below_le [r.IsPrime] [r.LiesOver q] [Module.Finite R T] :
133+
q.inertiaDeg' R ≤ r.inertiaDeg' R :=
134+
Nat.le_of_dvd (r.inertiaDeg'_pos R) (q.inertiaDeg'_below_dvd r)
135+
136+
theorem inertiaDeg'_above_le [r.IsPrime] [r.LiesOver q] [Module.Finite R T] :
137+
r.inertiaDeg' S ≤ r.inertiaDeg' R :=
138+
Nat.le_of_dvd (r.inertiaDeg'_pos R) (q.inertiaDeg'_above_dvd r)
139+
108140
variable (R) in
109141
open Pointwise in
110142
@[simp]

0 commit comments

Comments
 (0)