File: Mathlib/RingTheory/Ideal/Norm.lean

full_name: Submodule.cardQuot
code: /-- The cardinality of `(M ⧸ S)`, if `(M ⧸ S)` is finite, and `0` otherwise.
This is used to define the absolute ideal norm `Ideal.absNorm`.
-/
noncomputable def cardQuot (S : Submodule R M) : ℕ 
goal: ℕ

full_name: Submodule.cardQuot_apply
code: theorem cardQuot_apply (S : Submodule R M) : cardQuot S = Nat.card (M ⧸ S) 
goal: S.cardQuot = Nat.card (M ⧸ S)

full_name: Submodule.cardQuot_bot
code: @[simp]
theorem cardQuot_bot [Infinite M] : cardQuot (⊥ : Submodule R M) = 0 
goal: ⊥.cardQuot = 0

full_name: Submodule.cardQuot_top
code: @[simp]
theorem cardQuot_top : cardQuot (⊤ : Submodule R M) = 1 
goal: ⊤.cardQuot = 1

full_name: Submodule.cardQuot_eq_one_iff
code: @[simp]
theorem cardQuot_eq_one_iff {P : Submodule R M} : cardQuot P = 1 ↔ P = ⊤ 
goal: P.cardQuot = 1 ↔ P = ⊤

full_name: cardQuot_mul_of_coprime
code: /-- Multiplicity of the ideal norm, for coprime ideals.
This is essentially just a repackaging of the Chinese Remainder Theorem.
-/
theorem cardQuot_mul_of_coprime
    {I J : Ideal S} (coprime : IsCoprime I J) : cardQuot (I * J) = cardQuot I * cardQuot J 
goal: Submodule.cardQuot (I * J) = Submodule.cardQuot I * Submodule.cardQuot J

full_name: Ideal.mul_add_mem_pow_succ_inj
code: /-- If the `d` from `Ideal.exists_mul_add_mem_pow_succ` is unique, up to `P`,
then so are the `c`s, up to `P ^ (i + 1)`.
Inspired by [Neukirch], proposition 6.1 -/
theorem Ideal.mul_add_mem_pow_succ_inj (P : Ideal S) {i : ℕ} (a d d' e e' : S) (a_mem : a ∈ P ^ i)
    (e_mem : e ∈ P ^ (i + 1)) (e'_mem : e' ∈ P ^ (i + 1)) (h : d - d' ∈ P) :
    a * d + e - (a * d' + e') ∈ P ^ (i + 1) 
goal: a * d + e - (a * d' + e') ∈ P ^ (i + 1)

full_name: Ideal.exists_mul_add_mem_pow_succ
code: /-- If `a ∈ P^i \ P^(i+1)` and `c ∈ P^i`, then `a * d + e = c` for `e ∈ P^(i+1)`.
`Ideal.mul_add_mem_pow_succ_unique` shows the choice of `d` is unique, up to `P`.
Inspired by [Neukirch], proposition 6.1 -/
theorem Ideal.exists_mul_add_mem_pow_succ [IsDedekindDomain S] {i : ℕ} (a c : S) (a_mem : a ∈ P ^ i)
    (a_not_mem : a ∉ P ^ (i + 1)) (c_mem : c ∈ P ^ i) :
    ∃ d : S, ∃ e ∈ P ^ (i + 1), a * d + e = c 
goal: ∃ d, ∃ e ∈ P ^ (i + 1), a * d + e = c

full_name: Ideal.mem_prime_of_mul_mem_pow
code: theorem Ideal.mem_prime_of_mul_mem_pow [IsDedekindDomain S] {P : Ideal S} [P_prime : P.IsPrime]
    (hP : P ≠ ⊥) {i : ℕ} {a b : S} (a_not_mem : a ∉ P ^ (i + 1)) (ab_mem : a * b ∈ P ^ (i + 1)) :
    b ∈ P 
goal: b ∈ P

full_name: Ideal.mul_add_mem_pow_succ_unique
code: /-- The choice of `d` in `Ideal.exists_mul_add_mem_pow_succ` is unique, up to `P`.
Inspired by [Neukirch], proposition 6.1 -/
theorem Ideal.mul_add_mem_pow_succ_unique [IsDedekindDomain S] {i : ℕ} (a d d' e e' : S)
    (a_not_mem : a ∉ P ^ (i + 1)) (e_mem : e ∈ P ^ (i + 1)) (e'_mem : e' ∈ P ^ (i + 1))
    (h : a * d + e - (a * d' + e') ∈ P ^ (i + 1)) : d - d' ∈ P 
goal: d - d' ∈ P

full_name: cardQuot_pow_of_prime
code: /-- Multiplicity of the ideal norm, for powers of prime ideals. -/
theorem cardQuot_pow_of_prime [IsDedekindDomain S] {i : ℕ} :
    cardQuot (P ^ i) = cardQuot P ^ i 
goal: Submodule.cardQuot (P ^ i) = Submodule.cardQuot P ^ i

full_name: cardQuot_mul
code: /-- Multiplicativity of the ideal norm in number rings. -/
theorem cardQuot_mul [IsDedekindDomain S] [Module.Free ℤ S] (I J : Ideal S) :
    cardQuot (I * J) = cardQuot I * cardQuot J 
goal: Submodule.cardQuot (I * J) = Submodule.cardQuot I * Submodule.cardQuot J

full_name: Ideal.absNorm
code: /-- The absolute norm of the ideal `I : Ideal R` is the cardinality of the quotient `R ⧸ I`. -/
noncomputable def Ideal.absNorm [Nontrivial S] [IsDedekindDomain S] [Module.Free ℤ S] :
    Ideal S →*₀ ℕ 
goal: Ideal S →*₀ ℕ

full_name: Ideal.absNorm_apply
code: theorem absNorm_apply (I : Ideal S) : absNorm I = cardQuot I 
goal: Ideal.absNorm I = Submodule.cardQuot I

full_name: Ideal.absNorm_bot
code: @[simp]
theorem absNorm_bot : absNorm (⊥ : Ideal S) = 0 
goal: Ideal.absNorm ⊥ = 0

full_name: Ideal.absNorm_top
code: @[simp]
theorem absNorm_top : absNorm (⊤ : Ideal S) = 1 
goal: Ideal.absNorm ⊤ = 1

full_name: Ideal.absNorm_eq_one_iff
code: @[simp]
theorem absNorm_eq_one_iff {I : Ideal S} : absNorm I = 1 ↔ I = ⊤ 
goal: Ideal.absNorm I = 1 ↔ I = ⊤

full_name: Ideal.absNorm_ne_zero_iff
code: theorem absNorm_ne_zero_iff (I : Ideal S) : Ideal.absNorm I ≠ 0 ↔ Finite (S ⧸ I) 
goal: Ideal.absNorm I ≠ 0 ↔ Finite (S ⧸ I)

full_name: Ideal.natAbs_det_equiv
code: /-- Let `e : S ≃ I` be an additive isomorphism (therefore a `ℤ`-linear equiv).
Then an alternative way to compute the norm of `I` is given by taking the determinant of `e`.
See `natAbs_det_basis_change` for a more familiar formulation of this result. -/
theorem natAbs_det_equiv (I : Ideal S) {E : Type*} [EquivLike E S I] [AddEquivClass E S I] (e : E) :
    Int.natAbs
        (LinearMap.det
          ((Submodule.subtype I).restrictScalars ℤ ∘ₗ AddMonoidHom.toIntLinearMap (e : S →+ I))) =
      Ideal.absNorm I 
goal: (LinearMap.det (↑ℤ (Submodule.subtype I) ∘ₗ (↑e).toIntLinearMap)).natAbs = Ideal.absNorm I

full_name: Ideal.natAbs_det_basis_change
code: /-- Let `b` be a basis for `S` over `ℤ` and `bI` a basis for `I` over `ℤ` of the same dimension.
Then an alternative way to compute the norm of `I` is given by taking the determinant of `bI`
over `b`. -/
theorem natAbs_det_basis_change {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι ℤ S)
    (I : Ideal S) (bI : Basis ι ℤ I) : (b.det ((↑) ∘ bI)).natAbs = Ideal.absNorm I 
goal: (b.det (Subtype.val ∘ ⇑bI)).natAbs = Ideal.absNorm I

full_name: Ideal.absNorm_span_singleton
code: @[simp]
theorem absNorm_span_singleton (r : S) :
    absNorm (span ({r} : Set S)) = (Algebra.norm ℤ r).natAbs 
goal: Ideal.absNorm (Ideal.span {r}) = ((Algebra.norm ℤ) r).natAbs

full_name: Ideal.absNorm_dvd_absNorm_of_le
code: theorem absNorm_dvd_absNorm_of_le {I J : Ideal S} (h : J ≤ I) : Ideal.absNorm I ∣ Ideal.absNorm J 
goal: Ideal.absNorm I ∣ Ideal.absNorm J

full_name: Ideal.absNorm_dvd_norm_of_mem
code: theorem absNorm_dvd_norm_of_mem {I : Ideal S} {x : S} (h : x ∈ I) :
    ↑(Ideal.absNorm I) ∣ Algebra.norm ℤ x 
goal: ↑(Ideal.absNorm I) ∣ (Algebra.norm ℤ) x

full_name: Ideal.absNorm_span_insert
code: @[simp]
theorem absNorm_span_insert (r : S) (s : Set S) :
    absNorm (span (insert r s)) ∣ gcd (absNorm (span s)) (Algebra.norm ℤ r).natAbs 
goal: Ideal.absNorm (Ideal.span (insert r s)) ∣ gcd (Ideal.absNorm (Ideal.span s)) ((Algebra.norm ℤ) r).natAbs

full_name: Ideal.absNorm_eq_zero_iff
code: theorem absNorm_eq_zero_iff {I : Ideal S} : Ideal.absNorm I = 0 ↔ I = ⊥ 
goal: Ideal.absNorm I = 0 ↔ I = ⊥

full_name: Ideal.absNorm_ne_zero_of_nonZeroDivisors
code: theorem absNorm_ne_zero_of_nonZeroDivisors (I : (Ideal S)⁰) : Ideal.absNorm (I : Ideal S) ≠ 0 
goal: Ideal.absNorm ↑I ≠ 0

full_name: Ideal.irreducible_of_irreducible_absNorm
code: theorem irreducible_of_irreducible_absNorm {I : Ideal S} (hI : Irreducible (Ideal.absNorm I)) :
    Irreducible I 
goal: Irreducible I

full_name: Ideal.isPrime_of_irreducible_absNorm
code: theorem isPrime_of_irreducible_absNorm {I : Ideal S} (hI : Irreducible (Ideal.absNorm I)) :
    I.IsPrime 
goal: I.IsPrime

full_name: Ideal.prime_of_irreducible_absNorm_span
code: theorem prime_of_irreducible_absNorm_span {a : S} (ha : a ≠ 0)
    (hI : Irreducible (Ideal.absNorm (Ideal.span ({a} : Set S)))) : Prime a 
goal: Prime a

full_name: Ideal.absNorm_mem
code: theorem absNorm_mem (I : Ideal S) : ↑(Ideal.absNorm I) ∈ I 
goal: ↑(Ideal.absNorm I) ∈ I

full_name: Ideal.span_singleton_absNorm_le
code: theorem span_singleton_absNorm_le (I : Ideal S) : Ideal.span {(Ideal.absNorm I : S)} ≤ I 
goal: Ideal.span {↑(Ideal.absNorm I)} ≤ I

full_name: Ideal.span_singleton_absNorm
code: theorem span_singleton_absNorm {I : Ideal S} (hI : (Ideal.absNorm I).Prime) :
    Ideal.span (singleton (Ideal.absNorm I : ℤ)) = I.comap (algebraMap ℤ S) 
goal: Ideal.span {↑(Ideal.absNorm I)} = Ideal.comap (algebraMap ℤ S) I

full_name: Ideal.finite_setOf_absNorm_eq
code: theorem finite_setOf_absNorm_eq [CharZero S] {n : ℕ} (hn : 0 < n) :
    {I : Ideal S | Ideal.absNorm I = n}.Finite 
goal: {I | Ideal.absNorm I = n}.Finite

full_name: Ideal.norm_dvd_iff
code: theorem norm_dvd_iff {x : S} (hx : Prime (Algebra.norm ℤ x)) {y : ℤ} :
    Algebra.norm ℤ x ∣ y ↔ x ∣ y 
goal: (Algebra.norm ℤ) x ∣ y ↔ x ∣ ↑y

full_name: Ideal.spanNorm
code: /-- `Ideal.spanNorm R (I : Ideal S)` is the ideal generated by mapping `Algebra.norm R` over `I`.

See also `Ideal.relNorm`.
-/
def spanNorm (I : Ideal S) : Ideal R 
goal: Ideal R

full_name: Ideal.spanNorm_bot
code: @[simp]
theorem spanNorm_bot [Nontrivial S] [Module.Free R S] [Module.Finite R S] :
    spanNorm R (⊥ : Ideal S) = ⊥ 
goal: Ideal.spanNorm R ⊥ = ⊥

full_name: Ideal.spanNorm_eq_bot_iff
code: @[simp]
theorem spanNorm_eq_bot_iff [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S]
    {I : Ideal S} : spanNorm R I = ⊥ ↔ I = ⊥ 
goal: Ideal.spanNorm R I = ⊥ ↔ I = ⊥

full_name: Ideal.norm_mem_spanNorm
code: theorem norm_mem_spanNorm {I : Ideal S} (x : S) (hx : x ∈ I) : Algebra.norm R x ∈ I.spanNorm R 
goal: (Algebra.norm R) x ∈ Ideal.spanNorm R I

full_name: Ideal.spanNorm_singleton
code: @[simp]
theorem spanNorm_singleton {r : S} : spanNorm R (span ({r} : Set S)) = span {Algebra.norm R r} 
goal: Ideal.spanNorm R (Ideal.span {r}) = Ideal.span {(Algebra.norm R) r}

full_name: Ideal.spanNorm_top
code: @[simp]
theorem spanNorm_top : spanNorm R (⊤ : Ideal S) = ⊤ 
goal: Ideal.spanNorm R ⊤ = ⊤

full_name: Ideal.map_spanNorm
code: theorem map_spanNorm (I : Ideal S) {T : Type*} [CommRing T] (f : R →+* T) :
    map f (spanNorm R I) = span (f ∘ Algebra.norm R '' (I : Set S)) 
goal: Ideal.map f (Ideal.spanNorm R I) = Ideal.span (⇑f ∘ ⇑(Algebra.norm R) '' ↑I)

full_name: Ideal.spanNorm_mono
code: @[mono]
theorem spanNorm_mono {I J : Ideal S} (h : I ≤ J) : spanNorm R I ≤ spanNorm R J 
goal: Ideal.spanNorm R I ≤ Ideal.spanNorm R J

full_name: Ideal.spanNorm_localization
code: theorem spanNorm_localization (I : Ideal S) [Module.Finite R S] [Module.Free R S] (M : Submonoid R)
    {Rₘ : Type*} (Sₘ : Type*) [CommRing Rₘ] [Algebra R Rₘ] [CommRing Sₘ] [Algebra S Sₘ]
    [Algebra Rₘ Sₘ] [Algebra R Sₘ] [IsScalarTower R Rₘ Sₘ] [IsScalarTower R S Sₘ]
    [IsLocalization M Rₘ] [IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ] :
    spanNorm Rₘ (I.map (algebraMap S Sₘ)) = (spanNorm R I).map (algebraMap R Rₘ) 
goal: Ideal.spanNorm Rₘ (Ideal.map (algebraMap S Sₘ) I) = Ideal.map (algebraMap R Rₘ) (Ideal.spanNorm R I)

full_name: Ideal.spanNorm_mul_spanNorm_le
code: theorem spanNorm_mul_spanNorm_le (I J : Ideal S) :
    spanNorm R I * spanNorm R J ≤ spanNorm R (I * J) 
goal: Ideal.spanNorm R I * Ideal.spanNorm R J ≤ Ideal.spanNorm R (I * J)

full_name: Ideal.spanNorm_mul_of_bot_or_top
code: /-- This condition `eq_bot_or_top` is equivalent to being a field.
However, `Ideal.spanNorm_mul_of_field` is harder to apply since we'd need to upgrade a `CommRing R`
instance to a `Field R` instance. -/
theorem spanNorm_mul_of_bot_or_top [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Finite R S]
    (eq_bot_or_top : ∀ I : Ideal R, I = ⊥ ∨ I = ⊤) (I J : Ideal S) :
    spanNorm R (I * J) = spanNorm R I * spanNorm R J 
goal: Ideal.spanNorm R (I * J) = Ideal.spanNorm R I * Ideal.spanNorm R J

full_name: Ideal.spanNorm_mul_of_field
code: @[simp]
theorem spanNorm_mul_of_field {K : Type*} [Field K] [Algebra K S] [IsDomain S] [Module.Finite K S]
    (I J : Ideal S) : spanNorm K (I * J) = spanNorm K I * spanNorm K J 
goal: Ideal.spanNorm K (I * J) = Ideal.spanNorm K I * Ideal.spanNorm K J

full_name: Ideal.spanNorm_mul
code: /-- Multiplicativity of `Ideal.spanNorm`. simp-normal form is `map_mul (Ideal.relNorm R)`. -/
theorem spanNorm_mul (I J : Ideal S) : spanNorm R (I * J) = spanNorm R I * spanNorm R J 
goal: Ideal.spanNorm R (I * J) = Ideal.spanNorm R I * Ideal.spanNorm R J

full_name: Ideal.relNorm
code: /-- The relative norm `Ideal.relNorm R (I : Ideal S)`, where `R` and `S` are Dedekind domains,
and `S` is an extension of `R` that is finite and free as a module. -/
def relNorm : Ideal S →*₀ Ideal R 
goal: Ideal S →*₀ Ideal R

full_name: Ideal.relNorm_apply
code: theorem relNorm_apply (I : Ideal S) : relNorm R I = span (Algebra.norm R '' (I : Set S) : Set R) 
goal: (Ideal.relNorm R) I = Ideal.span (⇑(Algebra.norm R) '' ↑I)

full_name: Ideal.spanNorm_eq
code: @[simp]
theorem spanNorm_eq (I : Ideal S) : spanNorm R I = relNorm R I 
goal: Ideal.spanNorm R I = (Ideal.relNorm R) I

full_name: Ideal.relNorm_bot
code: @[simp]
theorem relNorm_bot : relNorm R (⊥ : Ideal S) = ⊥ 
goal: (Ideal.relNorm R) ⊥ = ⊥

full_name: Ideal.relNorm_top
code: @[simp]
theorem relNorm_top : relNorm R (⊤ : Ideal S) = ⊤ 
goal: (Ideal.relNorm R) ⊤ = ⊤

full_name: Ideal.relNorm_eq_bot_iff
code: @[simp]
theorem relNorm_eq_bot_iff {I : Ideal S} : relNorm R I = ⊥ ↔ I = ⊥ 
goal: (Ideal.relNorm R) I = ⊥ ↔ I = ⊥

full_name: Ideal.norm_mem_relNorm
code: theorem norm_mem_relNorm (I : Ideal S) {x : S} (hx : x ∈ I) : Algebra.norm R x ∈ relNorm R I 
goal: (Algebra.norm R) x ∈ (Ideal.relNorm R) I

full_name: Ideal.relNorm_singleton
code: @[simp]
theorem relNorm_singleton (r : S) : relNorm R (span ({r} : Set S)) = span {Algebra.norm R r} 
goal: (Ideal.relNorm R) (Ideal.span {r}) = Ideal.span {(Algebra.norm R) r}

full_name: Ideal.map_relNorm
code: theorem map_relNorm (I : Ideal S) {T : Type*} [CommRing T] (f : R →+* T) :
    map f (relNorm R I) = span (f ∘ Algebra.norm R '' (I : Set S)) 
goal: Ideal.map f ((Ideal.relNorm R) I) = Ideal.span (⇑f ∘ ⇑(Algebra.norm R) '' ↑I)

full_name: Ideal.relNorm_mono
code: @[mono]
theorem relNorm_mono {I J : Ideal S} (h : I ≤ J) : relNorm R I ≤ relNorm R J 
goal: (Ideal.relNorm R) I ≤ (Ideal.relNorm R) J