File: Mathlib/NumberTheory/RamificationInertia.lean

full_name: Ideal.ramificationIdx
code: /-- The ramification index of `P` over `p` is the largest exponent `n` such that
`p` is contained in `P^n`.

In particular, if `p` is not contained in `P^n`, then the ramification index is 0.

If there is no largest such `n` (e.g. because `p = ⊥`), then `ramificationIdx` is
defined to be 0.
-/
noncomputable def ramificationIdx : ℕ 
goal: ℕ

full_name: Ideal.ramificationIdx_eq_find
code: theorem ramificationIdx_eq_find (h : ∃ n, ∀ k, map f p ≤ P ^ k → k ≤ n) :
    ramificationIdx f p P = Nat.find h 
goal: Ideal.ramificationIdx f p P = Nat.find h

full_name: Ideal.ramificationIdx_eq_zero
code: theorem ramificationIdx_eq_zero (h : ∀ n : ℕ, ∃ k, map f p ≤ P ^ k ∧ n < k) :
    ramificationIdx f p P = 0 
goal: Ideal.ramificationIdx f p P = 0

full_name: Ideal.ramificationIdx_spec
code: theorem ramificationIdx_spec {n : ℕ} (hle : map f p ≤ P ^ n) (hgt : ¬map f p ≤ P ^ (n + 1)) :
    ramificationIdx f p P = n 
goal: Ideal.ramificationIdx f p P = n

full_name: Ideal.ramificationIdx_lt
code: theorem ramificationIdx_lt {n : ℕ} (hgt : ¬map f p ≤ P ^ n) : ramificationIdx f p P < n 
goal: Ideal.ramificationIdx f p P < n

full_name: Ideal.ramificationIdx_bot
code: @[simp]
theorem ramificationIdx_bot : ramificationIdx f ⊥ P = 0 
goal: Ideal.ramificationIdx f ⊥ P = 0

full_name: Ideal.ramificationIdx_of_not_le
code: @[simp]
theorem ramificationIdx_of_not_le (h : ¬map f p ≤ P) : ramificationIdx f p P = 0 
goal: Ideal.ramificationIdx f p P = 0

full_name: Ideal.ramificationIdx_ne_zero
code: theorem ramificationIdx_ne_zero {e : ℕ} (he : e ≠ 0) (hle : map f p ≤ P ^ e)
    (hnle : ¬map f p ≤ P ^ (e + 1)) : ramificationIdx f p P ≠ 0 
goal: Ideal.ramificationIdx f p P ≠ 0

full_name: Ideal.le_pow_of_le_ramificationIdx
code: theorem le_pow_of_le_ramificationIdx {n : ℕ} (hn : n ≤ ramificationIdx f p P) :
    map f p ≤ P ^ n 
goal: Ideal.map f p ≤ P ^ n

full_name: Ideal.le_pow_ramificationIdx
code: theorem le_pow_ramificationIdx : map f p ≤ P ^ ramificationIdx f p P 
goal: Ideal.map f p ≤ P ^ Ideal.ramificationIdx f p P

full_name: Ideal.le_comap_pow_ramificationIdx
code: theorem le_comap_pow_ramificationIdx : p ≤ comap f (P ^ ramificationIdx f p P) 
goal: p ≤ Ideal.comap f (P ^ Ideal.ramificationIdx f p P)

full_name: Ideal.le_comap_of_ramificationIdx_ne_zero
code: theorem le_comap_of_ramificationIdx_ne_zero (h : ramificationIdx f p P ≠ 0) : p ≤ comap f P 
goal: p ≤ Ideal.comap f P

full_name: Ideal.IsDedekindDomain.ramificationIdx_eq_normalizedFactors_count
code: theorem ramificationIdx_eq_normalizedFactors_count (hp0 : map f p ≠ ⊥) (hP : P.IsPrime)
    (hP0 : P ≠ ⊥) : ramificationIdx f p P = (normalizedFactors (map f p)).count P 
goal: Ideal.ramificationIdx f p P = Multiset.count P (UniqueFactorizationMonoid.normalizedFactors (Ideal.map f p))

full_name: Ideal.IsDedekindDomain.ramificationIdx_eq_factors_count
code: theorem ramificationIdx_eq_factors_count (hp0 : map f p ≠ ⊥) (hP : P.IsPrime) (hP0 : P ≠ ⊥) :
    ramificationIdx f p P = (factors (map f p)).count P 
goal: Ideal.ramificationIdx f p P = Multiset.count P (UniqueFactorizationMonoid.factors (Ideal.map f p))

full_name: Ideal.IsDedekindDomain.ramificationIdx_ne_zero
code: theorem ramificationIdx_ne_zero (hp0 : map f p ≠ ⊥) (hP : P.IsPrime) (le : map f p ≤ P) :
    ramificationIdx f p P ≠ 0 
goal: Ideal.ramificationIdx f p P ≠ 0

full_name: Ideal.inertiaDeg
code: /-- The inertia degree of `P : Ideal S` lying over `p : Ideal R` is the degree of the
extension `(S / P) : (R / p)`.

We do not assume `P` lies over `p` in the definition; we return `0` instead.

See `inertiaDeg_algebraMap` for the common case where `f = algebraMap R S`
and there is an algebra structure `R / p → S / P`.
-/
noncomputable def inertiaDeg [p.IsMaximal] : ℕ 
goal: ℕ

full_name: Ideal.inertiaDeg_of_subsingleton
code: @[simp]
theorem inertiaDeg_of_subsingleton [hp : p.IsMaximal] [hQ : Subsingleton (S ⧸ P)] :
    inertiaDeg f p P = 0 
goal: Ideal.inertiaDeg f p P = 0

full_name: Ideal.inertiaDeg_algebraMap
code: @[simp]
theorem inertiaDeg_algebraMap [Algebra R S] [Algebra (R ⧸ p) (S ⧸ P)]
    [IsScalarTower R (R ⧸ p) (S ⧸ P)] [hp : p.IsMaximal] :
    inertiaDeg (algebraMap R S) p P = finrank (R ⧸ p) (S ⧸ P) 
goal: Ideal.inertiaDeg (algebraMap R S) p P = FiniteDimensional.finrank (R ⧸ p) (S ⧸ P)

full_name: Ideal.FinrankQuotientMap.linearIndependent_of_nontrivial
code: /-- Let `V` be a vector space over `K = Frac(R)`, `S / R` a ring extension
and `V'` a module over `S`. If `b`, in the intersection `V''` of `V` and `V'`,
is linear independent over `S` in `V'`, then it is linear independent over `R` in `V`.

The statement we prove is actually slightly more general:
 * it suffices that the inclusion `algebraMap R S : R → S` is nontrivial
 * the function `f' : V'' → V'` doesn't need to be injective
-/
theorem FinrankQuotientMap.linearIndependent_of_nontrivial [IsDedekindDomain R]
    (hRS : RingHom.ker (algebraMap R S) ≠ ⊤) (f : V'' →ₗ[R] V) (hf : Function.Injective f)
    (f' : V'' →ₗ[R] V') {ι : Type*} {b : ι → V''} (hb' : LinearIndependent S (f' ∘ b)) :
    LinearIndependent K (f ∘ b) 
goal: LinearIndependent K (⇑f ∘ b)

full_name: Ideal.FinrankQuotientMap.span_eq_top
code: /-- If `b` mod `p` spans `S/p` as `R/p`-space, then `b` itself spans `Frac(S)` as `K`-space.

Here,
 * `p` is an ideal of `R` such that `R / p` is nontrivial
 * `K` is a field that has an embedding of `R` (in particular we can take `K = Frac(R)`)
 * `L` is a field extension of `K`
 * `S` is the integral closure of `R` in `L`

More precisely, we avoid quotients in this statement and instead require that `b ∪ pS` spans `S`.
-/
theorem FinrankQuotientMap.span_eq_top [IsDomain R] [IsDomain S] [Algebra K L] [IsNoetherian R S]
    [Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [IsIntegralClosure S R L]
    [NoZeroSMulDivisors R K] (hp : p ≠ ⊤) (b : Set S)
    (hb' : Submodule.span R b ⊔ (p.map (algebraMap R S)).restrictScalars R = ⊤) :
    Submodule.span K (algebraMap S L '' b) = ⊤ 
goal: Submodule.span K (⇑(algebraMap S L) '' b) = ⊤

full_name: Ideal.finrank_quotient_map
code: /-- If `p` is a maximal ideal of `R`, and `S` is the integral closure of `R` in `L`,
then the dimension `[S/pS : R/p]` is equal to `[Frac(S) : Frac(R)]`. -/
theorem finrank_quotient_map [IsDomain S] [IsDedekindDomain R] [Algebra K L]
    [Algebra R L] [IsScalarTower R K L] [IsScalarTower R S L] [IsIntegralClosure S R L]
    [hp : p.IsMaximal] [IsNoetherian R S] :
    finrank (R ⧸ p) (S ⧸ map (algebraMap R S) p) = finrank K L 
goal: FiniteDimensional.finrank (R ⧸ p) (S ⧸ Ideal.map (algebraMap R S) p) = FiniteDimensional.finrank K L

full_name: Ideal._aux_Mathlib_NumberTheory_RamificationInertia___macroRules_Ideal_termE_1
code: local notation "e" => ramificationIdx f p P
goal: Lean.Macro

full_name: Ideal._aux_Mathlib_NumberTheory_RamificationInertia___unexpand_Ideal_ramificationIdx_1
code: local notation "e" => ramificationIdx f p P
goal: Lean.PrettyPrinter.Unexpander

full_name: Ideal.Quotient.algebraQuotientPowRamificationIdx
code: /-- `R / p` has a canonical map to `S / (P ^ e)`, where `e` is the ramification index
of `P` over `p`. -/
noncomputable instance Quotient.algebraQuotientPowRamificationIdx : Algebra (R ⧸ p) (S ⧸ P ^ e) 
goal: Algebra (R ⧸ p) (S ⧸ P ^ Ideal.ramificationIdx f p P)

full_name: Ideal.Quotient.algebraMap_quotient_pow_ramificationIdx
code: @[simp]
theorem Quotient.algebraMap_quotient_pow_ramificationIdx (x : R) :
    algebraMap (R ⧸ p) (S ⧸ P ^ e) (Ideal.Quotient.mk p x) = Ideal.Quotient.mk (P ^ e) (f x) 
goal: (algebraMap (R ⧸ p) (S ⧸ P ^ Ideal.ramificationIdx f p P)) ((Ideal.Quotient.mk p) x) =
  (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (f x)

full_name: Ideal.Quotient.algebraQuotientOfRamificationIdxNeZero
code: /-- If `P` lies over `p`, then `R / p` has a canonical map to `S / P`.

This can't be an instance since the map `f : R → S` is generally not inferrable.
-/
def Quotient.algebraQuotientOfRamificationIdxNeZero : Algebra (R ⧸ p) (S ⧸ P) 
goal: Algebra (R ⧸ p) (S ⧸ P)

full_name: Ideal.Quotient.algebraMap_quotient_of_ramificationIdx_neZero
code: @[simp]
theorem Quotient.algebraMap_quotient_of_ramificationIdx_neZero (x : R) :
    algebraMap (R ⧸ p) (S ⧸ P) (Ideal.Quotient.mk p x) = Ideal.Quotient.mk P (f x) 
goal: (algebraMap (R ⧸ p) (S ⧸ P)) ((Ideal.Quotient.mk p) x) = (Ideal.Quotient.mk P) (f x)

full_name: Ideal.powQuotSuccInclusion
code: /-- The inclusion `(P^(i + 1) / P^e) ⊂ (P^i / P^e)`. -/
@[simps]
def powQuotSuccInclusion (i : ℕ) :
    Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ (i + 1)) →ₗ[R ⧸ p]
    Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i) 
goal: ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ (i + 1))) →ₗ[R ⧸ p]
  ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i))

full_name: Ideal.powQuotSuccInclusion_apply_coe
code: /-- The inclusion `(P^(i + 1) / P^e) ⊂ (P^i / P^e)`. -/
@[simps]
def powQuotSuccInclusion (i : ℕ) :
    Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ (i + 1)) →ₗ[R ⧸ p]
    Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i) 
goal: ↑((Ideal.powQuotSuccInclusion f p P i) x) = ↑x

full_name: Ideal.powQuotSuccInclusion_injective
code: theorem powQuotSuccInclusion_injective (i : ℕ) :
    Function.Injective (powQuotSuccInclusion f p P i) 
goal: Function.Injective ⇑(Ideal.powQuotSuccInclusion f p P i)

full_name: Ideal.quotientToQuotientRangePowQuotSuccAux
code: /-- `S ⧸ P` embeds into the quotient by `P^(i+1) ⧸ P^e` as a subspace of `P^i ⧸ P^e`.
See `quotientToQuotientRangePowQuotSucc` for this as a linear map,
and `quotientRangePowQuotSuccInclusionEquiv` for this as a linear equivalence.
-/
noncomputable def quotientToQuotientRangePowQuotSuccAux {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) :
    S ⧸ P →
      (P ^ i).map (Ideal.Quotient.mk (P ^ e)) ⧸ LinearMap.range (powQuotSuccInclusion f p P i) 
goal: S ⧸ P →
  ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) ⧸
    LinearMap.range (Ideal.powQuotSuccInclusion f p P i)

full_name: Ideal.quotientToQuotientRangePowQuotSuccAux_mk
code: theorem quotientToQuotientRangePowQuotSuccAux_mk {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) (x : S) :
    quotientToQuotientRangePowQuotSuccAux f p P a_mem (Submodule.Quotient.mk x) =
      Submodule.Quotient.mk ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩ 
goal: Ideal.quotientToQuotientRangePowQuotSuccAux f p P a_mem (Submodule.Quotient.mk x) =
  Submodule.Quotient.mk ⟨(Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (a * x), ⋯⟩

full_name: Ideal.quotientToQuotientRangePowQuotSucc
code: /-- `S ⧸ P` embeds into the quotient by `P^(i+1) ⧸ P^e` as a subspace of `P^i ⧸ P^e`. -/
noncomputable def quotientToQuotientRangePowQuotSucc {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) :
    S ⧸ P →ₗ[R ⧸ p]
      (P ^ i).map (Ideal.Quotient.mk (P ^ e)) ⧸ LinearMap.range (powQuotSuccInclusion f p P i) 
goal: S ⧸ P →ₗ[R ⧸ p]
  ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) ⧸
    LinearMap.range (Ideal.powQuotSuccInclusion f p P i)

full_name: Ideal.quotientToQuotientRangePowQuotSucc_mk
code: theorem quotientToQuotientRangePowQuotSucc_mk {i : ℕ} {a : S} (a_mem : a ∈ P ^ i) (x : S) :
    quotientToQuotientRangePowQuotSucc f p P a_mem (Submodule.Quotient.mk x) =
      Submodule.Quotient.mk ⟨_, Ideal.mem_map_of_mem _ (Ideal.mul_mem_right x _ a_mem)⟩ 
goal: (Ideal.quotientToQuotientRangePowQuotSucc f p P a_mem) (Submodule.Quotient.mk x) =
  Submodule.Quotient.mk ⟨(Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (a * x), ⋯⟩

full_name: Ideal.quotientToQuotientRangePowQuotSucc_injective
code: theorem quotientToQuotientRangePowQuotSucc_injective [IsDedekindDomain S] [P.IsPrime]
    {i : ℕ} (hi : i < e) {a : S} (a_mem : a ∈ P ^ i) (a_not_mem : a ∉ P ^ (i + 1)) :
    Function.Injective (quotientToQuotientRangePowQuotSucc f p P a_mem) 
goal: Function.Injective ⇑(Ideal.quotientToQuotientRangePowQuotSucc f p P a_mem)

full_name: Ideal.quotientToQuotientRangePowQuotSucc_surjective
code: theorem quotientToQuotientRangePowQuotSucc_surjective [IsDedekindDomain S]
    (hP0 : P ≠ ⊥) [hP : P.IsPrime] {i : ℕ} (hi : i < e) {a : S} (a_mem : a ∈ P ^ i)
    (a_not_mem : a ∉ P ^ (i + 1)) :
    Function.Surjective (quotientToQuotientRangePowQuotSucc f p P a_mem) 
goal: Function.Surjective ⇑(Ideal.quotientToQuotientRangePowQuotSucc f p P a_mem)

full_name: Ideal.quotientRangePowQuotSuccInclusionEquiv
code: /-- Quotienting `P^i / P^e` by its subspace `P^(i+1) ⧸ P^e` is
`R ⧸ p`-linearly isomorphic to `S ⧸ P`. -/
noncomputable def quotientRangePowQuotSuccInclusionEquiv [IsDedekindDomain S]
    [P.IsPrime] (hP : P ≠ ⊥) {i : ℕ} (hi : i < e) :
    ((P ^ i).map (Ideal.Quotient.mk (P ^ e)) ⧸ LinearMap.range (powQuotSuccInclusion f p P i))
      ≃ₗ[R ⧸ p] S ⧸ P 
goal: (↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) ⧸
    LinearMap.range (Ideal.powQuotSuccInclusion f p P i)) ≃ₗ[R ⧸ p]
  S ⧸ P

full_name: Ideal.rank_pow_quot_aux
code: /-- Since the inclusion `(P^(i + 1) / P^e) ⊂ (P^i / P^e)` has a kernel isomorphic to `P / S`,
`[P^i / P^e : R / p] = [P^(i+1) / P^e : R / p] + [P / S : R / p]` -/
theorem rank_pow_quot_aux [IsDedekindDomain S] [p.IsMaximal] [P.IsPrime] (hP0 : P ≠ ⊥)
    {i : ℕ} (hi : i < e) :
    Module.rank (R ⧸ p) (Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i)) =
      Module.rank (R ⧸ p) (S ⧸ P) +
        Module.rank (R ⧸ p) (Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ (i + 1))) 
goal: Module.rank (R ⧸ p) ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) =
  Module.rank (R ⧸ p) (S ⧸ P) +
    Module.rank (R ⧸ p) ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ (i + 1)))

full_name: Ideal.rank_pow_quot
code: theorem rank_pow_quot [IsDedekindDomain S] [p.IsMaximal] [P.IsPrime] (hP0 : P ≠ ⊥)
    (i : ℕ) (hi : i ≤ e) :
    Module.rank (R ⧸ p) (Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i)) =
      (e - i) • Module.rank (R ⧸ p) (S ⧸ P) 
goal: Module.rank (R ⧸ p) ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) =
  (Ideal.ramificationIdx f p P - i) • Module.rank (R ⧸ p) (S ⧸ P)

full_name: Ideal.rank_prime_pow_ramificationIdx
code: /-- If `p` is a maximal ideal of `R`, `S` extends `R` and `P^e` lies over `p`,
then the dimension `[S/(P^e) : R/p]` is equal to `e * [S/P : R/p]`. -/
theorem rank_prime_pow_ramificationIdx [IsDedekindDomain S] [p.IsMaximal] [P.IsPrime]
    (hP0 : P ≠ ⊥) (he : e ≠ 0) :
    Module.rank (R ⧸ p) (S ⧸ P ^ e) =
      e •
        @Module.rank (R ⧸ p) (S ⧸ P) _ _
          (@Algebra.toModule _ _ _ _ <|
            @Quotient.algebraQuotientOfRamificationIdxNeZero _ _ _ _ _ _ _ ⟨he⟩) 
goal: Module.rank (R ⧸ p) (S ⧸ P ^ Ideal.ramificationIdx f p P) = Ideal.ramificationIdx f p P • Module.rank (R ⧸ p) (S ⧸ P)

full_name: Ideal.finrank_prime_pow_ramificationIdx
code: /-- If `p` is a maximal ideal of `R`, `S` extends `R` and `P^e` lies over `p`,
then the dimension `[S/(P^e) : R/p]`, as a natural number, is equal to `e * [S/P : R/p]`. -/
theorem finrank_prime_pow_ramificationIdx [IsDedekindDomain S] (hP0 : P ≠ ⊥)
    [p.IsMaximal] [P.IsPrime] (he : e ≠ 0) :
    finrank (R ⧸ p) (S ⧸ P ^ e) =
      e *
        @finrank (R ⧸ p) (S ⧸ P) _ _
          (@Algebra.toModule _ _ _ _ <|
            @Quotient.algebraQuotientOfRamificationIdxNeZero _ _ _ _ _ _ _ ⟨he⟩) 
goal: FiniteDimensional.finrank (R ⧸ p) (S ⧸ P ^ Ideal.ramificationIdx f p P) =
  Ideal.ramificationIdx f p P * FiniteDimensional.finrank (R ⧸ p) (S ⧸ P)

full_name: Ideal.Factors.ne_bot
code: theorem Factors.ne_bot (P : (factors (map (algebraMap R S) p)).toFinset) : (P : Ideal S) ≠ ⊥ 
goal: ↑P ≠ ⊥

full_name: Ideal.Factors.isPrime
code: instance Factors.isPrime (P : (factors (map (algebraMap R S) p)).toFinset) :
    IsPrime (P : Ideal S) 
goal: (↑P).IsPrime

full_name: Ideal.Factors.ramificationIdx_ne_zero
code: theorem Factors.ramificationIdx_ne_zero (P : (factors (map (algebraMap R S) p)).toFinset) :
    ramificationIdx (algebraMap R S) p P ≠ 0 
goal: Ideal.ramificationIdx (algebraMap R S) p ↑P ≠ 0

full_name: Ideal.Factors.fact_ramificationIdx_neZero
code: instance Factors.fact_ramificationIdx_neZero (P : (factors (map (algebraMap R S) p)).toFinset) :
    NeZero (ramificationIdx (algebraMap R S) p P) 
goal: NeZero (Ideal.ramificationIdx (algebraMap R S) p ↑P)

full_name: Ideal.Factors.isScalarTower
code: instance Factors.isScalarTower (P : (factors (map (algebraMap R S) p)).toFinset) :
    IsScalarTower R (R ⧸ p) (S ⧸ (P : Ideal S)) 
goal: IsScalarTower R (R ⧸ p) (S ⧸ ↑P)

full_name: Ideal.Factors.finrank_pow_ramificationIdx
code: theorem Factors.finrank_pow_ramificationIdx [p.IsMaximal]
    (P : (factors (map (algebraMap R S) p)).toFinset) :
    finrank (R ⧸ p) (S ⧸ (P : Ideal S) ^ ramificationIdx (algebraMap R S) p P) =
      ramificationIdx (algebraMap R S) p P * inertiaDeg (algebraMap R S) p P 
goal: FiniteDimensional.finrank (R ⧸ p) (S ⧸ ↑P ^ Ideal.ramificationIdx (algebraMap R S) p ↑P) =
  Ideal.ramificationIdx (algebraMap R S) p ↑P * Ideal.inertiaDeg (algebraMap R S) p ↑P

full_name: Ideal.Factors.finiteDimensional_quotient
code: instance Factors.finiteDimensional_quotient [IsNoetherian R S] [p.IsMaximal]
    (P : (factors (map (algebraMap R S) p)).toFinset) :
    FiniteDimensional (R ⧸ p) (S ⧸ (P : Ideal S)) 
goal: FiniteDimensional (R ⧸ p) (S ⧸ ↑P)

full_name: Ideal.Factors.inertiaDeg_ne_zero
code: theorem Factors.inertiaDeg_ne_zero [IsNoetherian R S] [p.IsMaximal]
    (P : (factors (map (algebraMap R S) p)).toFinset) : inertiaDeg (algebraMap R S) p P ≠ 0 
goal: Ideal.inertiaDeg (algebraMap R S) p ↑P ≠ 0

full_name: Ideal.Factors.finiteDimensional_quotient_pow
code: instance Factors.finiteDimensional_quotient_pow [IsNoetherian R S] [p.IsMaximal]
    (P : (factors (map (algebraMap R S) p)).toFinset) :
    FiniteDimensional (R ⧸ p) (S ⧸ (P : Ideal S) ^ ramificationIdx (algebraMap R S) p P) 
goal: FiniteDimensional (R ⧸ p) (S ⧸ ↑P ^ Ideal.ramificationIdx (algebraMap R S) p ↑P)

full_name: Ideal.Factors.piQuotientEquiv
code: /-- **Chinese remainder theorem** for a ring of integers: if the prime ideal `p : Ideal R`
factors in `S` as `∏ i, P i ^ e i`, then `S ⧸ I` factors as `Π i, R ⧸ (P i ^ e i)`. -/
noncomputable def Factors.piQuotientEquiv (p : Ideal R) (hp : map (algebraMap R S) p ≠ ⊥) :
    S ⧸ map (algebraMap R S) p ≃+*
      ∀ P : (factors (map (algebraMap R S) p)).toFinset,
        S ⧸ (P : Ideal S) ^ ramificationIdx (algebraMap R S) p P 
goal: S ⧸ Ideal.map (algebraMap R S) p ≃+*
  ((P : { x // x ∈ (UniqueFactorizationMonoid.factors (Ideal.map (algebraMap R S) p)).toFinset }) →
    S ⧸ ↑P ^ Ideal.ramificationIdx (algebraMap R S) p ↑P)

full_name: Ideal.Factors.piQuotientEquiv_mk
code: @[simp]
theorem Factors.piQuotientEquiv_mk (p : Ideal R) (hp : map (algebraMap R S) p ≠ ⊥) (x : S) :
    Factors.piQuotientEquiv p hp (Ideal.Quotient.mk _ x) = fun _ => Ideal.Quotient.mk _ x 
goal: (Ideal.Factors.piQuotientEquiv p hp) ((Ideal.Quotient.mk (Ideal.map (algebraMap R S) p)) x) = fun x_1 =>
  (Ideal.Quotient.mk (↑x_1 ^ Ideal.ramificationIdx (algebraMap R S) p ↑x_1)) x

full_name: Ideal.Factors.piQuotientEquiv_map
code: @[simp]
theorem Factors.piQuotientEquiv_map (p : Ideal R) (hp : map (algebraMap R S) p ≠ ⊥) (x : R) :
    Factors.piQuotientEquiv p hp (algebraMap _ _ x) = fun _ =>
      Ideal.Quotient.mk _ (algebraMap _ _ x) 
goal: (Ideal.Factors.piQuotientEquiv p hp) ((algebraMap R (S ⧸ Ideal.map (algebraMap R S) p)) x) = fun x_1 =>
  (Ideal.Quotient.mk (↑x_1 ^ Ideal.ramificationIdx (algebraMap R S) p ↑x_1)) ((algebraMap R S) x)

full_name: Ideal.Factors.piQuotientLinearEquiv
code: /-- **Chinese remainder theorem** for a ring of integers: if the prime ideal `p : Ideal R`
factors in `S` as `∏ i, P i ^ e i`,
then `S ⧸ I` factors `R ⧸ I`-linearly as `Π i, R ⧸ (P i ^ e i)`. -/
noncomputable def Factors.piQuotientLinearEquiv (p : Ideal R) (hp : map (algebraMap R S) p ≠ ⊥) :
    (S ⧸ map (algebraMap R S) p) ≃ₗ[R ⧸ p]
      ∀ P : (factors (map (algebraMap R S) p)).toFinset,
        S ⧸ (P : Ideal S) ^ ramificationIdx (algebraMap R S) p P 
goal: (S ⧸ Ideal.map (algebraMap R S) p) ≃ₗ[R ⧸ p]
  (P : { x // x ∈ (UniqueFactorizationMonoid.factors (Ideal.map (algebraMap R S) p)).toFinset }) →
    S ⧸ ↑P ^ Ideal.ramificationIdx (algebraMap R S) p ↑P

full_name: Ideal.sum_ramification_inertia
code: /-- The **fundamental identity** of ramification index `e` and inertia degree `f`:
for `P` ranging over the primes lying over `p`, `∑ P, e P * f P = [Frac(S) : Frac(R)]`;
here `S` is a finite `R`-module (and thus `Frac(S) : Frac(R)` is a finite extension) and `p`
is maximal.
-/
theorem sum_ramification_inertia (K L : Type*) [Field K] [Field L] [IsDedekindDomain R]
    [Algebra R K] [IsFractionRing R K] [Algebra S L] [IsFractionRing S L] [Algebra K L]
    [Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [IsNoetherian R S]
    [IsIntegralClosure S R L] [p.IsMaximal] (hp0 : p ≠ ⊥) :
    (∑ P ∈ (factors (map (algebraMap R S) p)).toFinset,
        ramificationIdx (algebraMap R S) p P * inertiaDeg (algebraMap R S) p P) =
      finrank K L 
goal: ∑ P ∈ (UniqueFactorizationMonoid.factors (Ideal.map (algebraMap R S) p)).toFinset,
    Ideal.ramificationIdx (algebraMap R S) p P * Ideal.inertiaDeg (algebraMap R S) p P =
  FiniteDimensional.finrank K L