Skip to content

Commit

Permalink
feat: Add Module.Free and Module.Finite instances for ideals (#9804)
Browse files Browse the repository at this point in the history
Add also a `NoZeroSMulDivisors` instance.

These instances, in particular, imply directly that integral ideals of number fields are free and finite $\mathbb{Z}$-modules.
  • Loading branch information
xroblot committed Jan 17, 2024
1 parent 5115198 commit ca796bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Mathlib/LinearAlgebra/FreeModule/PID.lean
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen
-/
import Mathlib.LinearAlgebra.Dimension.StrongRankCondition
import Mathlib.LinearAlgebra.FreeModule.Basic
import Mathlib.LinearAlgebra.FreeModule.Finite.Basic

#align_import linear_algebra.free_module.pid from "leanprover-community/mathlib"@"d87199d51218d36a0a42c66c82d147b5a7ff87b3"

Expand Down Expand Up @@ -413,6 +413,13 @@ instance Module.free_of_finite_type_torsion_free' [Module.Finite R M] [NoZeroSMu
exact Module.Free.of_basis b
#align module.free_of_finite_type_torsion_free' Module.free_of_finite_type_torsion_free'

instance {S : Type*} [CommRing S] [Algebra R S] {I : Ideal S} [hI₁ : Module.Finite R I]
[hI₂ : NoZeroSMulDivisors R I] : Module.Free R I := by
have : Module.Finite R (restrictScalars R I) := hI₁
have : NoZeroSMulDivisors R (restrictScalars R I) := hI₂
change Module.Free R (restrictScalars R I)
exact Module.free_of_finite_type_torsion_free'

theorem Module.free_iff_noZeroSMulDivisors [Module.Finite R M] :
Module.Free R M ↔ NoZeroSMulDivisors R M :=
fun _ ↦ inferInstance, fun _ ↦ inferInstance⟩
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/RingTheory/Ideal/Operations.lean
Expand Up @@ -829,6 +829,10 @@ theorem mul_eq_bot {R : Type*} [CommSemiring R] [NoZeroDivisors R] {I J : Ideal
instance {R : Type*} [CommSemiring R] [NoZeroDivisors R] : NoZeroDivisors (Ideal R) where
eq_zero_or_eq_zero_of_mul_eq_zero := mul_eq_bot.1

instance {R : Type*} [CommSemiring R] {S : Type*} [CommRing S] [Algebra R S]
[NoZeroSMulDivisors R S] {I : Ideal S} : NoZeroSMulDivisors R I :=
Submodule.noZeroSMulDivisors (Submodule.restrictScalars R I)

/-- A product of ideals in an integral domain is zero if and only if one of the terms is zero. -/
@[simp]
lemma multiset_prod_eq_bot {R : Type*} [CommRing R] [IsDomain R] {s : Multiset (Ideal R)} :
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/RingTheory/Noetherian.lean
Expand Up @@ -157,6 +157,10 @@ instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M :
⟨IsNoetherian.noetherian ⊤⟩
#align module.is_noetherian.finite Module.IsNoetherian.finite

instance {R₁ S : Type*} [CommSemiring R₁] [Semiring S] [Algebra R₁ S]
[IsNoetherian R₁ S] (I : Ideal S) : Finite R₁ I :=
IsNoetherian.finite R₁ ((I : Submodule S S).restrictScalars R₁)

variable {R M}

theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) :
Expand Down

0 comments on commit ca796bf

Please sign in to comment.