state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
case intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M n : ℕ hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m) m : ℕ hm : m ≥ n ⊢ ⨆ m, ker (f ^ m) = ker (f ^ m)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩
refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m)
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩
Mathlib.RingTheory.Noetherian.446_0.5UPGNrmhtW81IjE
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n)
Mathlib_RingTheory_Noetherian
case intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M n : ℕ hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m) m : ℕ hm : m ≥ n l : ℕ ⊢ ker (f ^ l) ≤ ker (f ^ m)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m)
rcases le_or_lt m l with h | h
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m)
Mathlib.RingTheory.Noetherian.446_0.5UPGNrmhtW81IjE
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n)
Mathlib_RingTheory_Noetherian
case intro.inl R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M n : ℕ hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m) m : ℕ hm : m ≥ n l : ℕ h : m ≤ l ⊢ ker (f ^ l) ≤ ker (f ^ m)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h ·
rw [← hn _ (hm.trans h), hn _ hm]
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h ·
Mathlib.RingTheory.Noetherian.446_0.5UPGNrmhtW81IjE
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n)
Mathlib_RingTheory_Noetherian
case intro.inr R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M n : ℕ hn : ∀ (m : ℕ), n ≤ m → ker (f ^ n) = ker (f ^ m) m : ℕ hm : m ≥ n l : ℕ h : l < m ⊢ ker (f ^ l) ≤ ker (f ^ m)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] ·
exact f.iterateKer.monotone h.le
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] ·
Mathlib.RingTheory.Noetherian.446_0.5UPGNrmhtW81IjE
lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n)
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M s : Surjective ⇑f ⊢ Injective ⇑f
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by
obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by
Mathlib.RingTheory.Noetherian.456_0.5UPGNrmhtW81IjE
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f
Mathlib_RingTheory_Noetherian
case intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M s : Surjective ⇑f n : ℕ hn : ∀ b ≥ n, Disjoint (LinearMap.ker (f ^ b)) (LinearMap.range (f ^ b)) ⊢ Injective ⇑f
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow
specialize hn (n + 1) (n.le_add_right 1)
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow
Mathlib.RingTheory.Noetherian.456_0.5UPGNrmhtW81IjE
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f
Mathlib_RingTheory_Noetherian
case intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M s : Surjective ⇑f n : ℕ hn : Disjoint (LinearMap.ker (f ^ (n + 1))) (LinearMap.range (f ^ (n + 1))) ⊢ Injective ⇑f
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1)
rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1)
Mathlib.RingTheory.Noetherian.456_0.5UPGNrmhtW81IjE
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f
Mathlib_RingTheory_Noetherian
case intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M →ₗ[R] M s : Surjective ⇑f n : ℕ hn : Injective ⇑(f ^ (n + 1)) ⊢ Injective ⇑f
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn
exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn
Mathlib.RingTheory.Noetherian.456_0.5UPGNrmhtW81IjE
/-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) ⊢ ∃ n, ∀ (m : ℕ), n ≤ m → f m = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first:
suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first:
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) t : ∃ n, ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥ ⊢ ∃ n, ∀ (m : ℕ), n ≤ m → f m = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ ·
obtain ⟨n, w⟩ := t
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ ·
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) n : ℕ w : ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥ ⊢ ∃ n, ∀ (m : ℕ), n ≤ m → f m = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t
use n + 1
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case h R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) n : ℕ w : ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥ ⊢ ∀ (m : ℕ), n + 1 ≤ m → f m = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1
rintro (_ | m) p
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case h.zero R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) n : ℕ w : ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥ p : n + 1 ≤ Nat.zero ⊢ f Nat.zero = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p ·
cases p
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p ·
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case h.succ R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) n : ℕ w : ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥ m : ℕ p : n + 1 ≤ Nat.succ m ⊢ f (Nat.succ m) = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p ·
apply w
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p ·
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case h.succ.a R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) n : ℕ w : ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥ m : ℕ p : n + 1 ≤ Nat.succ m ⊢ n ≤ m
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w
exact Nat.succ_le_succ_iff.mp p
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case t R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) ⊢ ∃ n, ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p
obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f)
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
case t.intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : ℕ → Submodule R M h : ∀ (n : ℕ), Disjoint ((partialSups f) n) (f (n + 1)) n : ℕ w : ∀ (m : ℕ), n ≤ m → (partialSups f) n = (partialSups f) m ⊢ ∃ n, ∀ (m : ℕ), n ≤ m → f (m + 1) = ⊥
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f)
exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f)
Mathlib.RingTheory.Noetherian.472_0.5UPGNrmhtW81IjE
/-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f ⊢ N ≃ₗ[R] PUnit.{w + 1}
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by
apply Nonempty.some
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
case h R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f ⊢ Nonempty (N ≃ₗ[R] PUnit.{w + 1})
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some
obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i)
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
case h.intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f n : ℕ w : ∀ (m : ℕ), n ≤ m → LinearMap.tailing f i m = ⊥ ⊢ Nonempty (N ≃ₗ[R] PUnit.{w + 1})
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i)
specialize w n (le_refl n)
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i)
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
case h.intro R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f n : ℕ w : LinearMap.tailing f i n = ⊥ ⊢ Nonempty (N ≃ₗ[R] PUnit.{w + 1})
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n)
apply Nonempty.intro
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n)
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
case h.intro.val R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f n : ℕ w : LinearMap.tailing f i n = ⊥ ⊢ N ≃ₗ[R] PUnit.{w + 1}
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator
refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
case h.intro.val R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f n : ℕ w : LinearMap.tailing f i n = ⊥ ⊢ ↥(LinearMap.tailing f i n) ≃ₗ[R] PUnit.{w + 1}
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_
rw [w]
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
case h.intro.val R : Type u_1 M : Type u_2 P : Type u_3 N : Type w inst✝⁷ : Ring R inst✝⁶ : AddCommGroup M inst✝⁵ : Module R M inst✝⁴ : AddCommGroup N inst✝³ : Module R N inst✝² : AddCommGroup P inst✝¹ : Module R P inst✝ : IsNoetherian R M f : M × N →ₗ[R] M i : Injective ⇑f n : ℕ w : LinearMap.tailing f i n = ⊥ ⊢ ↥⊥ ≃ₗ[R] PUnit.{w + 1}
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w]
apply Submodule.botEquivPUnit
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w]
Mathlib.RingTheory.Noetherian.493_0.5UPGNrmhtW81IjE
/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}
Mathlib_RingTheory_Noetherian
R : Type ?u.338259 M : Type ?u.338262 inst✝³ : Finite M inst✝² : Semiring R inst✝¹ : AddCommMonoid M inst✝ : Module R M s : Submodule R M ⊢ span R ↑(Finite.toFinset (_ : Set.Finite ↑s)) = s
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by
rw [Set.Finite.coe_toFinset, Submodule.span_eq]
instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by
Mathlib.RingTheory.Noetherian.529_0.5UPGNrmhtW81IjE
instance (priority
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Semiring R inst✝¹ : AddCommMonoid M inst✝ : Module R M N : Submodule R M h : IsNoetherian R M ⊢ IsNoetherian R ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by
rw [isNoetherian_iff_wellFounded] at h ⊢
theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by
Mathlib.RingTheory.Noetherian.542_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Semiring R inst✝¹ : AddCommMonoid M inst✝ : Module R M N : Submodule R M h : WellFounded fun x x_1 => x > x_1 ⊢ WellFounded fun x x_1 => x > x_1
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢
exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h
theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢
Mathlib.RingTheory.Noetherian.542_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type ?u.341864 inst✝² : Ring R M : Type ?u.341870 inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M h : IsNoetherian R M ⊢ IsNoetherian R (M ⧸ N)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by
rw [isNoetherian_iff_wellFounded] at h ⊢
instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by
Mathlib.RingTheory.Noetherian.548_0.5UPGNrmhtW81IjE
instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N)
Mathlib_RingTheory_Noetherian
R : Type ?u.341864 inst✝² : Ring R M : Type ?u.341870 inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M h : WellFounded fun x x_1 => x > x_1 ⊢ WellFounded fun x x_1 => x > x_1
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢
exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h
instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢
Mathlib.RingTheory.Noetherian.548_0.5UPGNrmhtW81IjE
instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N)
Mathlib_RingTheory_Noetherian
R : Type u_1 S : Type u_2 M : Type u_3 inst✝⁶ : Semiring R inst✝⁵ : Semiring S inst✝⁴ : AddCommMonoid M inst✝³ : SMul R S inst✝² : Module S M inst✝¹ : Module R M inst✝ : IsScalarTower R S M h : IsNoetherian R M ⊢ IsNoetherian S M
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by
rw [isNoetherian_iff_wellFounded] at h ⊢
/-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by
Mathlib.RingTheory.Noetherian.554_0.5UPGNrmhtW81IjE
/-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M
Mathlib_RingTheory_Noetherian
R : Type u_1 S : Type u_2 M : Type u_3 inst✝⁶ : Semiring R inst✝⁵ : Semiring S inst✝⁴ : AddCommMonoid M inst✝³ : SMul R S inst✝² : Module S M inst✝¹ : Module R M inst✝ : IsScalarTower R S M h : WellFounded fun x x_1 => x > x_1 ⊢ WellFounded fun x x_1 => x > x_1
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢
refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h
/-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢
Mathlib.RingTheory.Noetherian.554_0.5UPGNrmhtW81IjE
/-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N ⊢ IsNoetherian R ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by
let ⟨s, hs⟩ := hN
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N ⊢ IsNoetherian R ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN
haveI := Classical.decEq M
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this : DecidableEq M ⊢ IsNoetherian R ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M
haveI := Classical.decEq R
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝ : DecidableEq M this : DecidableEq R ⊢ IsNoetherian R ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R
have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ IsNoetherian R ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx
refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1 R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ (↑↑s → R) →ₗ[R] ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi ·
fapply LinearMap.mk
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi ·
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ AddHom (↑↑s → R) ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk ·
fapply AddHom.mk
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk ·
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom.toFun R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ (↑↑s → R) → ↥N
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk ·
exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk ·
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom.map_add' R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ ∀ (x y : ↑↑s → R), { val := ∑ i in Finset.attach s, (x + y) i • ↑i, property := (_ : ∑ i in Finset.attach s, (x + y) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, x i • ↑i, property := (_ : ∑ i in Finset.attach s, x i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, y i • ↑i, property := (_ : ∑ i in Finset.attach s, y i • ↑i ∈ N) }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ ·
intro f g
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ ·
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom.map_add' R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N f g : ↑↑s → R ⊢ { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g
apply Subtype.eq
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom.map_add'.a R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N f g : ↑↑s → R ⊢ ↑{ val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq
change (∑ i in s.attach, (f i + g i) • _) = _
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom.map_add'.a R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N f g : ↑↑s → R ⊢ ∑ i in Finset.attach s, (f i + g i) • ↑i = ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _
simp only [add_smul, Finset.sum_add_distrib]
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.toAddHom.map_add'.a R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N f g : ↑↑s → R ⊢ ∑ x in Finset.attach s, f x • ↑x + ∑ x in Finset.attach s, g x • ↑x = ↑({ val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) })
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib]
rfl
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib]
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.map_smul' R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ ∀ (r : R) (x : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (r • x) = (RingHom.id R) r • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } x
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl ·
intro c f
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl ·
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.map_smul' R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N c : R f : ↑↑s → R ⊢ AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f
apply Subtype.eq
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.map_smul'.a R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N c : R f : ↑↑s → R ⊢ ↑(AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f)) = ↑((RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq
change (∑ i in s.attach, (c • f i) • _) = _
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.map_smul'.a R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N c : R f : ↑↑s → R ⊢ ∑ i in Finset.attach s, (c • f i) • ↑i = ↑((RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _
simp only [smul_eq_mul, mul_smul]
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_1.map_smul'.a R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N c : R f : ↑↑s → R ⊢ ∑ x in Finset.attach s, c • f x • ↑x = ↑((RingHom.id R) c • { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) })
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul]
exact Finset.smul_sum.symm
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul]
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2 R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ LinearMap.range { toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) } = ⊤
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm ·
rw [LinearMap.range_eq_top]
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm ·
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2 R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N ⊢ Surjective ⇑{ toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top]
rintro ⟨n, hn⟩
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top]
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N ⊢ ∃ a, { toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) } a = { val := n, property := hn }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩
change n ∈ N at hn
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N ⊢ ∃ a, { toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) } a = { val := n, property := hn }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn
rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn✝ : n ∈ N hn : ∃ l ∈ Finsupp.supported R R ↑s, (Finsupp.total M M R id) l = n ⊢ ∃ a, { toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) } a = { val := n, property := hn✝ }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn
rcases hn with ⟨l, hl1, hl2⟩
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk.intro.intro R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N l : M →₀ R hl1 : l ∈ Finsupp.supported R R ↑s hl2 : (Finsupp.total M M R id) l = n ⊢ ∃ a, { toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) } a = { val := n, property := hn }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩
refine' ⟨fun x => l x, Subtype.ext _⟩
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk.intro.intro R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N l : M →₀ R hl1 : l ∈ Finsupp.supported R R ↑s hl2 : (Finsupp.total M M R id) l = n ⊢ ↑({ toAddHom := { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) }, map_smul' := (_ : ∀ (c : R) (f : ↑↑s → R), AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } (c • f) = (RingHom.id R) c • AddHom.toFun { toFun := fun f => { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) }, map_add' := (_ : ∀ (f g : ↑↑s → R), { val := ∑ i in Finset.attach s, (f + g) i • ↑i, property := (_ : ∑ i in Finset.attach s, (f + g) i • ↑i ∈ N) } = { val := ∑ i in Finset.attach s, f i • ↑i, property := (_ : ∑ i in Finset.attach s, f i • ↑i ∈ N) } + { val := ∑ i in Finset.attach s, g i • ↑i, property := (_ : ∑ i in Finset.attach s, g i • ↑i ∈ N) }) } f) } fun x => l ↑x) = ↑{ val := n, property := hn }
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩
change (∑ i in s.attach, l i • (i : M)) = n
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk.intro.intro R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N l : M →₀ R hl1 : l ∈ Finsupp.supported R R ↑s hl2 : (Finsupp.total M M R id) l = n ⊢ ∑ i in Finset.attach s, l ↑i • ↑i = n
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n
rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm]
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk.intro.intro R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N l : M →₀ R hl1 : l ∈ Finsupp.supported R R ↑s hl2 : (Finsupp.total M M R id) l = n ⊢ ∑ a in l.support, l a • id a = ∑ x in s, l x • x
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm]
refine' Finset.sum_subset hl1 fun x _ hx => _
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm]
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
case refine_2.mk.intro.intro R : Type u_1 M : Type u_2 inst✝² : Ring R inst✝¹ : AddCommGroup M inst✝ : Module R M N : Submodule R M I : IsNoetherianRing R hN : FG N s : Finset M hs : span R ↑s = N this✝¹ : DecidableEq M this✝ : DecidableEq R this : ∀ x ∈ s, x ∈ N n : M hn : n ∈ N l : M →₀ R hl1 : l ∈ Finsupp.supported R R ↑s hl2 : (Finsupp.total M M R id) l = n x : M x✝ : x ∈ s hx : x ∉ l.support ⊢ l x • id x = 0
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm] refine' Finset.sum_subset hl1 fun x _ hx => _
rw [Finsupp.not_mem_support_iff.1 hx, zero_smul]
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm] refine' Finset.sum_subset hl1 fun x _ hx => _
Mathlib.RingTheory.Noetherian.562_0.5UPGNrmhtW81IjE
theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N
Mathlib_RingTheory_Noetherian
R : Type u_1 inst✝¹ : Ring R S : Type u_2 inst✝ : Ring S f : R →+* S hf : Surjective ⇑f H : IsNoetherianRing R ⊢ IsNoetherianRing S
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm] refine' Finset.sum_subset hl1 fun x _ hx => _ rw [Finsupp.not_mem_support_iff.1 hx, zero_smul] #align is_noetherian_of_fg_of_noetherian isNoetherian_of_fg_of_noetherian instance isNoetherian_of_isNoetherianRing_of_finite (R M : Type*) [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] [Module.Finite R M] : IsNoetherian R M := have : IsNoetherian R (⊤ : Submodule R M) := isNoetherian_of_fg_of_noetherian _ $ Module.finite_def.mp inferInstance isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) #align is_noetherian_of_fg_of_noetherian' isNoetherian_of_isNoetherianRing_of_finite /-- In a module over a Noetherian ring, the submodule generated by finitely many vectors is Noetherian. -/ theorem isNoetherian_span_of_finite (R) {M} [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] {A : Set M} (hA : A.Finite) : IsNoetherian R (Submodule.span R A) := isNoetherian_of_fg_of_noetherian _ (Submodule.fg_def.mpr ⟨A, hA, rfl⟩) #align is_noetherian_span_of_finite isNoetherian_span_of_finite theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S := by
rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at H ⊢
theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S := by
Mathlib.RingTheory.Noetherian.612_0.5UPGNrmhtW81IjE
theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S
Mathlib_RingTheory_Noetherian
R : Type u_1 inst✝¹ : Ring R S : Type u_2 inst✝ : Ring S f : R →+* S hf : Surjective ⇑f H : WellFounded fun x x_1 => x > x_1 ⊢ WellFounded fun x x_1 => x > x_1
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm] refine' Finset.sum_subset hl1 fun x _ hx => _ rw [Finsupp.not_mem_support_iff.1 hx, zero_smul] #align is_noetherian_of_fg_of_noetherian isNoetherian_of_fg_of_noetherian instance isNoetherian_of_isNoetherianRing_of_finite (R M : Type*) [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] [Module.Finite R M] : IsNoetherian R M := have : IsNoetherian R (⊤ : Submodule R M) := isNoetherian_of_fg_of_noetherian _ $ Module.finite_def.mp inferInstance isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) #align is_noetherian_of_fg_of_noetherian' isNoetherian_of_isNoetherianRing_of_finite /-- In a module over a Noetherian ring, the submodule generated by finitely many vectors is Noetherian. -/ theorem isNoetherian_span_of_finite (R) {M} [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] {A : Set M} (hA : A.Finite) : IsNoetherian R (Submodule.span R A) := isNoetherian_of_fg_of_noetherian _ (Submodule.fg_def.mpr ⟨A, hA, rfl⟩) #align is_noetherian_span_of_finite isNoetherian_span_of_finite theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S := by rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at H ⊢
exact OrderEmbedding.wellFounded (Ideal.orderEmbeddingOfSurjective f hf).dual H
theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S := by rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at H ⊢
Mathlib.RingTheory.Noetherian.612_0.5UPGNrmhtW81IjE
theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S
Mathlib_RingTheory_Noetherian
R : Type u_1 inst✝¹ : CommRing R inst✝ : IsNoetherianRing R ⊢ IsNilpotent (nilradical R)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm] refine' Finset.sum_subset hl1 fun x _ hx => _ rw [Finsupp.not_mem_support_iff.1 hx, zero_smul] #align is_noetherian_of_fg_of_noetherian isNoetherian_of_fg_of_noetherian instance isNoetherian_of_isNoetherianRing_of_finite (R M : Type*) [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] [Module.Finite R M] : IsNoetherian R M := have : IsNoetherian R (⊤ : Submodule R M) := isNoetherian_of_fg_of_noetherian _ $ Module.finite_def.mp inferInstance isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) #align is_noetherian_of_fg_of_noetherian' isNoetherian_of_isNoetherianRing_of_finite /-- In a module over a Noetherian ring, the submodule generated by finitely many vectors is Noetherian. -/ theorem isNoetherian_span_of_finite (R) {M} [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] {A : Set M} (hA : A.Finite) : IsNoetherian R (Submodule.span R A) := isNoetherian_of_fg_of_noetherian _ (Submodule.fg_def.mpr ⟨A, hA, rfl⟩) #align is_noetherian_span_of_finite isNoetherian_span_of_finite theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S := by rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at H ⊢ exact OrderEmbedding.wellFounded (Ideal.orderEmbeddingOfSurjective f hf).dual H #align is_noetherian_ring_of_surjective isNoetherianRing_of_surjective instance isNoetherianRing_range {R} [Ring R] {S} [Ring S] (f : R →+* S) [IsNoetherianRing R] : IsNoetherianRing f.range := isNoetherianRing_of_surjective R f.range f.rangeRestrict f.rangeRestrict_surjective #align is_noetherian_ring_range isNoetherianRing_range theorem isNoetherianRing_of_ringEquiv (R) [Ring R] {S} [Ring S] (f : R ≃+* S) [IsNoetherianRing R] : IsNoetherianRing S := isNoetherianRing_of_surjective R S f.toRingHom f.toEquiv.surjective #align is_noetherian_ring_of_ring_equiv isNoetherianRing_of_ringEquiv theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommRing R] [IsNoetherianRing R] : IsNilpotent (nilradical R) := by
obtain ⟨n, hn⟩ := Ideal.exists_radical_pow_le_of_fg (⊥ : Ideal R) (IsNoetherian.noetherian _)
theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommRing R] [IsNoetherianRing R] : IsNilpotent (nilradical R) := by
Mathlib.RingTheory.Noetherian.628_0.5UPGNrmhtW81IjE
theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommRing R] [IsNoetherianRing R] : IsNilpotent (nilradical R)
Mathlib_RingTheory_Noetherian
case intro R : Type u_1 inst✝¹ : CommRing R inst✝ : IsNoetherianRing R n : ℕ hn : Ideal.radical ⊥ ^ n ≤ ⊥ ⊢ IsNilpotent (nilradical R)
/- Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kevin Buzzard -/ import Mathlib.Algebra.Algebra.Subalgebra.Basic import Mathlib.Algebra.Algebra.Tower import Mathlib.Algebra.Ring.Idempotents import Mathlib.GroupTheory.Finiteness import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.Order.CompactlyGenerated import Mathlib.Order.Filter.EventuallyConst import Mathlib.Order.OrderIsoNat import Mathlib.RingTheory.Finiteness import Mathlib.RingTheory.Nilpotent #align_import ring_theory.noetherian from "leanprover-community/mathlib"@"210657c4ea4a4a7b234392f70a3a2a83346dfa90" /-! # Noetherian rings and modules The following are equivalent for a module M over a ring R: 1. Every increasing chain of submodules M₁ ⊆ M₂ ⊆ M₃ ⊆ ⋯ eventually stabilises. 2. Every submodule is finitely generated. A module satisfying these equivalent conditions is said to be a *Noetherian* R-module. A ring is a *Noetherian ring* if it is Noetherian as a module over itself. (Note that we do not assume yet that our rings are commutative, so perhaps this should be called "left Noetherian". To avoid cumbersome names once we specialize to the commutative case, we don't make this explicit in the declaration names.) ## Main definitions Let `R` be a ring and let `M` and `P` be `R`-modules. Let `N` be an `R`-submodule of `M`. * `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module. It is a class, implemented as the predicate that all `R`-submodules of `M` are finitely generated. ## Main statements * `isNoetherian_iff_wellFounded` is the theorem that an R-module M is Noetherian iff `>` is well-founded on `Submodule R M`. Note that the Hilbert basis theorem, that if a commutative ring R is Noetherian then so is R[X], is proved in `RingTheory.Polynomial`. ## References * [M. F. Atiyah and I. G. Macdonald, *Introduction to commutative algebra*][atiyah-macdonald] * [samuel1967] ## Tags Noetherian, noetherian, Noetherian ring, Noetherian module, noetherian ring, noetherian module -/ open Set Filter BigOperators Pointwise /-- `IsNoetherian R M` is the proposition that `M` is a Noetherian `R`-module, implemented as the predicate that all `R`-submodules of `M` are finitely generated. -/ -- Porting note: should this be renamed to `Noetherian`? class IsNoetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] : Prop where noetherian : ∀ s : Submodule R M, s.FG #align is_noetherian IsNoetherian attribute [inherit_doc IsNoetherian] IsNoetherian.noetherian section variable {R : Type*} {M : Type*} {P : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid P] variable [Module R M] [Module R P] open IsNoetherian /-- An R-module is Noetherian iff all its submodules are finitely-generated. -/ theorem isNoetherian_def : IsNoetherian R M ↔ ∀ s : Submodule R M, s.FG := ⟨fun h => h.noetherian, IsNoetherian.mk⟩ #align is_noetherian_def isNoetherian_def theorem isNoetherian_submodule {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG := by refine ⟨fun ⟨hn⟩ => fun s hs => have : s ≤ LinearMap.range N.subtype := N.range_subtype.symm ▸ hs Submodule.map_comap_eq_self this ▸ (hn _).map _, fun h => ⟨fun s => ?_⟩⟩ have f := (Submodule.equivMapOfInjective N.subtype Subtype.val_injective s).symm have h₁ := h (s.map N.subtype) (Submodule.map_subtype_le N s) have h₂ : (⊤ : Submodule R (s.map N.subtype)).map f = ⊤ := by simp have h₃ := ((Submodule.fg_top _).2 h₁).map (↑f : _ →ₗ[R] s) exact (Submodule.fg_top _).1 (h₂ ▸ h₃) #align is_noetherian_submodule isNoetherian_submodule theorem isNoetherian_submodule_left {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (N ⊓ s).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_left, fun H _ hs => inf_of_le_right hs ▸ H _⟩ #align is_noetherian_submodule_left isNoetherian_submodule_left theorem isNoetherian_submodule_right {N : Submodule R M} : IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG := isNoetherian_submodule.trans ⟨fun H _ => H _ inf_le_right, fun H _ hs => inf_of_le_left hs ▸ H _⟩ #align is_noetherian_submodule_right isNoetherian_submodule_right instance isNoetherian_submodule' [IsNoetherian R M] (N : Submodule R M) : IsNoetherian R N := isNoetherian_submodule.2 fun _ _ => IsNoetherian.noetherian _ #align is_noetherian_submodule' isNoetherian_submodule' theorem isNoetherian_of_le {s t : Submodule R M} [ht : IsNoetherian R t] (h : s ≤ t) : IsNoetherian R s := isNoetherian_submodule.mpr fun _ hs' => isNoetherian_submodule.mp ht _ (le_trans hs' h) #align is_noetherian_of_le isNoetherian_of_le variable (M) theorem isNoetherian_of_surjective (f : M →ₗ[R] P) (hf : LinearMap.range f = ⊤) [IsNoetherian R M] : IsNoetherian R P := ⟨fun s => have : (s.comap f).map f = s := Submodule.map_comap_eq_self <| hf.symm ▸ le_top this ▸ (noetherian _).map _⟩ #align is_noetherian_of_surjective isNoetherian_of_surjective variable {M} theorem isNoetherian_of_linearEquiv (f : M ≃ₗ[R] P) [IsNoetherian R M] : IsNoetherian R P := isNoetherian_of_surjective _ f.toLinearMap f.range #align is_noetherian_of_linear_equiv isNoetherian_of_linearEquiv theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M := by constructor <;> intro h · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) · exact isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl).symm #align is_noetherian_top_iff isNoetherian_top_iff theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f hf).symm #align is_noetherian_of_injective isNoetherian_of_injective theorem fg_of_injective [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : Function.Injective f) : N.FG := haveI := isNoetherian_of_injective f hf IsNoetherian.noetherian N #align fg_of_injective fg_of_injective end namespace Module variable {R M N : Type*} variable [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M] [Module R N] variable (R M) -- see Note [lower instance priority] instance (priority := 100) IsNoetherian.finite [IsNoetherian R M] : Finite R M := ⟨IsNoetherian.noetherian ⊤⟩ #align module.is_noetherian.finite Module.IsNoetherian.finite variable {R M} theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) : Finite R M := ⟨fg_of_injective f hf⟩ #align module.finite.of_injective Module.Finite.of_injective end Module section variable {R : Type*} {M : Type*} {P : Type*} variable [Ring R] [AddCommGroup M] [AddCommGroup P] variable [Module R M] [Module R P] open IsNoetherian theorem isNoetherian_of_ker_bot [IsNoetherian R P] (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : IsNoetherian R M := isNoetherian_of_linearEquiv (LinearEquiv.ofInjective f <| LinearMap.ker_eq_bot.mp hf).symm #align is_noetherian_of_ker_bot isNoetherian_of_ker_bot theorem fg_of_ker_bot [IsNoetherian R P] {N : Submodule R M} (f : M →ₗ[R] P) (hf : LinearMap.ker f = ⊥) : N.FG := haveI := isNoetherian_of_ker_bot f hf IsNoetherian.noetherian N #align fg_of_ker_bot fg_of_ker_bot instance isNoetherian_prod [IsNoetherian R M] [IsNoetherian R P] : IsNoetherian R (M × P) := ⟨fun s => Submodule.fg_of_fg_map_of_fg_inf_ker (LinearMap.snd R M P) (noetherian _) <| have : s ⊓ LinearMap.ker (LinearMap.snd R M P) ≤ LinearMap.range (LinearMap.inl R M P) := fun x ⟨_, hx2⟩ => ⟨x.1, Prod.ext rfl <| Eq.symm <| LinearMap.mem_ker.1 hx2⟩ Submodule.map_comap_eq_self this ▸ (noetherian _).map _⟩ #align is_noetherian_prod isNoetherian_prod instance isNoetherian_pi {R ι : Type*} {M : ι → Type*} [Ring R] [∀ i, AddCommGroup (M i)] [∀ i, Module R (M i)] [Finite ι] [∀ i, IsNoetherian R (M i)] : IsNoetherian R (∀ i, M i) := by cases nonempty_fintype ι haveI := Classical.decEq ι suffices on_finset : ∀ s : Finset ι, IsNoetherian R (∀ i : s, M i) · let coe_e := Equiv.subtypeUnivEquiv <| @Finset.mem_univ ι _ letI : IsNoetherian R (∀ i : Finset.univ, M (coe_e i)) := on_finset Finset.univ exact isNoetherian_of_linearEquiv (LinearEquiv.piCongrLeft R M coe_e) intro s induction' s using Finset.induction with a s has ih · exact ⟨fun s => by have : s = ⊥ := by simp only [eq_iff_true_of_subsingleton] rw [this] apply Submodule.fg_bot⟩ refine @isNoetherian_of_linearEquiv R (M a × ((i : s) → M i)) _ _ _ _ _ _ ?_ <| @isNoetherian_prod R (M a) _ _ _ _ _ _ _ ih refine { toFun := fun f i => (Finset.mem_insert.1 i.2).by_cases (fun h : i.1 = a => show M i.1 from Eq.recOn h.symm f.1) (fun h : i.1 ∈ s => show M i.1 from f.2 ⟨i.1, h⟩), invFun := fun f => (f ⟨a, Finset.mem_insert_self _ _⟩, fun i => f ⟨i.1, Finset.mem_insert_of_mem i.2⟩), map_add' := ?_, map_smul' := ?_ left_inv := ?_, right_inv := ?_ } · intro f g ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · change _ = _ + _ simp only [dif_pos] rfl · change _ = _ + _ have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] rfl · intro c f ext i unfold Or.by_cases cases' i with i hi rcases Finset.mem_insert.1 hi with (rfl | h) · dsimp simp only [dif_pos] · dsimp have : ¬i = a := by rintro rfl exact has h simp only [dif_neg this, dif_pos h] · intro f apply Prod.ext · simp only [Or.by_cases, dif_pos] · ext ⟨i, his⟩ have : ¬i = a := by rintro rfl exact has his simp only [Or.by_cases, this, not_false_iff, dif_neg] · intro f ext ⟨i, hi⟩ rcases Finset.mem_insert.1 hi with (rfl | h) · simp only [Or.by_cases, dif_pos] · have : ¬i = a := by rintro rfl exact has h simp only [Or.by_cases, dif_neg this, dif_pos h] #align is_noetherian_pi isNoetherian_pi /-- A version of `isNoetherian_pi` for non-dependent functions. We need this instance because sometimes Lean fails to apply the dependent version in non-dependent settings (e.g., it fails to prove that `ι → ℝ` is finite dimensional over `ℝ`). -/ instance isNoetherian_pi' {R ι M : Type*} [Ring R] [AddCommGroup M] [Module R M] [Finite ι] [IsNoetherian R M] : IsNoetherian R (ι → M) := isNoetherian_pi #align is_noetherian_pi' isNoetherian_pi' end section CommRing variable (R M N : Type*) [CommRing R] [AddCommGroup M] [AddCommGroup N] [Module R M] [Module R N] [IsNoetherian R M] [Module.Finite R N] instance isNoetherian_linearMap_pi {ι : Type*} [Finite ι] : IsNoetherian R ((ι → R) →ₗ[R] M) := let _i : Fintype ι := Fintype.ofFinite ι; isNoetherian_of_linearEquiv (Module.piEquiv ι R M) instance isNoetherian_linearMap : IsNoetherian R (N →ₗ[R] M) := by obtain ⟨n, f, hf⟩ := Module.Finite.exists_fin' R N let g : (N →ₗ[R] M) →ₗ[R] (Fin n → R) →ₗ[R] M := (LinearMap.llcomp R (Fin n → R) N M).flip f exact isNoetherian_of_injective g hf.injective_linearMapComp_right end CommRing open IsNoetherian Submodule Function section universe w variable {R M P : Type*} {N : Type w} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] [AddCommMonoid P] [Module R P] theorem isNoetherian_iff_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := by have := (CompleteLattice.wellFounded_characterisations <| Submodule R M).out 0 3 -- Porting note: inlining this makes rw complain about it being a metavariable rw [this] exact ⟨fun ⟨h⟩ => fun k => (fg_iff_compact k).mp (h k), fun h => ⟨fun k => (fg_iff_compact k).mpr (h k)⟩⟩ #align is_noetherian_iff_well_founded isNoetherian_iff_wellFounded theorem isNoetherian_iff_fg_wellFounded : IsNoetherian R M ↔ WellFounded ((· > ·) : { N : Submodule R M // N.FG } → { N : Submodule R M // N.FG } → Prop) := by let α := { N : Submodule R M // N.FG } constructor · intro H let f : α ↪o Submodule R M := OrderEmbedding.subtype _ exact OrderEmbedding.wellFounded f.dual (isNoetherian_iff_wellFounded.mp H) · intro H constructor intro N obtain ⟨⟨N₀, h₁⟩, e : N₀ ≤ N, h₂⟩ := WellFounded.has_min H { N' : α | N'.1 ≤ N } ⟨⟨⊥, Submodule.fg_bot⟩, @bot_le _ _ _ N⟩ convert h₁ refine' (e.antisymm _).symm by_contra h₃ obtain ⟨x, hx₁ : x ∈ N, hx₂ : x ∉ N₀⟩ := Set.not_subset.mp h₃ apply hx₂ rw [eq_of_le_of_not_lt (le_sup_right : N₀ ≤ _) (h₂ ⟨_, Submodule.FG.sup ⟨{x}, by rw [Finset.coe_singleton]⟩ h₁⟩ <| sup_le ((Submodule.span_singleton_le_iff_mem _ _).mpr hx₁) e)] exact (le_sup_left : (R ∙ x) ≤ _) (Submodule.mem_span_singleton_self _) #align is_noetherian_iff_fg_well_founded isNoetherian_iff_fg_wellFounded variable (R M) theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] : ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop) := isNoetherian_iff_wellFounded.mp ‹_› #align well_founded_submodule_gt wellFounded_submodule_gt variable {R M} /-- A module is Noetherian iff every nonempty set of submodules has a maximal submodule among them. -/ theorem set_has_maximal_iff_noetherian : (∀ a : Set <| Submodule R M, a.Nonempty → ∃ M' ∈ a, ∀ I ∈ a, ¬M' < I) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.wellFounded_iff_has_min] #align set_has_maximal_iff_noetherian set_has_maximal_iff_noetherian /-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/ theorem monotone_stabilizes_iff_noetherian : (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M := by rw [isNoetherian_iff_wellFounded, WellFounded.monotone_chain_condition] #align monotone_stabilizes_iff_noetherian monotone_stabilizes_iff_noetherian theorem eventuallyConst_of_isNoetherian [IsNoetherian R M] (f : ℕ →o Submodule R M) : atTop.EventuallyConst f := by simp_rw [eventuallyConst_atTop, eq_comm] exact (monotone_stabilizes_iff_noetherian.mpr inferInstance) f /-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/ theorem IsNoetherian.induction [IsNoetherian R M] {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J > I, P J) → P I) (I : Submodule R M) : P I := WellFounded.recursion (wellFounded_submodule_gt R M) I hgt #align is_noetherian.induction IsNoetherian.induction end section universe w variable {R M P : Type*} {N : Type w} [Ring R] [AddCommGroup M] [Module R M] [AddCommGroup N] [Module R N] [AddCommGroup P] [Module R P] [IsNoetherian R M] lemma Submodule.finite_ne_bot_of_independent {ι : Type*} {N : ι → Submodule R M} (h : CompleteLattice.Independent N) : Set.Finite {i | N i ≠ ⊥} := CompleteLattice.WellFounded.finite_ne_bot_of_independent (isNoetherian_iff_wellFounded.mp inferInstance) h theorem finite_of_linearIndependent [Nontrivial R] {s : Set M} (hs : LinearIndependent R ((↑) : s → M)) : s.Finite := by refine' by_contradiction fun hf => (RelEmbedding.wellFounded_iff_no_descending_seq.1 (wellFounded_submodule_gt R M)).elim' _ have f : ℕ ↪ s := Set.Infinite.natEmbedding s hf have : ∀ n, (↑) ∘ f '' { m | m ≤ n } ⊆ s := by rintro n x ⟨y, _, rfl⟩ exact (f y).2 let coe' : s → M := (↑) have : ∀ a b : ℕ, a ≤ b ↔ span R (coe' ∘ f '' { m | m ≤ a }) ≤ span R ((↑) ∘ f '' { m | m ≤ b }) := by intro a b rw [span_le_span_iff hs (this a) (this b), Set.image_subset_image_iff (Subtype.coe_injective.comp f.injective), Set.subset_def] exact ⟨fun hab x (hxa : x ≤ a) => le_trans hxa hab, fun hx => hx a (le_refl a)⟩ exact ⟨⟨fun n => span R (coe' ∘ f '' { m | m ≤ n }), fun x y => by rw [le_antisymm_iff, (this x y).symm, (this y x).symm, ← le_antisymm_iff, imp_self] trivial⟩, by dsimp [GT.gt]; simp only [lt_iff_le_not_le, (this _ _).symm]; tauto⟩ #align finite_of_linear_independent finite_of_linearIndependent /-- If the first and final modules in a short exact sequence are Noetherian, then the middle module is also Noetherian. -/ theorem isNoetherian_of_range_eq_ker [IsNoetherian R P] (f : M →ₗ[R] N) (g : N →ₗ[R] P) (hf : Function.Injective f) (hg : Function.Surjective g) (h : LinearMap.range f = LinearMap.ker g) : IsNoetherian R N := isNoetherian_iff_wellFounded.2 <| wellFounded_gt_exact_sequence (wellFounded_submodule_gt R M) (wellFounded_submodule_gt R P) (LinearMap.range f) (Submodule.map f) (Submodule.comap f) (Submodule.comap g) (Submodule.map g) (Submodule.gciMapComap hf) (Submodule.giMapComap hg) (by simp [Submodule.map_comap_eq, inf_comm]) (by simp [Submodule.comap_map_eq, h]) #align is_noetherian_of_range_eq_ker isNoetherian_of_range_eq_ker /-- For an endomorphism of a Noetherian module, any sufficiently large iterate has disjoint kernel and range. -/ theorem LinearMap.eventually_disjoint_ker_pow_range_pow (f : M →ₗ[R] M) : ∀ᶠ n in atTop, Disjoint (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n)) := by obtain ⟨n, hn : ∀ m, n ≤ m → LinearMap.ker (f ^ n) = LinearMap.ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ disjoint_iff.mpr ?_⟩ rw [← hn _ hm, Submodule.eq_bot_iff] rintro - ⟨hx, ⟨x, rfl⟩⟩ apply LinearMap.pow_map_zero_of_le hm replace hx : x ∈ LinearMap.ker (f ^ (n + m)) := by simpa [f.pow_apply n, f.pow_apply m, ← f.pow_apply (n + m), ← iterate_add_apply] using hx rwa [← hn _ (n.le_add_right m)] at hx #align is_noetherian.exists_endomorphism_iterate_ker_inf_range_eq_bot LinearMap.eventually_disjoint_ker_pow_range_pow lemma LinearMap.eventually_iSup_ker_pow_eq (f : M →ₗ[R] M) : ∀ᶠ n in atTop, ⨆ m, LinearMap.ker (f ^ m) = LinearMap.ker (f ^ n) := by obtain ⟨n, hn : ∀ m, n ≤ m → ker (f ^ n) = ker (f ^ m)⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance f.iterateKer refine eventually_atTop.mpr ⟨n, fun m hm ↦ ?_⟩ refine le_antisymm (iSup_le fun l ↦ ?_) (le_iSup (fun i ↦ LinearMap.ker (f ^ i)) m) rcases le_or_lt m l with h | h · rw [← hn _ (hm.trans h), hn _ hm] · exact f.iterateKer.monotone h.le /-- Any surjective endomorphism of a Noetherian module is injective. -/ theorem IsNoetherian.injective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Injective f := by obtain ⟨n, hn⟩ := eventually_atTop.mp f.eventually_disjoint_ker_pow_range_pow specialize hn (n + 1) (n.le_add_right 1) rw [disjoint_iff, LinearMap.range_eq_top.mpr (LinearMap.iterate_surjective s _), inf_top_eq, LinearMap.ker_eq_bot] at hn exact LinearMap.injective_of_iterate_injective n.succ_ne_zero hn #align is_noetherian.injective_of_surjective_endomorphism IsNoetherian.injective_of_surjective_endomorphism /-- Any surjective endomorphism of a Noetherian module is bijective. -/ theorem IsNoetherian.bijective_of_surjective_endomorphism (f : M →ₗ[R] M) (s : Surjective f) : Bijective f := ⟨IsNoetherian.injective_of_surjective_endomorphism f s, s⟩ #align is_noetherian.bijective_of_surjective_endomorphism IsNoetherian.bijective_of_surjective_endomorphism /-- A sequence `f` of submodules of a noetherian module, with `f (n+1)` disjoint from the supremum of `f 0`, ..., `f n`, is eventually zero. -/ theorem IsNoetherian.disjoint_partialSups_eventually_bot (f : ℕ → Submodule R M) (h : ∀ n, Disjoint (partialSups f n) (f (n + 1))) : ∃ n : ℕ, ∀ m, n ≤ m → f m = ⊥ := by -- A little off-by-one cleanup first: suffices t : ∃ n : ℕ, ∀ m, n ≤ m → f (m + 1) = ⊥ · obtain ⟨n, w⟩ := t use n + 1 rintro (_ | m) p · cases p · apply w exact Nat.succ_le_succ_iff.mp p obtain ⟨n, w⟩ := monotone_stabilizes_iff_noetherian.mpr inferInstance (partialSups f) exact ⟨n, fun m p => (h m).eq_bot_of_ge <| sup_eq_left.1 <| (w (m + 1) <| le_add_right p).symm.trans <| w m p⟩ #align is_noetherian.disjoint_partial_sups_eventually_bot IsNoetherian.disjoint_partialSups_eventually_bot /-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/ noncomputable def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M) (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1} := by apply Nonempty.some obtain ⟨n, w⟩ := IsNoetherian.disjoint_partialSups_eventually_bot (f.tailing i) (f.tailings_disjoint_tailing i) specialize w n (le_refl n) apply Nonempty.intro -- Porting note: refine' makes this line time out at elaborator refine (LinearMap.tailingLinearEquiv f i n).symm ≪≫ₗ ?_ rw [w] apply Submodule.botEquivPUnit #align is_noetherian.equiv_punit_of_prod_injective IsNoetherian.equivPUnitOfProdInjective end /-- A (semi)ring is Noetherian if it is Noetherian as a module over itself, i.e. all its ideals are finitely generated. -/ @[reducible] def IsNoetherianRing (R) [Semiring R] := IsNoetherian R R #align is_noetherian_ring IsNoetherianRing theorem isNoetherianRing_iff {R} [Semiring R] : IsNoetherianRing R ↔ IsNoetherian R R := Iff.rfl #align is_noetherian_ring_iff isNoetherianRing_iff /-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/ theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] : IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG := isNoetherianRing_iff.trans isNoetherian_def #align is_noetherian_ring_iff_ideal_fg isNoetherianRing_iff_ideal_fg -- see Note [lower instance priority] instance (priority := 80) isNoetherian_of_finite (R M) [Finite M] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := ⟨fun s => ⟨(s : Set M).toFinite.toFinset, by rw [Set.Finite.coe_toFinset, Submodule.span_eq]⟩⟩ #align is_noetherian_of_finite isNoetherian_of_finite -- see Note [lower instance priority] /-- Modules over the trivial ring are Noetherian. -/ instance (priority := 100) isNoetherian_of_subsingleton (R M) [Subsingleton R] [Semiring R] [AddCommMonoid M] [Module R M] : IsNoetherian R M := haveI := Module.subsingleton R M isNoetherian_of_finite R M #align is_noetherian_of_subsingleton isNoetherian_of_subsingleton theorem isNoetherian_of_submodule_of_noetherian (R M) [Semiring R] [AddCommMonoid M] [Module R M] (N : Submodule R M) (h : IsNoetherian R M) : IsNoetherian R N := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.MapSubtype.orderEmbedding N).dual h #align is_noetherian_of_submodule_of_noetherian isNoetherian_of_submodule_of_noetherian instance Submodule.Quotient.isNoetherian {R} [Ring R] {M} [AddCommGroup M] [Module R M] (N : Submodule R M) [h : IsNoetherian R M] : IsNoetherian R (M ⧸ N) := by rw [isNoetherian_iff_wellFounded] at h ⊢ exact OrderEmbedding.wellFounded (Submodule.comapMkQOrderEmbedding N).dual h #align submodule.quotient.is_noetherian Submodule.Quotient.isNoetherian /-- If `M / S / R` is a scalar tower, and `M / R` is Noetherian, then `M / S` is also noetherian. -/ theorem isNoetherian_of_tower (R) {S M} [Semiring R] [Semiring S] [AddCommMonoid M] [SMul R S] [Module S M] [Module R M] [IsScalarTower R S M] (h : IsNoetherian R M) : IsNoetherian S M := by rw [isNoetherian_iff_wellFounded] at h ⊢ refine' (Submodule.restrictScalarsEmbedding R S M).dual.wellFounded h #align is_noetherian_of_tower isNoetherian_of_tower theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module R M] (N : Submodule R M) [I : IsNoetherianRing R] (hN : N.FG) : IsNoetherian R N := by let ⟨s, hs⟩ := hN haveI := Classical.decEq M haveI := Classical.decEq R have : ∀ x ∈ s, x ∈ N := fun x hx => hs ▸ Submodule.subset_span hx refine @isNoetherian_of_surjective R ((↑s : Set M) → R) N _ _ _ (Pi.module _ _ _) _ ?_ ?_ isNoetherian_pi · fapply LinearMap.mk · fapply AddHom.mk · exact fun f => ⟨∑ i in s.attach, f i • i.1, N.sum_mem fun c _ => N.smul_mem _ <| this _ c.2⟩ · intro f g apply Subtype.eq change (∑ i in s.attach, (f i + g i) • _) = _ simp only [add_smul, Finset.sum_add_distrib] rfl · intro c f apply Subtype.eq change (∑ i in s.attach, (c • f i) • _) = _ simp only [smul_eq_mul, mul_smul] exact Finset.smul_sum.symm · rw [LinearMap.range_eq_top] rintro ⟨n, hn⟩ change n ∈ N at hn rw [← hs, ← Set.image_id (s : Set M), Finsupp.mem_span_image_iff_total] at hn rcases hn with ⟨l, hl1, hl2⟩ refine' ⟨fun x => l x, Subtype.ext _⟩ change (∑ i in s.attach, l i • (i : M)) = n rw [@Finset.sum_attach M M s _ fun i => l i • i, ← hl2, Finsupp.total_apply, Finsupp.sum, eq_comm] refine' Finset.sum_subset hl1 fun x _ hx => _ rw [Finsupp.not_mem_support_iff.1 hx, zero_smul] #align is_noetherian_of_fg_of_noetherian isNoetherian_of_fg_of_noetherian instance isNoetherian_of_isNoetherianRing_of_finite (R M : Type*) [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] [Module.Finite R M] : IsNoetherian R M := have : IsNoetherian R (⊤ : Submodule R M) := isNoetherian_of_fg_of_noetherian _ $ Module.finite_def.mp inferInstance isNoetherian_of_linearEquiv (LinearEquiv.ofTop (⊤ : Submodule R M) rfl) #align is_noetherian_of_fg_of_noetherian' isNoetherian_of_isNoetherianRing_of_finite /-- In a module over a Noetherian ring, the submodule generated by finitely many vectors is Noetherian. -/ theorem isNoetherian_span_of_finite (R) {M} [Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] {A : Set M} (hA : A.Finite) : IsNoetherian R (Submodule.span R A) := isNoetherian_of_fg_of_noetherian _ (Submodule.fg_def.mpr ⟨A, hA, rfl⟩) #align is_noetherian_span_of_finite isNoetherian_span_of_finite theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S) (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S := by rw [isNoetherianRing_iff, isNoetherian_iff_wellFounded] at H ⊢ exact OrderEmbedding.wellFounded (Ideal.orderEmbeddingOfSurjective f hf).dual H #align is_noetherian_ring_of_surjective isNoetherianRing_of_surjective instance isNoetherianRing_range {R} [Ring R] {S} [Ring S] (f : R →+* S) [IsNoetherianRing R] : IsNoetherianRing f.range := isNoetherianRing_of_surjective R f.range f.rangeRestrict f.rangeRestrict_surjective #align is_noetherian_ring_range isNoetherianRing_range theorem isNoetherianRing_of_ringEquiv (R) [Ring R] {S} [Ring S] (f : R ≃+* S) [IsNoetherianRing R] : IsNoetherianRing S := isNoetherianRing_of_surjective R S f.toRingHom f.toEquiv.surjective #align is_noetherian_ring_of_ring_equiv isNoetherianRing_of_ringEquiv theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommRing R] [IsNoetherianRing R] : IsNilpotent (nilradical R) := by obtain ⟨n, hn⟩ := Ideal.exists_radical_pow_le_of_fg (⊥ : Ideal R) (IsNoetherian.noetherian _)
exact ⟨n, eq_bot_iff.mpr hn⟩
theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommRing R] [IsNoetherianRing R] : IsNilpotent (nilradical R) := by obtain ⟨n, hn⟩ := Ideal.exists_radical_pow_le_of_fg (⊥ : Ideal R) (IsNoetherian.noetherian _)
Mathlib.RingTheory.Noetherian.628_0.5UPGNrmhtW81IjE
theorem IsNoetherianRing.isNilpotent_nilradical (R : Type*) [CommRing R] [IsNoetherianRing R] : IsNilpotent (nilradical R)
Mathlib_RingTheory_Noetherian
C : Type u inst✝¹ : Category.{v, u} C α : Type u inst✝ : SemilatticeSup α X Y : α f g : X ⟶ Y ⊢ f ≫ 𝟙 Y = g ≫ 𝟙 Y
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by
apply ULift.ext
instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by
Mathlib.CategoryTheory.Filtered.Basic.89_0.dhnXC1TuYVuk8Vb
instance (priority
Mathlib_CategoryTheory_Filtered_Basic
case h C : Type u inst✝¹ : Category.{v, u} C α : Type u inst✝ : SemilatticeSup α X Y : α f g : X ⟶ Y ⊢ (f ≫ 𝟙 Y).down = (g ≫ 𝟙 Y).down
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext
apply Subsingleton.elim
instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext
Mathlib.CategoryTheory.Filtered.Basic.89_0.dhnXC1TuYVuk8Vb
instance (priority
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝² : Category.{v, u} C α : Type u inst✝¹ : Preorder α inst✝ : IsDirected α fun x x_1 => x ≤ x_1 X Y : α f g : X ⟶ Y ⊢ f ≫ 𝟙 Y = g ≫ 𝟙 Y
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by
apply ULift.ext
instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by
Mathlib.CategoryTheory.Filtered.Basic.102_0.dhnXC1TuYVuk8Vb
instance (priority
Mathlib_CategoryTheory_Filtered_Basic
case h C : Type u inst✝² : Category.{v, u} C α : Type u inst✝¹ : Preorder α inst✝ : IsDirected α fun x x_1 => x ≤ x_1 X Y : α f g : X ⟶ Y ⊢ (f ≫ 𝟙 Y).down = (g ≫ 𝟙 Y).down
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext
apply Subsingleton.elim
instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext
Mathlib.CategoryTheory.Filtered.Basic.102_0.dhnXC1TuYVuk8Vb
instance (priority
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝² : Category.{v, u} C α : Type u inst✝¹ : SemilatticeSup α inst✝ : OrderBot α ⊢ IsFiltered α
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by
infer_instance
example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by
Mathlib.CategoryTheory.Filtered.Basic.117_0.dhnXC1TuYVuk8Vb
example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝² : Category.{v, u} C α : Type u inst✝¹ : SemilatticeSup α inst✝ : OrderTop α ⊢ IsFiltered α
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by
infer_instance
example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by
Mathlib.CategoryTheory.Filtered.Basic.119_0.dhnXC1TuYVuk8Vb
example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝ : Category.{v, u} C X Y : Discrete PUnit.{?u.7958 + 1} ⊢ X.as = { as := PUnit.unit }.as
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by
trivial
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by
Mathlib.CategoryTheory.Filtered.Basic.121_0.dhnXC1TuYVuk8Vb
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝ : Category.{v, u} C X Y : Discrete PUnit.{?u.7958 + 1} f g : X ⟶ Y ⊢ Y.as = { as := PUnit.unit }.as
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by
trivial
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by
Mathlib.CategoryTheory.Filtered.Basic.121_0.dhnXC1TuYVuk8Vb
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝ : Category.{v, u} C X Y : Discrete PUnit.{?u.7958 + 1} f g : X ⟶ Y ⊢ f ≫ { down := { down := (_ : Y.as = Y.as) } } = g ≫ { down := { down := (_ : Y.as = Y.as) } }
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by
apply ULift.ext
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by
Mathlib.CategoryTheory.Filtered.Basic.121_0.dhnXC1TuYVuk8Vb
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y
Mathlib_CategoryTheory_Filtered_Basic
case h C : Type u inst✝ : Category.{v, u} C X Y : Discrete PUnit.{?u.7958 + 1} f g : X ⟶ Y ⊢ (f ≫ { down := { down := (_ : Y.as = Y.as) } }).down = (g ≫ { down := { down := (_ : Y.as = Y.as) } }).down
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext
apply Subsingleton.elim
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext
Mathlib.CategoryTheory.Filtered.Basic.121_0.dhnXC1TuYVuk8Vb
instance : IsFiltered (Discrete PUnit) where cocone_objs X Y
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝² : Category.{v, u} C inst✝¹ : IsFilteredOrEmpty C D : Type u₁ inst✝ : Category.{v₁, u₁} D L : D ⥤ C R : C ⥤ D h : L ⊣ R X Y : D f g : X ⟶ Y ⊢ f ≫ (Adjunction.homEquiv h Y (coeq (?m.10744 h X Y f g) (?m.10745 h X Y f g))) (coeqHom (?m.10744 h X Y f g) (?m.10745 h X Y f g)) = g ≫ (Adjunction.homEquiv h Y (coeq (?m.10744 h X Y f g) (?m.10745 h X Y f g))) (coeqHom (?m.10744 h X Y f g) (?m.10745 h X Y f g))
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by
rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]
/-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by
Mathlib.CategoryTheory.Filtered.Basic.204_0.dhnXC1TuYVuk8Vb
/-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C ⊢ ∃ S, ∀ {X : C}, X ∈ O → Nonempty (X ⟶ S)
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by
classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C ⊢ ∃ S, ∀ {X : C}, X ∈ O → Nonempty (X ⟶ S)
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical
induction' O using Finset.induction with X O' nm h
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case empty C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C ⊢ ∃ S, ∀ {X : C}, X ∈ ∅ → Nonempty (X ⟶ S)
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h ·
exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h ·
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C ⊢ ∀ {X : C}, X ∈ ∅ → Nonempty (X ⟶ Classical.choice (_ : Nonempty C))
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by
intro
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C X✝ : C ⊢ X✝ ∈ ∅ → Nonempty (X✝ ⟶ Classical.choice (_ : Nonempty C))
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro;
simp
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro;
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case insert C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C X : C O' : Finset C nm : X ∉ O' h : ∃ S, ∀ {X : C}, X ∈ O' → Nonempty (X ⟶ S) ⊢ ∃ S, ∀ {X_1 : C}, X_1 ∈ insert X O' → Nonempty (X_1 ⟶ S)
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ ·
obtain ⟨S', w'⟩ := h
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ ·
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case insert.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C X : C O' : Finset C nm : X ∉ O' S' : C w' : ∀ {X : C}, X ∈ O' → Nonempty (X ⟶ S') ⊢ ∃ S, ∀ {X_1 : C}, X_1 ∈ insert X O' → Nonempty (X_1 ⟶ S)
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h
use max X S'
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case h C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C X : C O' : Finset C nm : X ∉ O' S' : C w' : ∀ {X : C}, X ∈ O' → Nonempty (X ⟶ S') ⊢ ∀ {X_1 : C}, X_1 ∈ insert X O' → Nonempty (X_1 ⟶ max X S')
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S'
rintro Y mY
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S'
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case h C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C X : C O' : Finset C nm : X ∉ O' S' : C w' : ∀ {X : C}, X ∈ O' → Nonempty (X ⟶ S') Y : C mY : Y ∈ insert X O' ⊢ Nonempty (Y ⟶ max X S')
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY
obtain rfl | h := eq_or_ne Y X
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case h.inl C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O' : Finset C S' : C w' : ∀ {X : C}, X ∈ O' → Nonempty (X ⟶ S') Y : C nm : Y ∉ O' mY : Y ∈ insert Y O' ⊢ Nonempty (Y ⟶ max Y S')
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X ·
exact ⟨leftToMax _ _⟩
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X ·
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
case h.inr C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C X : C O' : Finset C nm : X ∉ O' S' : C w' : ∀ {X : C}, X ∈ O' → Nonempty (X ⟶ S') Y : C mY : Y ∈ insert X O' h : Y ≠ X ⊢ Nonempty (Y ⟶ max X S')
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ ·
exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ ·
Mathlib.CategoryTheory.Filtered.Basic.234_0.dhnXC1TuYVuk8Vb
/-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S)
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) ⊢ ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H → f ≫ T mY = T mX
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by
classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩ by_cases hf : f = f' · subst hf apply coeq_condition · rw [@w' _ _ mX mY f'] simp only [Finset.mem_insert, PSigma.mk.injEq, heq_eq_eq, true_and] at mf' rcases mf' with mf' | mf' · exfalso exact hf mf'.symm · exact mf' · rw [@w' _ _ mX' mY' f' _] apply Finset.mem_of_mem_insert_of_ne mf' contrapose! h obtain ⟨rfl, h⟩ := h trivial
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) ⊢ ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H → f ≫ T mY = T mX
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical
induction' H using Finset.induction with h' H' nmf h''
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case empty C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) ⊢ ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ ∅ → f ≫ T mY = T mX
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' ·
obtain ⟨S, f⟩ := sup_objs_exists O
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' ·
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case empty.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) S : C f : ∀ {X : C}, X ∈ O → Nonempty (X ⟶ S) ⊢ ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ ∅ → f ≫ T mY = T mX
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O
refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) S : C f : ∀ {X : C}, X ∈ O → Nonempty (X ⟶ S) ⊢ ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f_1 : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f_1 } } } } ∈ ∅ → f_1 ≫ (fun {X} mX => Nonempty.some (_ : Nonempty (X ⟶ S))) mY = (fun {X} mX => Nonempty.some (_ : Nonempty (X ⟶ S))) mX
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by
rintro - - - - - ⟨⟩
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case insert C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) h' : (X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y) H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) nmf : h' ∉ H' h'' : ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T mY = T mX ⊢ ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ insert h' H' → f ≫ T mY = T mX
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ ·
obtain ⟨X, Y, mX, mY, f⟩ := h'
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ ·
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case insert.mk.mk.mk.mk C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) h'' : ∃ S T, ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T mY = T mX X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' ⊢ ∃ S T, ∀ {X_1 Y_1 : C} (mX_1 : X_1 ∈ O) (mY_1 : Y_1 ∈ O) {f_1 : X_1 ⟶ Y_1}, { fst := X_1, snd := { fst := Y_1, snd := { fst := mX_1, snd := { fst := mY_1, snd := f_1 } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' → f_1 ≫ T mY_1 = T mX_1
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h'
obtain ⟨S', T', w'⟩ := h''
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h'
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case insert.mk.mk.mk.mk.intro.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX ⊢ ∃ S T, ∀ {X_1 Y_1 : C} (mX_1 : X_1 ∈ O) (mY_1 : Y_1 ∈ O) {f_1 : X_1 ⟶ Y_1}, { fst := X_1, snd := { fst := Y_1, snd := { fst := mX_1, snd := { fst := mY_1, snd := f_1 } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' → f_1 ≫ T mY_1 = T mX_1
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h''
refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h''
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case insert.mk.mk.mk.mk.intro.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX ⊢ ∀ {X_1 Y_1 : C} (mX_1 : X_1 ∈ O) (mY_1 : Y_1 ∈ O) {f_1 : X_1 ⟶ Y_1}, { fst := X_1, snd := { fst := Y_1, snd := { fst := mX_1, snd := { fst := mY_1, snd := f_1 } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' → f_1 ≫ (fun {X_2} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mY_1 = (fun {X_2} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX_1
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩
intro X' Y' mX' mY' f' mf'
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case insert.mk.mk.mk.mk.intro.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX X' Y' : C mX' : X' ∈ O mY' : Y' ∈ O f' : X' ⟶ Y' mf' : { fst := X', snd := { fst := Y', snd := { fst := mX', snd := { fst := mY', snd := f' } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' ⊢ f' ≫ (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mY' = (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX'
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf'
rw [← Category.assoc]
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf'
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case insert.mk.mk.mk.mk.intro.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX X' Y' : C mX' : X' ∈ O mY' : Y' ∈ O f' : X' ⟶ Y' mf' : { fst := X', snd := { fst := Y', snd := { fst := mX', snd := { fst := mY', snd := f' } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' ⊢ (f' ≫ T' mY') ≫ coeqHom (f ≫ T' mY) (T' mX) = (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX'
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc]
by_cases h : X = X' ∧ Y = Y'
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc]
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case pos C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX X' Y' : C mX' : X' ∈ O mY' : Y' ∈ O f' : X' ⟶ Y' mf' : { fst := X', snd := { fst := Y', snd := { fst := mX', snd := { fst := mY', snd := f' } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' h : X = X' ∧ Y = Y' ⊢ (f' ≫ T' mY') ≫ coeqHom (f ≫ T' mY) (T' mX) = (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX'
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' ·
rcases h with ⟨rfl, rfl⟩
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' ·
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case pos.intro C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX mX' : X ∈ O mY' : Y ∈ O f' : X ⟶ Y mf' : { fst := X, snd := { fst := Y, snd := { fst := mX', snd := { fst := mY', snd := f' } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' ⊢ (f' ≫ T' mY') ≫ coeqHom (f ≫ T' mY) (T' mX) = (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX'
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩
by_cases hf : f = f'
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case pos C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX mX' : X ∈ O mY' : Y ∈ O f' : X ⟶ Y mf' : { fst := X, snd := { fst := Y, snd := { fst := mX', snd := { fst := mY', snd := f' } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' hf : f = f' ⊢ (f' ≫ T' mY') ≫ coeqHom (f ≫ T' mY) (T' mX) = (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX'
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩ by_cases hf : f = f' ·
subst hf
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩ by_cases hf : f = f' ·
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic
case pos C : Type u inst✝¹ : Category.{v, u} C inst✝ : IsFiltered C O : Finset C H H' : Finset ((X : C) ×' (Y : C) ×' (_ : X ∈ O) ×' (_ : Y ∈ O) ×' (X ⟶ Y)) X Y : C mX : X ∈ O mY : Y ∈ O f : X ⟶ Y nmf : { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∉ H' S' : C T' : {X : C} → X ∈ O → (X ⟶ S') w' : ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } ∈ H' → f ≫ T' mY = T' mX mX' : X ∈ O mY' : Y ∈ O mf' : { fst := X, snd := { fst := Y, snd := { fst := mX', snd := { fst := mY', snd := f } } } } ∈ insert { fst := X, snd := { fst := Y, snd := { fst := mX, snd := { fst := mY, snd := f } } } } H' ⊢ (f ≫ T' mY') ≫ coeqHom (f ≫ T' mY) (T' mX) = (fun {X_1} mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX)) mX'
/- Copyright (c) 2019 Reid Barton. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Reid Barton, Scott Morrison -/ import Mathlib.CategoryTheory.FinCategory import Mathlib.CategoryTheory.Limits.Cones import Mathlib.CategoryTheory.Adjunction.Basic import Mathlib.CategoryTheory.Category.Preorder import Mathlib.CategoryTheory.Category.ULift #align_import category_theory.filtered from "leanprover-community/mathlib"@"14e80e85cbca5872a329fbfd3d1f3fd64e306934" /-! # Filtered categories A category is filtered if every finite diagram admits a cocone. We give a simple characterisation of this condition as 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. Filtered colimits are often better behaved than arbitrary colimits. See `CategoryTheory/Limits/Types` for some details. Filtered categories are nice because colimits indexed by filtered categories tend to be easier to describe than general colimits (and more often preserved by functors). In this file we show that any functor from a finite category to a filtered category admits a cocone: * `cocone_nonempty [FinCategory J] [IsFiltered C] (F : J ⥤ C) : Nonempty (Cocone F)` More generally, for any finite collection of objects and morphisms between them in a filtered category (even if not closed under composition) there exists some object `Z` receiving maps from all of them, so that all the triangles (one edge from the finite set, two from morphisms to `Z`) commute. This formulation is often more useful in practice and is available via `sup_exists`, which takes a finset of objects, and an indexed family (indexed by source and target) of finsets of morphisms. Furthermore, we give special support for two diagram categories: The `bowtie` and the `tulip`. This is because these shapes show up in the proofs that forgetful functors of algebraic categories (e.g. `MonCat`, `CommRingCat`, ...) preserve filtered colimits. All of the above API, except for the `bowtie` and the `tulip`, is also provided for cofiltered categories. ## See also In `CategoryTheory.Limits.FilteredColimitCommutesFiniteLimit` we show that filtered colimits commute with finite limits. -/ open Function -- declare the `v`'s first; see `CategoryTheory.Category` for an explanation universe w v v₁ u u₁ u₂ namespace CategoryTheory variable (C : Type u) [Category.{v} C] /-- A category `IsFilteredOrEmpty` if 1. for every pair of objects there exists another object "to the right", and 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal. -/ class IsFilteredOrEmpty : Prop where /-- for every pair of objects there exists another object "to the right" -/ cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True /-- for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal -/ cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h #align category_theory.is_filtered_or_empty CategoryTheory.IsFilteredOrEmpty /-- A category `IsFiltered` if 1. for every pair of objects there exists another object "to the right", 2. for every pair of parallel morphisms there exists a morphism to the right so the compositions are equal, and 3. there exists some object. See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.) -/ class IsFiltered extends IsFilteredOrEmpty C : Prop where /-- a filtered category must be non empty -/ [nonempty : Nonempty C] #align category_theory.is_filtered CategoryTheory.IsFiltered instance (priority := 100) isFilteredOrEmpty_of_semilatticeSup (α : Type u) [SemilatticeSup α] : IsFilteredOrEmpty α where cocone_objs X Y := ⟨X ⊔ Y, homOfLE le_sup_left, homOfLE le_sup_right, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_semilattice_sup CategoryTheory.isFilteredOrEmpty_of_semilatticeSup instance (priority := 100) isFiltered_of_semilatticeSup_nonempty (α : Type u) [SemilatticeSup α] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_semilattice_sup_nonempty CategoryTheory.isFiltered_of_semilatticeSup_nonempty instance (priority := 100) isFilteredOrEmpty_of_directed_le (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] : IsFilteredOrEmpty α where cocone_objs X Y := let ⟨Z, h1, h2⟩ := exists_ge_ge X Y ⟨Z, homOfLE h1, homOfLE h2, trivial⟩ cocone_maps X Y f g := ⟨Y, 𝟙 _, by apply ULift.ext apply Subsingleton.elim⟩ #align category_theory.is_filtered_or_empty_of_directed_le CategoryTheory.isFilteredOrEmpty_of_directed_le instance (priority := 100) isFiltered_of_directed_le_nonempty (α : Type u) [Preorder α] [IsDirected α (· ≤ ·)] [Nonempty α] : IsFiltered α where #align category_theory.is_filtered_of_directed_le_nonempty CategoryTheory.isFiltered_of_directed_le_nonempty -- Sanity checks example (α : Type u) [SemilatticeSup α] [OrderBot α] : IsFiltered α := by infer_instance example (α : Type u) [SemilatticeSup α] [OrderTop α] : IsFiltered α := by infer_instance instance : IsFiltered (Discrete PUnit) where cocone_objs X Y := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, ⟨⟨Subsingleton.elim _ _⟩⟩, trivial⟩ cocone_maps X Y f g := ⟨⟨PUnit.unit⟩, ⟨⟨by trivial⟩⟩, by apply ULift.ext apply Subsingleton.elim⟩ namespace IsFiltered section AllowEmpty variable {C} variable [IsFilteredOrEmpty C] -- porting note: the following definitions were removed because the names are invalid, -- direct references to `IsFilteredOrEmpty` have been added instead -- -- theorem cocone_objs : ∀ X Y : C, ∃ (Z : _) (f : X ⟶ Z) (g : Y ⟶ Z), True := -- IsFilteredOrEmpty.cocone_objs -- #align category_theory.is_filtered.cocone_objs CategoryTheory.IsFiltered.cocone_objs -- --theorem cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h := -- IsFilteredOrEmpty.cocone_maps --#align category_theory.is_filtered.cocone_maps CategoryTheory.IsFiltered.cocone_maps /-- `max j j'` is an arbitrary choice of object to the right of both `j` and `j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def max (j j' : C) : C := (IsFilteredOrEmpty.cocone_objs j j').choose #align category_theory.is_filtered.max CategoryTheory.IsFiltered.max /-- `leftToMax j j'` is an arbitrary choice of morphism from `j` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def leftToMax (j j' : C) : j ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose #align category_theory.is_filtered.left_to_max CategoryTheory.IsFiltered.leftToMax /-- `rightToMax j j'` is an arbitrary choice of morphism from `j'` to `max j j'`, whose existence is ensured by `IsFiltered`. -/ noncomputable def rightToMax (j j' : C) : j' ⟶ max j j' := (IsFilteredOrEmpty.cocone_objs j j').choose_spec.choose_spec.choose #align category_theory.is_filtered.right_to_max CategoryTheory.IsFiltered.rightToMax /-- `coeq f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of object which admits a morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeq {j j' : C} (f f' : j ⟶ j') : C := (IsFilteredOrEmpty.cocone_maps f f').choose #align category_theory.is_filtered.coeq CategoryTheory.IsFiltered.coeq /-- `coeqHom f f'`, for morphisms `f f' : j ⟶ j'`, is an arbitrary choice of morphism `coeqHom f f' : j' ⟶ coeq f f'` such that `coeq_condition : f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. Its existence is ensured by `IsFiltered`. -/ noncomputable def coeqHom {j j' : C} (f f' : j ⟶ j') : j' ⟶ coeq f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose #align category_theory.is_filtered.coeq_hom CategoryTheory.IsFiltered.coeqHom -- porting note: the simp tag has been removed as the linter complained /-- `coeq_condition f f'`, for morphisms `f f' : j ⟶ j'`, is the proof that `f ≫ coeqHom f f' = f' ≫ coeqHom f f'`. -/ @[reassoc] theorem coeq_condition {j j' : C} (f f' : j ⟶ j') : f ≫ coeqHom f f' = f' ≫ coeqHom f f' := (IsFilteredOrEmpty.cocone_maps f f').choose_spec.choose_spec #align category_theory.is_filtered.coeq_condition CategoryTheory.IsFiltered.coeq_condition end AllowEmpty end IsFiltered namespace IsFilteredOrEmpty open IsFiltered variable {C} variable [IsFilteredOrEmpty C] variable {D : Type u₁} [Category.{v₁} D] /-- If `C` is filtered or emtpy, and we have a functor `R : C ⥤ D` with a left adjoint, then `D` is filtered or empty. -/ theorem of_right_adjoint {L : D ⥤ C} {R : C ⥤ D} (h : L ⊣ R) : IsFilteredOrEmpty D := { cocone_objs := fun X Y => ⟨_, h.homEquiv _ _ (leftToMax _ _), h.homEquiv _ _ (rightToMax _ _), ⟨⟩⟩ cocone_maps := fun X Y f g => ⟨_, h.homEquiv _ _ (coeqHom _ _), by rw [← h.homEquiv_naturality_left, ← h.homEquiv_naturality_left, coeq_condition]⟩ } /-- If `C` is filtered or empty, and we have a right adjoint functor `R : C ⥤ D`, then `D` is filtered or empty. -/ theorem of_isRightAdjoint (R : C ⥤ D) [IsRightAdjoint R] : IsFilteredOrEmpty D := of_right_adjoint (Adjunction.ofRightAdjoint R) /-- Being filtered or empty is preserved by equivalence of categories. -/ theorem of_equivalence (h : C ≌ D) : IsFilteredOrEmpty D := of_right_adjoint h.symm.toAdjunction end IsFilteredOrEmpty namespace IsFiltered section Nonempty open CategoryTheory.Limits variable {C} variable [IsFiltered C] /-- Any finite collection of objects in a filtered category has an object "to the right". -/ theorem sup_objs_exists (O : Finset C) : ∃ S : C, ∀ {X}, X ∈ O → Nonempty (X ⟶ S) := by classical induction' O using Finset.induction with X O' nm h · exact ⟨Classical.choice IsFiltered.nonempty, by intro; simp⟩ · obtain ⟨S', w'⟩ := h use max X S' rintro Y mY obtain rfl | h := eq_or_ne Y X · exact ⟨leftToMax _ _⟩ · exact ⟨(w' (Finset.mem_of_mem_insert_of_ne mY h)).some ≫ rightToMax _ _⟩ #align category_theory.is_filtered.sup_objs_exists CategoryTheory.IsFiltered.sup_objs_exists variable (O : Finset C) (H : Finset (Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y)) /-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩ by_cases hf : f = f' · subst hf
apply coeq_condition
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX := by classical induction' H using Finset.induction with h' H' nmf h'' · obtain ⟨S, f⟩ := sup_objs_exists O refine' ⟨S, fun mX => (f mX).some, by rintro - - - - - ⟨⟩⟩ · obtain ⟨X, Y, mX, mY, f⟩ := h' obtain ⟨S', T', w'⟩ := h'' refine' ⟨coeq (f ≫ T' mY) (T' mX), fun mZ => T' mZ ≫ coeqHom (f ≫ T' mY) (T' mX), _⟩ intro X' Y' mX' mY' f' mf' rw [← Category.assoc] by_cases h : X = X' ∧ Y = Y' · rcases h with ⟨rfl, rfl⟩ by_cases hf : f = f' · subst hf
Mathlib.CategoryTheory.Filtered.Basic.250_0.dhnXC1TuYVuk8Vb
/-- Given any `Finset` of objects `{X, ...}` and indexed collection of `Finset`s of morphisms `{f, ...}` in `C`, there exists an object `S`, with a morphism `T X : X ⟶ S` from each `X`, such that the triangles commute: `f ≫ T Y = T X`, for `f : X ⟶ Y` in the `Finset`. -/ theorem sup_exists : ∃ (S : C) (T : ∀ {X : C}, X ∈ O → (X ⟶ S)), ∀ {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}, (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H → f ≫ T mY = T mX
Mathlib_CategoryTheory_Filtered_Basic