algebra.homology.local_cohomologyMathlib.Algebra.Homology.LocalCohomology

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

feat(algebra/homology/local_cohomology): Add equivalence of local cohomology along cofinal diagrams (#19105)

Add the natural equivalence of local cohomology along cofinal diagrams of ideals.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -7,7 +7,8 @@ import ring_theory.ideal.basic
 import algebra.category.Module.colimits
 import algebra.category.Module.projective
 import category_theory.abelian.ext
-import ring_theory.finiteness
+import category_theory.limits.final
+import ring_theory.noetherian
 
 /-!
 # Local cohomology.
@@ -42,7 +43,6 @@ local cohomology, local cohomology modules
     * the right-derived functor definition
     * the characterization as the limit of Koszul homology
     * the characterization as the cohomology of a Cech-like complex
-* Prove that local cohomology depends only on the radical of the ideal
 * Establish long exact sequence(s) in local cohomology
 -/
 
@@ -52,8 +52,7 @@ open category_theory.limits
 
 noncomputable theory
 
-universes u v
-
+universes u v v'
 
 namespace local_cohomology
 
@@ -90,10 +89,9 @@ of `R`, represented as a functor `I`. -/
 In this definition we do not assume any special property of the diagram `I`, but the relevant case
 will be where `I` is (cofinal with) the diagram of powers of a single given ideal.
 
-Below, we give two equivalent (to be shown) definitions of the usual local cohomology with support
+Below, we give two equivalent definitions of the usual local cohomology with support
 in an ideal `J`, `local_cohomology` and `local_cohomology.of_self_le_radical`.
 
-TODO: Show that any functor cofinal with `I` gives the same result.
  -/
 def of_diagram (I : D ⥤ ideal R) (i : ℕ) :
   Module.{max u v} R ⥤ Module.{max u v} R :=
@@ -101,6 +99,23 @@ colimit (diagram.{(max u v) v} I i)
 
 end
 
+section
+variables {R : Type max u v v'} [comm_ring R] {D : Type v} [small_category D]
+
+variables {E : Type v'} [small_category E]
+  (I' : E ⥤ D) (I : D ⥤ ideal R)
+
+/-- Local cohomology along a composition of diagrams. -/
+def diagram_comp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ (diagram I i) := iso.refl _
+
+/-- Local cohomology agrees along precomposition with a cofinal diagram. -/
+def iso_of_final [functor.initial I'] (i : ℕ) :
+  of_diagram.{(max u v) v'} (I' ⋙ I) i ≅ of_diagram.{(max u v') v} I i :=
+(has_colimit.iso_of_nat_iso (diagram_comp _ _ _))
+≪≫ (functor.final.colimit_iso _ _)
+
+end
+
 section diagrams
 
 variables {R : Type u} [comm_ring R]
@@ -139,28 +154,31 @@ variables {R : Type u} [comm_ring R]
 a commutative ring `R` with support in the ideal `J` of `R`, defined as the direct limit
 of `Ext^i(R/J^t, M)` over all powers `t : ℕ`. -/
 def local_cohomology (J : ideal R) (i : ℕ) : Module.{u} R ⥤ Module.{u} R :=
-  of_diagram (ideal_powers_diagram J) i
+of_diagram (ideal_powers_diagram J) i
 
 /-- Local cohomology as the direct limit of `Ext^i(R/J', M)` over *all* ideals `J'` with radical
 containing `J`. -/
-def local_cohomology.of_self_le_radical (J : ideal R) (i : ℕ) :
-  Module.{u} R ⥤ Module.{u} R :=
+def local_cohomology.of_self_le_radical (J : ideal R) (i : ℕ) : Module.{u} R ⥤ Module.{u} R :=
 of_diagram.{u} (self_le_radical_diagram.{u} J) i
-/- TODO: Construct `local_cohomology J i ≅ local_cohomology.of_self_le_radical J i`. Use this to
-show that local cohomology depends only on `J.radical`. -/
 
 end models_for_local_cohomology
 
+namespace local_cohomology
 
+/-!
+Showing equivalence of different definitions of local cohomology.
+  * `local_cohomology.iso_self_le_radical` gives the isomorphism
+      `local_cohomology J i ≅ local_cohomology.of_self_le_radical J i`
+  * `local_cohomology.iso_of_same_radical` gives the isomorphism
+      `local_cohomology J i ≅ local_cohomology K i` when `J.radical = K.radical`.
+-/
 section local_cohomology_equiv
 
-open local_cohomology
-
-variables {R : Type u} [comm_ring R] (I J : ideal R)
+variables {R : Type u} [comm_ring R]
 
 /-- Lifting `ideal_powers_diagram J` from a diagram valued in `ideals R` to a diagram
 valued in `self_le_radical J`. -/
-def local_cohomology.ideal_powers_to_self_le_radical (J : ideal R) : ℕᵒᵖ ⥤ self_le_radical J :=
+def ideal_powers_to_self_le_radical (J : ideal R) : ℕᵒᵖ ⥤ self_le_radical J :=
 full_subcategory.lift _ (ideal_powers_diagram J)
 (λ k, begin
   change _ ≤ (J^(unop k)).radical,
@@ -169,17 +187,12 @@ full_subcategory.lift _ (ideal_powers_diagram J)
   { simp only [J.radical_pow _ n.succ_pos, ideal.le_radical] },
 end)
 
-/-- The composition with the inclusion into `ideals R` is isomorphic to `ideal_powers_diagram J`. -/
-def local_cohomology.ideal_powers_to_self_le_radical_comp_inclusion (J : ideal R) :
-local_cohomology.ideal_powers_to_self_le_radical J ⋙ self_le_radical_diagram J
-  ≅ ideal_powers_diagram J :=
-  full_subcategory.lift_comp_inclusion _ _ _
-
-/-- The lemma below essentially says that `ideal_powers_to_self_le_radical I` is initial in
-`self_le_radical_diagram I`.
+variables {I J K : ideal R}
 
+/--
 PORTING NOTE: This lemma should probably be moved to `ring_theory/finiteness.lean`
-to be near `ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
+to be near `ideal.exists_radical_pow_le_of_fg`, which it generalizes.
+-/
 lemma ideal.exists_pow_le_of_le_radical_of_fg (hIJ : I ≤ J.radical) (hJ : J.radical.fg) :
   ∃ (k : ℕ), I^k ≤ J :=
 begin
@@ -189,4 +202,61 @@ begin
        ... ≤ J           : hk,
 end
 
+/-- The diagram of powers of `J` is initial in the diagram of all ideals with
+radical containing `J`. This uses noetherianness. -/
+instance ideal_powers_initial [hR : is_noetherian R R] :
+  functor.initial (ideal_powers_to_self_le_radical J) :=
+{ out := λ J', begin
+  apply @zigzag_is_connected _ _ _,
+  { intros j1 j2,
+    apply relation.refl_trans_gen.single,
+    -- The inclusions `J^n1 ≤ J'` and `J^n2 ≤ J'` always form a triangle, based on
+    -- which exponent is larger.
+    cases le_total (unop j1.left) (unop j2.left) with h,
+      right, exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (of_as_true trivial)⟩,
+      left, exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (of_as_true trivial)⟩ },
+  { obtain ⟨k, hk⟩ := ideal.exists_pow_le_of_le_radical_of_fg J'.2
+      (is_noetherian_def.mp hR _),
+    exact ⟨costructured_arrow.mk (⟨⟨hk⟩⟩ : (ideal_powers_to_self_le_radical J).obj (op k) ⟶ J')⟩},
+  end }
+
+/-- Local cohomology (defined in terms of powers of `J`) agrees with local
+cohomology computed over all ideals with radical containing `J`. -/
+def iso_self_le_radical (J : ideal R) [is_noetherian R R] (i : ℕ) :
+  local_cohomology.of_self_le_radical J i ≅ local_cohomology J i :=
+(local_cohomology.iso_of_final.{u u 0}
+  (ideal_powers_to_self_le_radical J) (self_le_radical_diagram J) i).symm
+≪≫ has_colimit.iso_of_nat_iso (iso.refl _)
+
+/-- Casting from the full subcategory of ideals with radical containing `J` to the full
+subcategory of ideals with radical containing `K`. -/
+def self_le_radical.cast (hJK : J.radical = K.radical) :
+  self_le_radical J ⥤ self_le_radical K :=
+full_subcategory.map (λ L hL, begin
+                        rw ← ideal.radical_le_radical_iff at ⊢ hL,
+                        exact hJK.symm.trans_le hL,
+                      end)
+
+-- TODO generalize this to the equivalence of full categories for any `iff`.
+instance self_le_radical.cast_is_equivalence (hJK : J.radical = K.radical) :
+  is_equivalence (self_le_radical.cast hJK) :=
+{ inverse := self_le_radical.cast hJK.symm,
+  unit_iso := by tidy,
+  counit_iso := by tidy }
+
+/-- The natural isomorphism between local cohomology defined using the `of_self_le_radical`
+diagram, assuming `J.radical = K.radical`. -/
+def self_le_radical.iso_of_same_radical (hJK : J.radical = K.radical)  (i : ℕ) :
+  of_self_le_radical J i ≅ of_self_le_radical K i :=
+(iso_of_final.{u u u} (self_le_radical.cast hJK.symm) _ _).symm
+
+/-- Local cohomology agrees on ideals with the same radical. -/
+def iso_of_same_radical [is_noetherian R R] (hJK : J.radical = K.radical) (i : ℕ) :
+  local_cohomology J i ≅ local_cohomology K i :=
+(iso_self_le_radical J i).symm
+≪≫ self_le_radical.iso_of_same_radical hJK i
+≪≫ iso_self_le_radical K i
+
 end local_cohomology_equiv
+
+end local_cohomology

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -299,7 +299,7 @@ def SelfLERadical.cast (hJK : J.radical = K.radical) : SelfLERadical J ⥤ SelfL
 #print localCohomology.SelfLERadical.castIsEquivalence /-
 -- TODO generalize this to the equivalence of full categories for any `iff`.
 instance SelfLERadical.castIsEquivalence (hJK : J.radical = K.radical) :
-    IsEquivalence (SelfLERadical.cast hJK)
+    CategoryTheory.Functor.IsEquivalence (SelfLERadical.cast hJK)
     where
   inverse := SelfLERadical.cast hJK.symm
   unitIso := by tidy
Diff
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
 -/
 import RingTheory.Ideal.Basic
-import Algebra.Category.Module.Colimits
-import Algebra.Category.Module.Projective
+import Algebra.Category.ModuleCat.Colimits
+import Algebra.Category.ModuleCat.Projective
 import CategoryTheory.Abelian.Ext
 import CategoryTheory.Limits.Final
 import RingTheory.Noetherian
Diff
@@ -3,12 +3,12 @@ Copyright (c) 2023 Emily Witt. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
 -/
-import Mathbin.RingTheory.Ideal.Basic
-import Mathbin.Algebra.Category.Module.Colimits
-import Mathbin.Algebra.Category.Module.Projective
-import Mathbin.CategoryTheory.Abelian.Ext
-import Mathbin.CategoryTheory.Limits.Final
-import Mathbin.RingTheory.Noetherian
+import RingTheory.Ideal.Basic
+import Algebra.Category.Module.Colimits
+import Algebra.Category.Module.Projective
+import CategoryTheory.Abelian.Ext
+import CategoryTheory.Limits.Final
+import RingTheory.Noetherian
 
 #align_import algebra.homology.local_cohomology from "leanprover-community/mathlib"@"893964fc28cefbcffc7cb784ed00a2895b4e65cf"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2023 Emily Witt. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
-
-! This file was ported from Lean 3 source module algebra.homology.local_cohomology
-! leanprover-community/mathlib commit 893964fc28cefbcffc7cb784ed00a2895b4e65cf
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.RingTheory.Ideal.Basic
 import Mathbin.Algebra.Category.Module.Colimits
@@ -15,6 +10,8 @@ import Mathbin.CategoryTheory.Abelian.Ext
 import Mathbin.CategoryTheory.Limits.Final
 import Mathbin.RingTheory.Noetherian
 
+#align_import algebra.homology.local_cohomology from "leanprover-community/mathlib"@"893964fc28cefbcffc7cb784ed00a2895b4e65cf"
+
 /-!
 # Local cohomology.
 
Diff
@@ -127,16 +127,20 @@ variable {R : Type max u v v'} [CommRing R] {D : Type v} [SmallCategory D]
 
 variable {E : Type v'} [SmallCategory E] (I' : E ⥤ D) (I : D ⥤ Ideal R)
 
+#print localCohomology.diagramComp /-
 /-- Local cohomology along a composition of diagrams. -/
 def diagramComp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ diagram I i :=
   Iso.refl _
 #align local_cohomology.diagram_comp localCohomology.diagramComp
+-/
 
+#print localCohomology.isoOfFinal /-
 /-- Local cohomology agrees along precomposition with a cofinal diagram. -/
 def isoOfFinal [Functor.Initial I'] (i : ℕ) :
     ofDiagram.{max u v, v'} (I' ⋙ I) i ≅ ofDiagram.{max u v', v} I i :=
   HasColimit.isoOfNatIso (diagramComp _ _ _) ≪≫ Functor.Final.colimitIso _ _
 #align local_cohomology.iso_of_final localCohomology.isoOfFinal
+-/
 
 end
 
@@ -239,6 +243,7 @@ def idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLERadical J :=
 
 variable {I J K : Ideal R}
 
+#print localCohomology.Ideal.exists_pow_le_of_le_radical_of_fG /-
 /-- PORTING NOTE: This lemma should probably be moved to `ring_theory/finiteness.lean`
 to be near `ideal.exists_radical_pow_le_of_fg`, which it generalizes.
 -/
@@ -251,7 +256,9 @@ theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.
     I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
     _ ≤ J := hk
 #align local_cohomology.ideal.exists_pow_le_of_le_radical_of_fg localCohomology.Ideal.exists_pow_le_of_le_radical_of_fG
+-/
 
+#print localCohomology.ideal_powers_initial /-
 /-- The diagram of powers of `J` is initial in the diagram of all ideals with
 radical containing `J`. This uses noetherianness. -/
 instance ideal_powers_initial [hR : IsNoetherian R R] :
@@ -265,19 +272,23 @@ instance ideal_powers_initial [hR : IsNoetherian R R] :
       cases' le_total (unop j1.left) (unop j2.left) with h
       right; exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (AsTrue.get trivial)⟩
       left; exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (AsTrue.get trivial)⟩
-    · obtain ⟨k, hk⟩ := Ideal.exists_pow_le_of_le_radical_of_fg J'.2 (is_noetherian_def.mp hR _)
+    · obtain ⟨k, hk⟩ := ideal.exists_pow_le_of_le_radical_of_fg J'.2 (is_noetherian_def.mp hR _)
       exact ⟨costructured_arrow.mk (⟨⟨hk⟩⟩ : (ideal_powers_to_self_le_radical J).obj (op k) ⟶ J')⟩
 #align local_cohomology.ideal_powers_initial localCohomology.ideal_powers_initial
+-/
 
+#print localCohomology.isoSelfLERadical /-
 /-- Local cohomology (defined in terms of powers of `J`) agrees with local
 cohomology computed over all ideals with radical containing `J`. -/
-def isoSelfLeRadical (J : Ideal R) [IsNoetherian R R] (i : ℕ) :
+def isoSelfLERadical (J : Ideal R) [IsNoetherian R R] (i : ℕ) :
     localCohomology.ofSelfLERadical J i ≅ localCohomology J i :=
   (localCohomology.isoOfFinal.{u, u, 0} (idealPowersToSelfLERadical J) (selfLERadicalDiagram J)
         i).symm ≪≫
     HasColimit.isoOfNatIso (Iso.refl _)
-#align local_cohomology.iso_self_le_radical localCohomology.isoSelfLeRadical
+#align local_cohomology.iso_self_le_radical localCohomology.isoSelfLERadical
+-/
 
+#print localCohomology.SelfLERadical.cast /-
 /-- Casting from the full subcategory of ideals with radical containing `J` to the full
 subcategory of ideals with radical containing `K`. -/
 def SelfLERadical.cast (hJK : J.radical = K.radical) : SelfLERadical J ⥤ SelfLERadical K :=
@@ -286,7 +297,9 @@ def SelfLERadical.cast (hJK : J.radical = K.radical) : SelfLERadical J ⥤ SelfL
     rw [← Ideal.radical_le_radical_iff] at hL ⊢
     exact hJK.symm.trans_le hL
 #align local_cohomology.self_le_radical.cast localCohomology.SelfLERadical.cast
+-/
 
+#print localCohomology.SelfLERadical.castIsEquivalence /-
 -- TODO generalize this to the equivalence of full categories for any `iff`.
 instance SelfLERadical.castIsEquivalence (hJK : J.radical = K.radical) :
     IsEquivalence (SelfLERadical.cast hJK)
@@ -295,19 +308,24 @@ instance SelfLERadical.castIsEquivalence (hJK : J.radical = K.radical) :
   unitIso := by tidy
   counitIso := by tidy
 #align local_cohomology.self_le_radical.cast_is_equivalence localCohomology.SelfLERadical.castIsEquivalence
+-/
 
+#print localCohomology.SelfLERadical.isoOfSameRadical /-
 /-- The natural isomorphism between local cohomology defined using the `of_self_le_radical`
 diagram, assuming `J.radical = K.radical`. -/
 def SelfLERadical.isoOfSameRadical (hJK : J.radical = K.radical) (i : ℕ) :
     ofSelfLERadical J i ≅ ofSelfLERadical K i :=
   (isoOfFinal.{u, u, u} (SelfLERadical.cast hJK.symm) _ _).symm
 #align local_cohomology.self_le_radical.iso_of_same_radical localCohomology.SelfLERadical.isoOfSameRadical
+-/
 
+#print localCohomology.isoOfSameRadical /-
 /-- Local cohomology agrees on ideals with the same radical. -/
 def isoOfSameRadical [IsNoetherian R R] (hJK : J.radical = K.radical) (i : ℕ) :
     localCohomology J i ≅ localCohomology K i :=
-  (isoSelfLeRadical J i).symm ≪≫ SelfLERadical.isoOfSameRadical hJK i ≪≫ isoSelfLeRadical K i
+  (isoSelfLERadical J i).symm ≪≫ SelfLERadical.isoOfSameRadical hJK i ≪≫ isoSelfLERadical K i
 #align local_cohomology.iso_of_same_radical localCohomology.isoOfSameRadical
+-/
 
 end LocalCohomologyEquiv
 
Diff
@@ -79,11 +79,11 @@ def ringModIdeals (I : D ⥤ Ideal R) : D ⥤ ModuleCat.{u} R
 #align local_cohomology.ring_mod_ideals localCohomology.ringModIdeals
 -/
 
-#print localCohomology.moduleCat_enough_projectives' /-
+#print localCohomology.moduleCat_enoughProjectives' /-
 -- TODO:  Once this file is ported, move this file to the right location.
-instance moduleCat_enough_projectives' : EnoughProjectives (ModuleCat.{u} R) :=
+instance moduleCat_enoughProjectives' : EnoughProjectives (ModuleCat.{u} R) :=
   ModuleCat.moduleCat_enoughProjectives.{u}
-#align local_cohomology.Module_enough_projectives' localCohomology.moduleCat_enough_projectives'
+#align local_cohomology.Module_enough_projectives' localCohomology.moduleCat_enoughProjectives'
 -/
 
 #print localCohomology.diagram /-
@@ -153,26 +153,26 @@ def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R
 #align local_cohomology.ideal_powers_diagram localCohomology.idealPowersDiagram
 -/
 
-#print localCohomology.SelfLeRadical /-
+#print localCohomology.SelfLERadical /-
 /-- The full subcategory of all ideals with radical containing `J` -/
-def SelfLeRadical (J : Ideal R) : Type u :=
+def SelfLERadical (J : Ideal R) : Type u :=
   FullSubcategory fun J' : Ideal R => J ≤ J'.radical
 deriving Category
-#align local_cohomology.self_le_radical localCohomology.SelfLeRadical
+#align local_cohomology.self_le_radical localCohomology.SelfLERadical
 -/
 
-#print localCohomology.SelfLeRadical.inhabited /-
-instance SelfLeRadical.inhabited (J : Ideal R) : Inhabited (SelfLeRadical J)
+#print localCohomology.SelfLERadical.inhabited /-
+instance SelfLERadical.inhabited (J : Ideal R) : Inhabited (SelfLERadical J)
     where default := ⟨J, Ideal.le_radical⟩
-#align local_cohomology.self_le_radical.inhabited localCohomology.SelfLeRadical.inhabited
+#align local_cohomology.self_le_radical.inhabited localCohomology.SelfLERadical.inhabited
 -/
 
-#print localCohomology.selfLeRadicalDiagram /-
+#print localCohomology.selfLERadicalDiagram /-
 /-- The diagram of all ideals with radical containing `J`, represented as a functor.
 This is the "largest" diagram that computes local cohomology with support in `J`. -/
-def selfLeRadicalDiagram (J : Ideal R) : SelfLeRadical J ⥤ Ideal R :=
+def selfLERadicalDiagram (J : Ideal R) : SelfLERadical J ⥤ Ideal R :=
   fullSubcategoryInclusion _
-#align local_cohomology.self_le_radical_diagram localCohomology.selfLeRadicalDiagram
+#align local_cohomology.self_le_radical_diagram localCohomology.selfLERadicalDiagram
 -/
 
 end Diagrams
@@ -199,12 +199,12 @@ def localCohomology (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u}
 #align local_cohomology localCohomology
 -/
 
-#print localCohomology.ofSelfLeRadical /-
+#print localCohomology.ofSelfLERadical /-
 /-- Local cohomology as the direct limit of `Ext^i(R/J', M)` over *all* ideals `J'` with radical
 containing `J`. -/
-def localCohomology.ofSelfLeRadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
-  ofDiagram.{u} (selfLeRadicalDiagram.{u} J) i
-#align local_cohomology.of_self_le_radical localCohomology.ofSelfLeRadical
+def localCohomology.ofSelfLERadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
+  ofDiagram.{u} (selfLERadicalDiagram.{u} J) i
+#align local_cohomology.of_self_le_radical localCohomology.ofSelfLERadical
 -/
 
 end ModelsForLocalCohomology
@@ -224,17 +224,17 @@ section LocalCohomologyEquiv
 
 variable {R : Type u} [CommRing R]
 
-#print localCohomology.idealPowersToSelfLeRadical /-
+#print localCohomology.idealPowersToSelfLERadical /-
 /-- Lifting `ideal_powers_diagram J` from a diagram valued in `ideals R` to a diagram
 valued in `self_le_radical J`. -/
-def idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLeRadical J :=
+def idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLERadical J :=
   FullSubcategory.lift _ (idealPowersDiagram J) fun k =>
     by
     change _ ≤ (J ^ unop k).radical
     cases unop k
     · simp only [Ideal.radical_top, pow_zero, Ideal.one_eq_top, le_top]
     · simp only [J.radical_pow _ n.succ_pos, Ideal.le_radical]
-#align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLeRadical
+#align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLERadical
 -/
 
 variable {I J K : Ideal R}
@@ -255,7 +255,7 @@ theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.
 /-- The diagram of powers of `J` is initial in the diagram of all ideals with
 radical containing `J`. This uses noetherianness. -/
 instance ideal_powers_initial [hR : IsNoetherian R R] :
-    Functor.Initial (idealPowersToSelfLeRadical J)
+    Functor.Initial (idealPowersToSelfLERadical J)
     where out J' := by
     apply @zigzag_is_connected _ _ _
     · intro j1 j2
@@ -265,48 +265,48 @@ instance ideal_powers_initial [hR : IsNoetherian R R] :
       cases' le_total (unop j1.left) (unop j2.left) with h
       right; exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (AsTrue.get trivial)⟩
       left; exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (AsTrue.get trivial)⟩
-    · obtain ⟨k, hk⟩ := Ideal.exists_pow_le_of_le_radical_of_fG J'.2 (is_noetherian_def.mp hR _)
+    · obtain ⟨k, hk⟩ := Ideal.exists_pow_le_of_le_radical_of_fg J'.2 (is_noetherian_def.mp hR _)
       exact ⟨costructured_arrow.mk (⟨⟨hk⟩⟩ : (ideal_powers_to_self_le_radical J).obj (op k) ⟶ J')⟩
 #align local_cohomology.ideal_powers_initial localCohomology.ideal_powers_initial
 
 /-- Local cohomology (defined in terms of powers of `J`) agrees with local
 cohomology computed over all ideals with radical containing `J`. -/
 def isoSelfLeRadical (J : Ideal R) [IsNoetherian R R] (i : ℕ) :
-    localCohomology.ofSelfLeRadical J i ≅ localCohomology J i :=
-  (localCohomology.isoOfFinal.{u, u, 0} (idealPowersToSelfLeRadical J) (selfLeRadicalDiagram J)
+    localCohomology.ofSelfLERadical J i ≅ localCohomology J i :=
+  (localCohomology.isoOfFinal.{u, u, 0} (idealPowersToSelfLERadical J) (selfLERadicalDiagram J)
         i).symm ≪≫
     HasColimit.isoOfNatIso (Iso.refl _)
 #align local_cohomology.iso_self_le_radical localCohomology.isoSelfLeRadical
 
 /-- Casting from the full subcategory of ideals with radical containing `J` to the full
 subcategory of ideals with radical containing `K`. -/
-def SelfLeRadical.cast (hJK : J.radical = K.radical) : SelfLeRadical J ⥤ SelfLeRadical K :=
+def SelfLERadical.cast (hJK : J.radical = K.radical) : SelfLERadical J ⥤ SelfLERadical K :=
   FullSubcategory.map fun L hL =>
     by
     rw [← Ideal.radical_le_radical_iff] at hL ⊢
     exact hJK.symm.trans_le hL
-#align local_cohomology.self_le_radical.cast localCohomology.SelfLeRadical.cast
+#align local_cohomology.self_le_radical.cast localCohomology.SelfLERadical.cast
 
 -- TODO generalize this to the equivalence of full categories for any `iff`.
-instance SelfLeRadical.castIsEquivalence (hJK : J.radical = K.radical) :
-    IsEquivalence (SelfLeRadical.cast hJK)
+instance SelfLERadical.castIsEquivalence (hJK : J.radical = K.radical) :
+    IsEquivalence (SelfLERadical.cast hJK)
     where
-  inverse := SelfLeRadical.cast hJK.symm
+  inverse := SelfLERadical.cast hJK.symm
   unitIso := by tidy
   counitIso := by tidy
-#align local_cohomology.self_le_radical.cast_is_equivalence localCohomology.SelfLeRadical.castIsEquivalence
+#align local_cohomology.self_le_radical.cast_is_equivalence localCohomology.SelfLERadical.castIsEquivalence
 
 /-- The natural isomorphism between local cohomology defined using the `of_self_le_radical`
 diagram, assuming `J.radical = K.radical`. -/
-def SelfLeRadical.isoOfSameRadical (hJK : J.radical = K.radical) (i : ℕ) :
-    ofSelfLeRadical J i ≅ ofSelfLeRadical K i :=
-  (isoOfFinal.{u, u, u} (SelfLeRadical.cast hJK.symm) _ _).symm
-#align local_cohomology.self_le_radical.iso_of_same_radical localCohomology.SelfLeRadical.isoOfSameRadical
+def SelfLERadical.isoOfSameRadical (hJK : J.radical = K.radical) (i : ℕ) :
+    ofSelfLERadical J i ≅ ofSelfLERadical K i :=
+  (isoOfFinal.{u, u, u} (SelfLERadical.cast hJK.symm) _ _).symm
+#align local_cohomology.self_le_radical.iso_of_same_radical localCohomology.SelfLERadical.isoOfSameRadical
 
 /-- Local cohomology agrees on ideals with the same radical. -/
 def isoOfSameRadical [IsNoetherian R R] (hJK : J.radical = K.radical) (i : ℕ) :
     localCohomology J i ≅ localCohomology K i :=
-  (isoSelfLeRadical J i).symm ≪≫ SelfLeRadical.isoOfSameRadical hJK i ≪≫ isoSelfLeRadical K i
+  (isoSelfLeRadical J i).symm ≪≫ SelfLERadical.isoOfSameRadical hJK i ≪≫ isoSelfLeRadical K i
 #align local_cohomology.iso_of_same_radical localCohomology.isoOfSameRadical
 
 end LocalCohomologyEquiv
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
 
 ! This file was ported from Lean 3 source module algebra.homology.local_cohomology
-! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
+! leanprover-community/mathlib commit 893964fc28cefbcffc7cb784ed00a2895b4e65cf
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -12,7 +12,8 @@ import Mathbin.RingTheory.Ideal.Basic
 import Mathbin.Algebra.Category.Module.Colimits
 import Mathbin.Algebra.Category.Module.Projective
 import Mathbin.CategoryTheory.Abelian.Ext
-import Mathbin.RingTheory.Finiteness
+import Mathbin.CategoryTheory.Limits.Final
+import Mathbin.RingTheory.Noetherian
 
 /-!
 # Local cohomology.
@@ -47,7 +48,6 @@ local cohomology, local cohomology modules
     * the right-derived functor definition
     * the characterization as the limit of Koszul homology
     * the characterization as the cohomology of a Cech-like complex
-* Prove that local cohomology depends only on the radical of the ideal
 * Establish long exact sequence(s) in local cohomology
 -/
 
@@ -60,7 +60,7 @@ open CategoryTheory.Limits
 
 noncomputable section
 
-universe u v
+universe u v v'
 
 namespace localCohomology
 
@@ -107,10 +107,9 @@ variable {R : Type max u v} [CommRing R] {D : Type v} [SmallCategory D]
 In this definition we do not assume any special property of the diagram `I`, but the relevant case
 will be where `I` is (cofinal with) the diagram of powers of a single given ideal.
 
-Below, we give two equivalent (to be shown) definitions of the usual local cohomology with support
+Below, we give two equivalent definitions of the usual local cohomology with support
 in an ideal `J`, `local_cohomology` and `local_cohomology.of_self_le_radical`.
 
-TODO: Show that any functor cofinal with `I` gives the same result.
  -/
 /-- `local_cohomology.of_diagram I i` is the the functor sending a module `M` over a commutative
 ring `R` to the direct limit of `Ext^i(R/J, M)`, where `J` ranges over a collection of ideals
@@ -122,6 +121,25 @@ def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCa
 
 end
 
+section
+
+variable {R : Type max u v v'} [CommRing R] {D : Type v} [SmallCategory D]
+
+variable {E : Type v'} [SmallCategory E] (I' : E ⥤ D) (I : D ⥤ Ideal R)
+
+/-- Local cohomology along a composition of diagrams. -/
+def diagramComp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ diagram I i :=
+  Iso.refl _
+#align local_cohomology.diagram_comp localCohomology.diagramComp
+
+/-- Local cohomology agrees along precomposition with a cofinal diagram. -/
+def isoOfFinal [Functor.Initial I'] (i : ℕ) :
+    ofDiagram.{max u v, v'} (I' ⋙ I) i ≅ ofDiagram.{max u v', v} I i :=
+  HasColimit.isoOfNatIso (diagramComp _ _ _) ≪≫ Functor.Final.colimitIso _ _
+#align local_cohomology.iso_of_final localCohomology.isoOfFinal
+
+end
+
 section Diagrams
 
 variable {R : Type u} [CommRing R]
@@ -189,20 +207,27 @@ def localCohomology.ofSelfLeRadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R 
 #align local_cohomology.of_self_le_radical localCohomology.ofSelfLeRadical
 -/
 
-/- TODO: Construct `local_cohomology J i ≅ local_cohomology.of_self_le_radical J i`. Use this to
-show that local cohomology depends only on `J.radical`. -/
 end ModelsForLocalCohomology
 
-section LocalCohomologyEquiv
+namespace localCohomology
 
-open localCohomology
+/-!
+Showing equivalence of different definitions of local cohomology.
+  * `local_cohomology.iso_self_le_radical` gives the isomorphism
+      `local_cohomology J i ≅ local_cohomology.of_self_le_radical J i`
+  * `local_cohomology.iso_of_same_radical` gives the isomorphism
+      `local_cohomology J i ≅ local_cohomology K i` when `J.radical = K.radical`.
+-/
 
-variable {R : Type u} [CommRing R] (I J : Ideal R)
+
+section LocalCohomologyEquiv
+
+variable {R : Type u} [CommRing R]
 
 #print localCohomology.idealPowersToSelfLeRadical /-
 /-- Lifting `ideal_powers_diagram J` from a diagram valued in `ideals R` to a diagram
 valued in `self_le_radical J`. -/
-def localCohomology.idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLeRadical J :=
+def idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLeRadical J :=
   FullSubcategory.lift _ (idealPowersDiagram J) fun k =>
     by
     change _ ≤ (J ^ unop k).radical
@@ -212,20 +237,11 @@ def localCohomology.idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ Sel
 #align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLeRadical
 -/
 
-#print localCohomology.idealPowersToSelfLeRadicalCompInclusion /-
-/-- The composition with the inclusion into `ideals R` is isomorphic to `ideal_powers_diagram J`. -/
-def localCohomology.idealPowersToSelfLeRadicalCompInclusion (J : Ideal R) :
-    localCohomology.idealPowersToSelfLeRadical J ⋙ selfLeRadicalDiagram J ≅ idealPowersDiagram J :=
-  FullSubcategory.lift_comp_inclusion _ _ _
-#align local_cohomology.ideal_powers_to_self_le_radical_comp_inclusion localCohomology.idealPowersToSelfLeRadicalCompInclusion
--/
-
-#print Ideal.exists_pow_le_of_le_radical_of_fG /-
-/-- The lemma below essentially says that `ideal_powers_to_self_le_radical I` is initial in
-`self_le_radical_diagram I`.
+variable {I J K : Ideal R}
 
-PORTING NOTE: This lemma should probably be moved to `ring_theory/finiteness.lean`
-to be near `ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
+/-- PORTING NOTE: This lemma should probably be moved to `ring_theory/finiteness.lean`
+to be near `ideal.exists_radical_pow_le_of_fg`, which it generalizes.
+-/
 theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
     ∃ k : ℕ, I ^ k ≤ J :=
   by
@@ -234,8 +250,66 @@ theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.
   calc
     I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
     _ ≤ J := hk
-#align ideal.exists_pow_le_of_le_radical_of_fg Ideal.exists_pow_le_of_le_radical_of_fG
--/
+#align local_cohomology.ideal.exists_pow_le_of_le_radical_of_fg localCohomology.Ideal.exists_pow_le_of_le_radical_of_fG
+
+/-- The diagram of powers of `J` is initial in the diagram of all ideals with
+radical containing `J`. This uses noetherianness. -/
+instance ideal_powers_initial [hR : IsNoetherian R R] :
+    Functor.Initial (idealPowersToSelfLeRadical J)
+    where out J' := by
+    apply @zigzag_is_connected _ _ _
+    · intro j1 j2
+      apply Relation.ReflTransGen.single
+      -- The inclusions `J^n1 ≤ J'` and `J^n2 ≤ J'` always form a triangle, based on
+      -- which exponent is larger.
+      cases' le_total (unop j1.left) (unop j2.left) with h
+      right; exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (AsTrue.get trivial)⟩
+      left; exact ⟨costructured_arrow.hom_mk (hom_of_le h).op (AsTrue.get trivial)⟩
+    · obtain ⟨k, hk⟩ := Ideal.exists_pow_le_of_le_radical_of_fG J'.2 (is_noetherian_def.mp hR _)
+      exact ⟨costructured_arrow.mk (⟨⟨hk⟩⟩ : (ideal_powers_to_self_le_radical J).obj (op k) ⟶ J')⟩
+#align local_cohomology.ideal_powers_initial localCohomology.ideal_powers_initial
+
+/-- Local cohomology (defined in terms of powers of `J`) agrees with local
+cohomology computed over all ideals with radical containing `J`. -/
+def isoSelfLeRadical (J : Ideal R) [IsNoetherian R R] (i : ℕ) :
+    localCohomology.ofSelfLeRadical J i ≅ localCohomology J i :=
+  (localCohomology.isoOfFinal.{u, u, 0} (idealPowersToSelfLeRadical J) (selfLeRadicalDiagram J)
+        i).symm ≪≫
+    HasColimit.isoOfNatIso (Iso.refl _)
+#align local_cohomology.iso_self_le_radical localCohomology.isoSelfLeRadical
+
+/-- Casting from the full subcategory of ideals with radical containing `J` to the full
+subcategory of ideals with radical containing `K`. -/
+def SelfLeRadical.cast (hJK : J.radical = K.radical) : SelfLeRadical J ⥤ SelfLeRadical K :=
+  FullSubcategory.map fun L hL =>
+    by
+    rw [← Ideal.radical_le_radical_iff] at hL ⊢
+    exact hJK.symm.trans_le hL
+#align local_cohomology.self_le_radical.cast localCohomology.SelfLeRadical.cast
+
+-- TODO generalize this to the equivalence of full categories for any `iff`.
+instance SelfLeRadical.castIsEquivalence (hJK : J.radical = K.radical) :
+    IsEquivalence (SelfLeRadical.cast hJK)
+    where
+  inverse := SelfLeRadical.cast hJK.symm
+  unitIso := by tidy
+  counitIso := by tidy
+#align local_cohomology.self_le_radical.cast_is_equivalence localCohomology.SelfLeRadical.castIsEquivalence
+
+/-- The natural isomorphism between local cohomology defined using the `of_self_le_radical`
+diagram, assuming `J.radical = K.radical`. -/
+def SelfLeRadical.isoOfSameRadical (hJK : J.radical = K.radical) (i : ℕ) :
+    ofSelfLeRadical J i ≅ ofSelfLeRadical K i :=
+  (isoOfFinal.{u, u, u} (SelfLeRadical.cast hJK.symm) _ _).symm
+#align local_cohomology.self_le_radical.iso_of_same_radical localCohomology.SelfLeRadical.isoOfSameRadical
+
+/-- Local cohomology agrees on ideals with the same radical. -/
+def isoOfSameRadical [IsNoetherian R R] (hJK : J.radical = K.radical) (i : ℕ) :
+    localCohomology J i ≅ localCohomology K i :=
+  (isoSelfLeRadical J i).symm ≪≫ SelfLeRadical.isoOfSameRadical hJK i ≪≫ isoSelfLeRadical K i
+#align local_cohomology.iso_of_same_radical localCohomology.isoOfSameRadical
 
 end LocalCohomologyEquiv
 
+end localCohomology
+
Diff
@@ -69,6 +69,7 @@ section
 
 variable {R : Type u} [CommRing R] {D : Type v} [SmallCategory D]
 
+#print localCohomology.ringModIdeals /-
 /-- The directed system of `R`-modules of the form `R/J`, where `J` is an ideal of `R`,
 determined by the functor `I`  -/
 def ringModIdeals (I : D ⥤ Ideal R) : D ⥤ ModuleCat.{u} R
@@ -76,6 +77,7 @@ def ringModIdeals (I : D ⥤ Ideal R) : D ⥤ ModuleCat.{u} R
   obj t := ModuleCat.of R <| R ⧸ I.obj t
   map s t w := Submodule.mapQ _ _ LinearMap.id (I.map w).down.down
 #align local_cohomology.ring_mod_ideals localCohomology.ringModIdeals
+-/
 
 #print localCohomology.moduleCat_enough_projectives' /-
 -- TODO:  Once this file is ported, move this file to the right location.
@@ -84,11 +86,13 @@ instance moduleCat_enough_projectives' : EnoughProjectives (ModuleCat.{u} R) :=
 #align local_cohomology.Module_enough_projectives' localCohomology.moduleCat_enough_projectives'
 -/
 
+#print localCohomology.diagram /-
 /-- The diagram we will take the colimit of to define local cohomology, corresponding to the
 directed system determined by the functor `I` -/
 def diagram (I : D ⥤ Ideal R) (i : ℕ) : Dᵒᵖ ⥤ ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
   (ringModIdeals I).op ⋙ Ext R (ModuleCat.{u} R) i
 #align local_cohomology.diagram localCohomology.diagram
+-/
 
 end
 
@@ -98,6 +102,7 @@ section
 -- along diagrams either in Type, or in the same universe as the ring, and we need to cover both.
 variable {R : Type max u v} [CommRing R] {D : Type v} [SmallCategory D]
 
+#print localCohomology.ofDiagram /-
 /-
 In this definition we do not assume any special property of the diagram `I`, but the relevant case
 will be where `I` is (cofinal with) the diagram of powers of a single given ideal.
@@ -113,6 +118,7 @@ of `R`, represented as a functor `I`. -/
 def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCat.{max u v} R :=
   colimit (diagram.{max u v, v} I i)
 #align local_cohomology.of_diagram localCohomology.ofDiagram
+-/
 
 end
 
@@ -120,12 +126,14 @@ section Diagrams
 
 variable {R : Type u} [CommRing R]
 
+#print localCohomology.idealPowersDiagram /-
 /-- The functor sending a natural number `i` to the `i`-th power of the ideal `J` -/
 def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R
     where
   obj t := J ^ unop t
   map s t w := ⟨⟨Ideal.pow_le_pow w.unop.down.down⟩⟩
 #align local_cohomology.ideal_powers_diagram localCohomology.idealPowersDiagram
+-/
 
 #print localCohomology.SelfLeRadical /-
 /-- The full subcategory of all ideals with radical containing `J` -/
@@ -141,11 +149,13 @@ instance SelfLeRadical.inhabited (J : Ideal R) : Inhabited (SelfLeRadical J)
 #align local_cohomology.self_le_radical.inhabited localCohomology.SelfLeRadical.inhabited
 -/
 
+#print localCohomology.selfLeRadicalDiagram /-
 /-- The diagram of all ideals with radical containing `J`, represented as a functor.
 This is the "largest" diagram that computes local cohomology with support in `J`. -/
 def selfLeRadicalDiagram (J : Ideal R) : SelfLeRadical J ⥤ Ideal R :=
   fullSubcategoryInclusion _
 #align local_cohomology.self_le_radical_diagram localCohomology.selfLeRadicalDiagram
+-/
 
 end Diagrams
 
@@ -189,6 +199,7 @@ open localCohomology
 
 variable {R : Type u} [CommRing R] (I J : Ideal R)
 
+#print localCohomology.idealPowersToSelfLeRadical /-
 /-- Lifting `ideal_powers_diagram J` from a diagram valued in `ideals R` to a diagram
 valued in `self_le_radical J`. -/
 def localCohomology.idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLeRadical J :=
@@ -199,13 +210,17 @@ def localCohomology.idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ Sel
     · simp only [Ideal.radical_top, pow_zero, Ideal.one_eq_top, le_top]
     · simp only [J.radical_pow _ n.succ_pos, Ideal.le_radical]
 #align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLeRadical
+-/
 
+#print localCohomology.idealPowersToSelfLeRadicalCompInclusion /-
 /-- The composition with the inclusion into `ideals R` is isomorphic to `ideal_powers_diagram J`. -/
 def localCohomology.idealPowersToSelfLeRadicalCompInclusion (J : Ideal R) :
     localCohomology.idealPowersToSelfLeRadical J ⋙ selfLeRadicalDiagram J ≅ idealPowersDiagram J :=
   FullSubcategory.lift_comp_inclusion _ _ _
 #align local_cohomology.ideal_powers_to_self_le_radical_comp_inclusion localCohomology.idealPowersToSelfLeRadicalCompInclusion
+-/
 
+#print Ideal.exists_pow_le_of_le_radical_of_fG /-
 /-- The lemma below essentially says that `ideal_powers_to_self_le_radical I` is initial in
 `self_le_radical_diagram I`.
 
@@ -220,6 +235,7 @@ theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.
     I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
     _ ≤ J := hk
 #align ideal.exists_pow_le_of_le_radical_of_fg Ideal.exists_pow_le_of_le_radical_of_fG
+-/
 
 end LocalCohomologyEquiv
 
Diff
@@ -219,7 +219,6 @@ theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.
   calc
     I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
     _ ≤ J := hk
-    
 #align ideal.exists_pow_le_of_le_radical_of_fg Ideal.exists_pow_le_of_le_radical_of_fG
 
 end LocalCohomologyEquiv
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
 
 ! This file was ported from Lean 3 source module algebra.homology.local_cohomology
-! leanprover-community/mathlib commit 5a684ce82399d820475609907c6ef8dba5b1b97c
+! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -17,6 +17,9 @@ import Mathbin.RingTheory.Finiteness
 /-!
 # Local cohomology.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the `i`-th local cohomology module of an `R`-module `M` with support in an
 ideal `I` of `R`, where `R` is a commutative ring, as the direct limit of Ext modules:
 
Diff
@@ -72,18 +72,20 @@ def ringModIdeals (I : D ⥤ Ideal R) : D ⥤ ModuleCat.{u} R
     where
   obj t := ModuleCat.of R <| R ⧸ I.obj t
   map s t w := Submodule.mapQ _ _ LinearMap.id (I.map w).down.down
-#align local_cohomology.ring_mod_ideals LocalCohomology.ringModIdeals
+#align local_cohomology.ring_mod_ideals localCohomology.ringModIdeals
 
+#print localCohomology.moduleCat_enough_projectives' /-
 -- TODO:  Once this file is ported, move this file to the right location.
 instance moduleCat_enough_projectives' : EnoughProjectives (ModuleCat.{u} R) :=
   ModuleCat.moduleCat_enoughProjectives.{u}
-#align local_cohomology.Module_enough_projectives' LocalCohomology.moduleCat_enough_projectives'
+#align local_cohomology.Module_enough_projectives' localCohomology.moduleCat_enough_projectives'
+-/
 
 /-- The diagram we will take the colimit of to define local cohomology, corresponding to the
 directed system determined by the functor `I` -/
 def diagram (I : D ⥤ Ideal R) (i : ℕ) : Dᵒᵖ ⥤ ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
   (ringModIdeals I).op ⋙ Ext R (ModuleCat.{u} R) i
-#align local_cohomology.diagram LocalCohomology.diagram
+#align local_cohomology.diagram localCohomology.diagram
 
 end
 
@@ -107,7 +109,7 @@ ring `R` to the direct limit of `Ext^i(R/J, M)`, where `J` ranges over a collect
 of `R`, represented as a functor `I`. -/
 def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCat.{max u v} R :=
   colimit (diagram.{max u v, v} I i)
-#align local_cohomology.of_diagram LocalCohomology.ofDiagram
+#align local_cohomology.of_diagram localCohomology.ofDiagram
 
 end
 
@@ -120,23 +122,27 @@ def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R
     where
   obj t := J ^ unop t
   map s t w := ⟨⟨Ideal.pow_le_pow w.unop.down.down⟩⟩
-#align local_cohomology.ideal_powers_diagram LocalCohomology.idealPowersDiagram
+#align local_cohomology.ideal_powers_diagram localCohomology.idealPowersDiagram
 
+#print localCohomology.SelfLeRadical /-
 /-- The full subcategory of all ideals with radical containing `J` -/
 def SelfLeRadical (J : Ideal R) : Type u :=
   FullSubcategory fun J' : Ideal R => J ≤ J'.radical
 deriving Category
-#align local_cohomology.self_le_radical LocalCohomology.SelfLeRadical
+#align local_cohomology.self_le_radical localCohomology.SelfLeRadical
+-/
 
+#print localCohomology.SelfLeRadical.inhabited /-
 instance SelfLeRadical.inhabited (J : Ideal R) : Inhabited (SelfLeRadical J)
     where default := ⟨J, Ideal.le_radical⟩
-#align local_cohomology.self_le_radical.inhabited LocalCohomology.SelfLeRadical.inhabited
+#align local_cohomology.self_le_radical.inhabited localCohomology.SelfLeRadical.inhabited
+-/
 
 /-- The diagram of all ideals with radical containing `J`, represented as a functor.
 This is the "largest" diagram that computes local cohomology with support in `J`. -/
 def selfLeRadicalDiagram (J : Ideal R) : SelfLeRadical J ⥤ Ideal R :=
   fullSubcategoryInclusion _
-#align local_cohomology.self_le_radical_diagram LocalCohomology.selfLeRadicalDiagram
+#align local_cohomology.self_le_radical_diagram localCohomology.selfLeRadicalDiagram
 
 end Diagrams
 
@@ -153,18 +159,22 @@ open localCohomology
 
 variable {R : Type u} [CommRing R]
 
+#print localCohomology /-
 /-- `local_cohomology J i` is `i`-th the local cohomology module of a module `M` over
 a commutative ring `R` with support in the ideal `J` of `R`, defined as the direct limit
 of `Ext^i(R/J^t, M)` over all powers `t : ℕ`. -/
 def localCohomology (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
   ofDiagram (idealPowersDiagram J) i
 #align local_cohomology localCohomology
+-/
 
+#print localCohomology.ofSelfLeRadical /-
 /-- Local cohomology as the direct limit of `Ext^i(R/J', M)` over *all* ideals `J'` with radical
 containing `J`. -/
 def localCohomology.ofSelfLeRadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
   ofDiagram.{u} (selfLeRadicalDiagram.{u} J) i
 #align local_cohomology.of_self_le_radical localCohomology.ofSelfLeRadical
+-/
 
 /- TODO: Construct `local_cohomology J i ≅ local_cohomology.of_self_le_radical J i`. Use this to
 show that local cohomology depends only on `J.radical`. -/
Diff
@@ -124,7 +124,8 @@ def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R
 
 /-- The full subcategory of all ideals with radical containing `J` -/
 def SelfLeRadical (J : Ideal R) : Type u :=
-  FullSubcategory fun J' : Ideal R => J ≤ J'.radical deriving Category
+  FullSubcategory fun J' : Ideal R => J ≤ J'.radical
+deriving Category
 #align local_cohomology.self_le_radical LocalCohomology.SelfLeRadical
 
 instance SelfLeRadical.inhabited (J : Ideal R) : Inhabited (SelfLeRadical J)
Diff
@@ -82,7 +82,7 @@ instance moduleCat_enough_projectives' : EnoughProjectives (ModuleCat.{u} R) :=
 /-- The diagram we will take the colimit of to define local cohomology, corresponding to the
 directed system determined by the functor `I` -/
 def diagram (I : D ⥤ Ideal R) (i : ℕ) : Dᵒᵖ ⥤ ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
-  (ringModIdeals I).op ⋙ ext R (ModuleCat.{u} R) i
+  (ringModIdeals I).op ⋙ Ext R (ModuleCat.{u} R) i
 #align local_cohomology.diagram LocalCohomology.diagram
 
 end

Changes in mathlib4

mathlib3
mathlib4
chore(CategoryTheory): move Full, Faithful, EssSurj, IsEquivalence and ReflectsIsomorphisms to the Functor namespace (#11985)

These notions on functors are now Functor.Full, Functor.Faithful, Functor.EssSurj, Functor.IsEquivalence, Functor.ReflectsIsomorphisms. Deprecated aliases are introduced for the previous names.

Diff
@@ -274,7 +274,7 @@ def SelfLERadical.cast (hJK : J.radical = K.radical) : SelfLERadical J ⥤ SelfL
 
 -- TODO generalize this to the equivalence of full categories for any `iff`.
 instance SelfLERadical.castIsEquivalence (hJK : J.radical = K.radical) :
-    IsEquivalence (SelfLERadical.cast hJK) where
+    (SelfLERadical.cast hJK).IsEquivalence where
   inverse := SelfLERadical.cast hJK.symm
   unitIso := Iso.refl _
   counitIso := Iso.refl _
chore: replace PORTING NOTE by Porting note (#11908)
Diff
@@ -226,7 +226,7 @@ variable {I J K : Ideal R}
 /-- The lemma below essentially says that `idealPowersToSelfLERadical I` is initial in
 `selfLERadicalDiagram I`.
 
-PORTING NOTE: This lemma should probably be moved to `Mathlib/RingTheory/Finiteness`
+Porting note: This lemma should probably be moved to `Mathlib/RingTheory/Finiteness`
 to be near `Ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
 theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
     ∃ k : ℕ, I ^ k ≤ J := by
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -119,7 +119,6 @@ end
 section
 
 variable {R : Type max u v v'} [CommRing R] {D : Type v} [SmallCategory D]
-
 variable {E : Type v'} [SmallCategory E] (I' : E ⥤ D) (I : D ⥤ Ideal R)
 
 /-- Local cohomology along a composition of diagrams. -/
chore: classify todo porting notes (#11216)

Classifies by adding issue number #11215 to porting notes claiming "TODO".

Diff
@@ -74,7 +74,7 @@ def ringModIdeals (I : D ⥤ Ideal R) : D ⥤ ModuleCat.{u} R where
   map_comp f g := by apply Submodule.linearMap_qext; rfl
 #align local_cohomology.ring_mod_ideals localCohomology.ringModIdeals
 
--- Porting note: TODO:  Once this file is ported, move this instance to the right location.
+-- Porting note (#11215): TODO:  Once this file is ported, move this instance to the right location.
 instance moduleCat_enoughProjectives' : EnoughProjectives (ModuleCat.{u} R) :=
   ModuleCat.moduleCat_enoughProjectives.{u}
 set_option linter.uppercaseLean3 false in
chore: Golf Ideal.radical_pow (#11144)

Also make n implicit and replace 0 < n with n ≠ 0

Diff
@@ -219,7 +219,7 @@ def idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLERadical J :=
     change _ ≤ (J ^ unop k).radical
     cases' unop k with n
     · simp [Ideal.radical_top, pow_zero, Ideal.one_eq_top, le_top, Nat.zero_eq]
-    · simp only [J.radical_pow _ n.succ_pos, Ideal.le_radical]
+    · simp only [J.radical_pow n.succ_ne_zero, Ideal.le_radical]
 #align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLERadical
 
 variable {I J K : Ideal R}
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -250,7 +250,7 @@ instance ideal_powers_initial [hR : IsNoetherian R R] :
       apply Relation.ReflTransGen.single
       -- The inclusions `J^n1 ≤ J'` and `J^n2 ≤ J'` always form a triangle, based on
       -- which exponent is larger.
-      cases' le_total (unop j1.left) (unop j2.left) with h h
+      rcases le_total (unop j1.left) (unop j2.left) with h | h
       right; exact ⟨CostructuredArrow.homMk (homOfLE h).op (AsTrue.get trivial)⟩
       left; exact ⟨CostructuredArrow.homMk (homOfLE h).op (AsTrue.get trivial)⟩
 #align local_cohomology.ideal_powers_initial localCohomology.ideal_powers_initial
chore: Rename pow monotonicity lemmas (#9095)

The names for lemmas about monotonicity of (a ^ ·) and (· ^ n) were a mess. This PR tidies up everything related by following the naming convention for (a * ·) and (· * b). Namely, (a ^ ·) is pow_right and (· ^ n) is pow_left in lemma names. All lemma renames follow the corresponding multiplication lemma names closely.

Renames

Algebra.GroupPower.Order

  • pow_monopow_right_mono
  • pow_le_powpow_le_pow_right
  • pow_le_pow_of_le_leftpow_le_pow_left
  • pow_lt_pow_of_lt_leftpow_lt_pow_left
  • strictMonoOn_powpow_left_strictMonoOn
  • pow_strictMono_rightpow_right_strictMono
  • pow_lt_powpow_lt_pow_right
  • pow_lt_pow_iffpow_lt_pow_iff_right
  • pow_le_pow_iffpow_le_pow_iff_right
  • self_lt_powlt_self_pow
  • strictAnti_powpow_right_strictAnti
  • pow_lt_pow_iff_of_lt_onepow_lt_pow_iff_right_of_lt_one
  • pow_lt_pow_of_lt_onepow_lt_pow_right_of_lt_one
  • lt_of_pow_lt_powlt_of_pow_lt_pow_left
  • le_of_pow_le_powle_of_pow_le_pow_left
  • pow_lt_pow₀pow_lt_pow_right₀

Algebra.GroupPower.CovariantClass

  • pow_le_pow_of_le_left'pow_le_pow_left'
  • nsmul_le_nsmul_of_le_rightnsmul_le_nsmul_right
  • pow_lt_pow'pow_lt_pow_right'
  • nsmul_lt_nsmulnsmul_lt_nsmul_left
  • pow_strictMono_leftpow_right_strictMono'
  • nsmul_strictMono_rightnsmul_left_strictMono
  • StrictMono.pow_right'StrictMono.pow_const
  • StrictMono.nsmul_leftStrictMono.const_nsmul
  • pow_strictMono_right'pow_left_strictMono
  • nsmul_strictMono_leftnsmul_right_strictMono
  • Monotone.pow_rightMonotone.pow_const
  • Monotone.nsmul_leftMonotone.const_nsmul
  • lt_of_pow_lt_pow'lt_of_pow_lt_pow_left'
  • lt_of_nsmul_lt_nsmullt_of_nsmul_lt_nsmul_right
  • pow_le_pow'pow_le_pow_right'
  • nsmul_le_nsmulnsmul_le_nsmul_left
  • pow_le_pow_of_le_one'pow_le_pow_right_of_le_one'
  • nsmul_le_nsmul_of_nonposnsmul_le_nsmul_left_of_nonpos
  • le_of_pow_le_pow'le_of_pow_le_pow_left'
  • le_of_nsmul_le_nsmul'le_of_nsmul_le_nsmul_right'
  • pow_le_pow_iff'pow_le_pow_iff_right'
  • nsmul_le_nsmul_iffnsmul_le_nsmul_iff_left
  • pow_lt_pow_iff'pow_lt_pow_iff_right'
  • nsmul_lt_nsmul_iffnsmul_lt_nsmul_iff_left

Data.Nat.Pow

  • Nat.pow_lt_pow_of_lt_leftNat.pow_lt_pow_left
  • Nat.pow_le_iff_le_leftNat.pow_le_pow_iff_left
  • Nat.pow_lt_iff_lt_leftNat.pow_lt_pow_iff_left

Lemmas added

  • pow_le_pow_iff_left
  • pow_lt_pow_iff_left
  • pow_right_injective
  • pow_right_inj
  • Nat.pow_le_pow_left to have the correct name since Nat.pow_le_pow_of_le_left is in Std.
  • Nat.pow_le_pow_right to have the correct name since Nat.pow_le_pow_of_le_right is in Std.

Lemmas removed

  • self_le_pow was a duplicate of le_self_pow.
  • Nat.pow_lt_pow_of_lt_right is defeq to pow_lt_pow_right.
  • Nat.pow_right_strictMono is defeq to pow_right_strictMono.
  • Nat.pow_le_iff_le_right is defeq to pow_le_pow_iff_right.
  • Nat.pow_lt_iff_lt_right is defeq to pow_lt_pow_iff_right.

Other changes

  • A bunch of proofs have been golfed.
  • Some lemma assumptions have been turned from 0 < n or 1 ≤ n to n ≠ 0.
  • A few Nat lemmas have been protected.
  • One docstring has been fixed.
Diff
@@ -145,7 +145,7 @@ variable {R : Type u} [CommRing R]
 /-- The functor sending a natural number `i` to the `i`-th power of the ideal `J` -/
 def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R where
   obj t := J ^ unop t
-  map w := ⟨⟨Ideal.pow_le_pow w.unop.down.down⟩⟩
+  map w := ⟨⟨Ideal.pow_le_pow_right w.unop.down.down⟩⟩
 #align local_cohomology.ideal_powers_diagram localCohomology.idealPowersDiagram
 
 /-- The full subcategory of all ideals with radical containing `J` -/
@@ -234,7 +234,7 @@ theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.
   obtain ⟨k, hk⟩ := J.exists_radical_pow_le_of_fg hJ
   use k
   calc
-    I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
+    I ^ k ≤ J.radical ^ k := Ideal.pow_right_mono hIJ _
     _ ≤ J := hk
 #align local_cohomology.ideal.exists_pow_le_of_le_radical_of_fg localCohomology.Ideal.exists_pow_le_of_le_radical_of_fG
 
chore: removing unneeded maxHeartbeats (#7761)

Due to recent changes in core we can reduce or remove many set_option maxHeartbeats statements.

I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.

This reduces us from 96 maxHeartbeats statements to 44. (There are 10 false positives in meta or testing code.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -122,7 +122,6 @@ variable {R : Type max u v v'} [CommRing R] {D : Type v} [SmallCategory D]
 
 variable {E : Type v'} [SmallCategory E] (I' : E ⥤ D) (I : D ⥤ Ideal R)
 
-set_option maxHeartbeats 250000 in
 /-- Local cohomology along a composition of diagrams. -/
 def diagramComp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ diagram I i :=
   Iso.refl _
style: fix wrapping of where (#7149)
Diff
@@ -159,8 +159,8 @@ def SelfLERadical (J : Ideal R) : Type u :=
 instance (J : Ideal R) : Category (SelfLERadical J) :=
   (FullSubcategory.category _)
 
-instance SelfLERadical.inhabited (J : Ideal R) : Inhabited (SelfLERadical J)
-    where default := ⟨J, Ideal.le_radical⟩
+instance SelfLERadical.inhabited (J : Ideal R) : Inhabited (SelfLERadical J) where
+  default := ⟨J, Ideal.le_radical⟩
 #align local_cohomology.self_le_radical.inhabited localCohomology.SelfLERadical.inhabited
 
 /-- The diagram of all ideals with radical containing `J`, represented as a functor.
chore: update/remove heart beat bumps (#6860)

We clean up heart beat bumps after #6474.

Diff
@@ -122,7 +122,7 @@ variable {R : Type max u v v'} [CommRing R] {D : Type v} [SmallCategory D]
 
 variable {E : Type v'} [SmallCategory E] (I' : E ⥤ D) (I : D ⥤ Ideal R)
 
-set_option maxHeartbeats 400000 in
+set_option maxHeartbeats 250000 in
 /-- Local cohomology along a composition of diagrams. -/
 def diagramComp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ diagram I i :=
   Iso.refl _
refactor: colimits in ModuleCat (#6925)

This PR refactors the construction of colimits of modules in order to prove that the forgetful functor to abelian groups preserves colimits.

Diff
@@ -94,6 +94,11 @@ section
 -- along diagrams either in Type, or in the same universe as the ring, and we need to cover both.
 variable {R : Type max u v} [CommRing R] {D : Type v} [SmallCategory D]
 
+lemma hasColimitDiagram (I : D ⥤ Ideal R) (i : ℕ) :
+    HasColimit (diagram I i) := by
+  have : HasColimitsOfShape Dᵒᵖ (AddCommGroupCatMax.{u, v}) := inferInstance
+  infer_instance
+
 /-
 In this definition we do not assume any special property of the diagram `I`, but the relevant case
 will be where `I` is (cofinal with) the diagram of powers of a single given ideal.
@@ -104,8 +109,9 @@ in an ideal `J`, `localCohomology` and `localCohomology.ofSelfLERadical`.
 /-- `localCohomology.ofDiagram I i` is the functor sending a module `M` over a commutative
 ring `R` to the direct limit of `Ext^i(R/J, M)`, where `J` ranges over a collection of ideals
 of `R`, represented as a functor `I`. -/
-def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCat.{max u v} R :=
-  colimit (diagram.{max u v, v} I i)
+def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCatMax.{u, v} R ⥤ ModuleCatMax.{u, v} R :=
+  have := hasColimitDiagram.{u, v} I i
+  colimit (diagram I i)
 #align local_cohomology.of_diagram localCohomology.ofDiagram
 
 end
@@ -123,9 +129,12 @@ def diagramComp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ diagram I i :=
 #align local_cohomology.diagram_comp localCohomology.diagramComp
 
 /-- Local cohomology agrees along precomposition with a cofinal diagram. -/
+@[nolint unusedHavesSuffices]
 def isoOfFinal [Functor.Initial I'] (i : ℕ) :
     ofDiagram.{max u v, v'} (I' ⋙ I) i ≅ ofDiagram.{max u v', v} I i :=
-  HasColimit.isoOfNatIso (diagramComp.{u} _ _ _) ≪≫ Functor.Final.colimitIso _ _
+  have := hasColimitDiagram.{max u v', v} I i
+  have := hasColimitDiagram.{max u v, v'} (I' ⋙ I) i
+  HasColimit.isoOfNatIso (diagramComp.{u} I' I i) ≪≫ Functor.Final.colimitIso _ _
 #align local_cohomology.iso_of_final localCohomology.isoOfFinal
 
 end
@@ -247,11 +256,6 @@ instance ideal_powers_initial [hR : IsNoetherian R R] :
       left; exact ⟨CostructuredArrow.homMk (homOfLE h).op (AsTrue.get trivial)⟩
 #align local_cohomology.ideal_powers_initial localCohomology.ideal_powers_initial
 
--- FIXME again, this instance is not found by `inferInstance`, but `#synth` finds it just fine.
--- #synth HasColimitsOfSize.{0, 0, u, u + 1} (ModuleCat.{u, u} R)
-instance : HasColimitsOfSize.{0, 0, u, u + 1} (ModuleCat.{u, u} R) :=
-  ModuleCat.Colimits.hasColimitsOfSize_zero_moduleCat.{u, u}
-
 example : HasColimitsOfSize.{0, 0, u, u + 1} (ModuleCat.{u, u} R) := inferInstance
 /-- Local cohomology (defined in terms of powers of `J`) agrees with local
 cohomology computed over all ideals with radical containing `J`. -/
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2023 Emily Witt. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
-
-! This file was ported from Lean 3 source module algebra.homology.local_cohomology
-! leanprover-community/mathlib commit 893964fc28cefbcffc7cb784ed00a2895b4e65cf
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.RingTheory.Ideal.Basic
 import Mathlib.Algebra.Category.ModuleCat.Colimits
@@ -16,6 +11,8 @@ import Mathlib.RingTheory.Finiteness
 import Mathlib.CategoryTheory.Limits.Final
 import Mathlib.RingTheory.Noetherian
 
+#align_import algebra.homology.local_cohomology from "leanprover-community/mathlib"@"893964fc28cefbcffc7cb784ed00a2895b4e65cf"
+
 
 /-!
 # Local cohomology.
feat: forward-port leanprover-community/mathlib#19105 (#5749)

This is Jake Levinson's work. It's a proof that local cohomology agrees for ideals with equal radicals.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Emily Witt, Scott Morrison, Jake Levinson, Sam van Gool
 
 ! This file was ported from Lean 3 source module algebra.homology.local_cohomology
-! leanprover-community/mathlib commit 5a684ce82399d820475609907c6ef8dba5b1b97c
+! leanprover-community/mathlib commit 893964fc28cefbcffc7cb784ed00a2895b4e65cf
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathlib.Algebra.Category.ModuleCat.Colimits
 import Mathlib.Algebra.Category.ModuleCat.Projective
 import Mathlib.CategoryTheory.Abelian.Ext
 import Mathlib.RingTheory.Finiteness
+import Mathlib.CategoryTheory.Limits.Final
+import Mathlib.RingTheory.Noetherian
+
 
 /-!
 # Local cohomology.
@@ -44,7 +47,6 @@ local cohomology, local cohomology modules
     * the right-derived functor definition
     * the characterization as the limit of Koszul homology
     * the characterization as the cohomology of a Cech-like complex
-* Prove that local cohomology depends only on the radical of the ideal
 * Establish long exact sequence(s) in local cohomology
 -/
 
@@ -57,7 +59,7 @@ open CategoryTheory.Limits
 
 noncomputable section
 
-universe u v
+universe u v v'
 
 namespace localCohomology
 
@@ -99,10 +101,8 @@ variable {R : Type max u v} [CommRing R] {D : Type v} [SmallCategory D]
 In this definition we do not assume any special property of the diagram `I`, but the relevant case
 will be where `I` is (cofinal with) the diagram of powers of a single given ideal.
 
-Below, we give two equivalent (to be shown) definitions of the usual local cohomology with support
+Below, we give two equivalent definitions of the usual local cohomology with support
 in an ideal `J`, `localCohomology` and `localCohomology.ofSelfLERadical`.
-
-TODO: Show that any functor cofinal with `I` gives the same result.
  -/
 /-- `localCohomology.ofDiagram I i` is the functor sending a module `M` over a commutative
 ring `R` to the direct limit of `Ext^i(R/J, M)`, where `J` ranges over a collection of ideals
@@ -113,6 +113,26 @@ def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCa
 
 end
 
+section
+
+variable {R : Type max u v v'} [CommRing R] {D : Type v} [SmallCategory D]
+
+variable {E : Type v'} [SmallCategory E] (I' : E ⥤ D) (I : D ⥤ Ideal R)
+
+set_option maxHeartbeats 400000 in
+/-- Local cohomology along a composition of diagrams. -/
+def diagramComp (i : ℕ) : diagram (I' ⋙ I) i ≅ I'.op ⋙ diagram I i :=
+  Iso.refl _
+#align local_cohomology.diagram_comp localCohomology.diagramComp
+
+/-- Local cohomology agrees along precomposition with a cofinal diagram. -/
+def isoOfFinal [Functor.Initial I'] (i : ℕ) :
+    ofDiagram.{max u v, v'} (I' ⋙ I) i ≅ ofDiagram.{max u v', v} I i :=
+  HasColimit.isoOfNatIso (diagramComp.{u} _ _ _) ≪≫ Functor.Final.colimitIso _ _
+#align local_cohomology.iso_of_final localCohomology.isoOfFinal
+
+end
+
 section Diagrams
 
 variable {R : Type u} [CommRing R]
@@ -126,14 +146,13 @@ def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R where
 /-- The full subcategory of all ideals with radical containing `J` -/
 def SelfLERadical (J : Ideal R) : Type u :=
   FullSubcategory fun J' : Ideal R => J ≤ J'.radical
---deriving Category
+#align local_cohomology.self_le_radical localCohomology.SelfLERadical
 
 -- Porting note: `deriving Category` is not able to derive this instance
+-- https://github.com/leanprover-community/mathlib4/issues/5020
 instance (J : Ideal R) : Category (SelfLERadical J) :=
   (FullSubcategory.category _)
 
-#align local_cohomology.self_le_radical localCohomology.SelfLERadical
-
 instance SelfLERadical.inhabited (J : Ideal R) : Inhabited (SelfLERadical J)
     where default := ⟨J, Ideal.le_radical⟩
 #align local_cohomology.self_le_radical.inhabited localCohomology.SelfLERadical.inhabited
@@ -149,8 +168,8 @@ end Diagrams
 end localCohomology
 
 /-! We give two models for the local cohomology with support in an ideal `J`: first in terms of
-the powers of `J` (`local_cohomology`), then in terms of *all* ideals with radical
-containing `J` (`local_cohomology.ofSelfLERadical`). -/
+the powers of `J` (`localCohomology`), then in terms of *all* ideals with radical
+containing `J` (`localCohomology.ofSelfLERadical`). -/
 
 
 section ModelsForLocalCohomology
@@ -172,19 +191,25 @@ def localCohomology.ofSelfLERadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R 
   ofDiagram.{u} (selfLERadicalDiagram.{u} J) i
 #align local_cohomology.of_self_le_radical localCohomology.ofSelfLERadical
 
-/- TODO: Construct `localCohomology J i ≅ localCohomology.ofSelfLERadical J i`. Use this to
-show that local cohomology depends only on `J.radical`. -/
 end ModelsForLocalCohomology
 
-section LocalCohomologyEquiv
+namespace localCohomology
 
-open localCohomology
+/-!
+Showing equivalence of different definitions of local cohomology.
+  * `localCohomology.isoSelfLERadical` gives the isomorphism
+      `localCohomology J i ≅ localCohomology.ofSelfLERadical J i`
+  * `localCohomology.isoOfSameRadical` gives the isomorphism
+      `localCohomology J i ≅ localCohomology K i` when `J.radical = K.radical`.
+-/
 
-variable {R : Type u} [CommRing R] (I J : Ideal R)
+section LocalCohomologyEquiv
+
+variable {R : Type u} [CommRing R]
 
 /-- Lifting `idealPowersDiagram J` from a diagram valued in `ideals R` to a diagram
 valued in `SelfLERadical J`. -/
-def localCohomology.idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLERadical J :=
+def idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLERadical J :=
   FullSubcategory.lift _ (idealPowersDiagram J) fun k => by
     change _ ≤ (J ^ unop k).radical
     cases' unop k with n
@@ -192,24 +217,83 @@ def localCohomology.idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ Sel
     · simp only [J.radical_pow _ n.succ_pos, Ideal.le_radical]
 #align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLERadical
 
-/-- The composition with the inclusion into `ideals R` is isomorphic to `idealPowersDiagram J`. -/
-def localCohomology.idealPowersToSelfLERadicalCompInclusion (J : Ideal R) :
-    localCohomology.idealPowersToSelfLERadical J ⋙ selfLERadicalDiagram J ≅ idealPowersDiagram J :=
-  FullSubcategory.lift_comp_inclusion _ _ _
-#align local_cohomology.ideal_powers_to_self_le_radical_comp_inclusion localCohomology.idealPowersToSelfLERadicalCompInclusion
+variable {I J K : Ideal R}
 
 /-- The lemma below essentially says that `idealPowersToSelfLERadical I` is initial in
 `selfLERadicalDiagram I`.
 
-Porting note: This lemma should probably be moved to `Mathlib/RingTheory/Finiteness.lean`
+PORTING NOTE: This lemma should probably be moved to `Mathlib/RingTheory/Finiteness`
 to be near `Ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
-theorem Ideal.exists_pow_le_of_le_radical_of_fg (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
+theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
     ∃ k : ℕ, I ^ k ≤ J := by
   obtain ⟨k, hk⟩ := J.exists_radical_pow_le_of_fg hJ
   use k
   calc
     I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
     _ ≤ J := hk
-#align ideal.exists_pow_le_of_le_radical_of_fg Ideal.exists_pow_le_of_le_radical_of_fg
+#align local_cohomology.ideal.exists_pow_le_of_le_radical_of_fg localCohomology.Ideal.exists_pow_le_of_le_radical_of_fG
+
+/-- The diagram of powers of `J` is initial in the diagram of all ideals with
+radical containing `J`. This uses noetherianness. -/
+instance ideal_powers_initial [hR : IsNoetherian R R] :
+    Functor.Initial (idealPowersToSelfLERadical J) where
+  out J' := by
+    apply (config := {allowSynthFailures := true }) zigzag_isConnected
+    · obtain ⟨k, hk⟩ := Ideal.exists_pow_le_of_le_radical_of_fG J'.2 (isNoetherian_def.mp hR _)
+      exact ⟨CostructuredArrow.mk (⟨⟨hk⟩⟩ : (idealPowersToSelfLERadical J).obj (op k) ⟶ J')⟩
+    · intro j1 j2
+      apply Relation.ReflTransGen.single
+      -- The inclusions `J^n1 ≤ J'` and `J^n2 ≤ J'` always form a triangle, based on
+      -- which exponent is larger.
+      cases' le_total (unop j1.left) (unop j2.left) with h h
+      right; exact ⟨CostructuredArrow.homMk (homOfLE h).op (AsTrue.get trivial)⟩
+      left; exact ⟨CostructuredArrow.homMk (homOfLE h).op (AsTrue.get trivial)⟩
+#align local_cohomology.ideal_powers_initial localCohomology.ideal_powers_initial
+
+-- FIXME again, this instance is not found by `inferInstance`, but `#synth` finds it just fine.
+-- #synth HasColimitsOfSize.{0, 0, u, u + 1} (ModuleCat.{u, u} R)
+instance : HasColimitsOfSize.{0, 0, u, u + 1} (ModuleCat.{u, u} R) :=
+  ModuleCat.Colimits.hasColimitsOfSize_zero_moduleCat.{u, u}
+
+example : HasColimitsOfSize.{0, 0, u, u + 1} (ModuleCat.{u, u} R) := inferInstance
+/-- Local cohomology (defined in terms of powers of `J`) agrees with local
+cohomology computed over all ideals with radical containing `J`. -/
+def isoSelfLERadical (J : Ideal.{u} R) [IsNoetherian.{u,u} R R] (i : ℕ) :
+    localCohomology.ofSelfLERadical.{u} J i ≅ localCohomology.{u} J i :=
+  (localCohomology.isoOfFinal.{u, u, 0} (idealPowersToSelfLERadical.{u} J)
+    (selfLERadicalDiagram.{u} J) i).symm ≪≫
+      HasColimit.isoOfNatIso.{0,0,u+1,u+1} (Iso.refl.{u+1,u+1} _)
+#align local_cohomology.iso_self_le_radical localCohomology.isoSelfLERadical
+
+/-- Casting from the full subcategory of ideals with radical containing `J` to the full
+subcategory of ideals with radical containing `K`. -/
+def SelfLERadical.cast (hJK : J.radical = K.radical) : SelfLERadical J ⥤ SelfLERadical K :=
+  FullSubcategory.map fun L hL => by
+    rw [← Ideal.radical_le_radical_iff] at hL ⊢
+    exact hJK.symm.trans_le hL
+#align local_cohomology.self_le_radical.cast localCohomology.SelfLERadical.cast
+
+-- TODO generalize this to the equivalence of full categories for any `iff`.
+instance SelfLERadical.castIsEquivalence (hJK : J.radical = K.radical) :
+    IsEquivalence (SelfLERadical.cast hJK) where
+  inverse := SelfLERadical.cast hJK.symm
+  unitIso := Iso.refl _
+  counitIso := Iso.refl _
+#align local_cohomology.self_le_radical.cast_is_equivalence localCohomology.SelfLERadical.castIsEquivalence
+
+/-- The natural isomorphism between local cohomology defined using the `of_self_le_radical`
+diagram, assuming `J.radical = K.radical`. -/
+def SelfLERadical.isoOfSameRadical (hJK : J.radical = K.radical) (i : ℕ) :
+    ofSelfLERadical J i ≅ ofSelfLERadical K i :=
+  (isoOfFinal.{u, u, u} (SelfLERadical.cast hJK.symm) _ _).symm
+#align local_cohomology.self_le_radical.iso_of_same_radical localCohomology.SelfLERadical.isoOfSameRadical
+
+/-- Local cohomology agrees on ideals with the same radical. -/
+def isoOfSameRadical [IsNoetherian R R] (hJK : J.radical = K.radical) (i : ℕ) :
+    localCohomology J i ≅ localCohomology K i :=
+  (isoSelfLERadical J i).symm ≪≫ SelfLERadical.isoOfSameRadical hJK i ≪≫ isoSelfLERadical K i
+#align local_cohomology.iso_of_same_radical localCohomology.isoOfSameRadical
 
 end LocalCohomologyEquiv
+
+end localCohomology
chore: tidy various files (#5469)

Co-authored-by: Scott Morrison <scott@tqft.net>

Diff
@@ -75,11 +75,11 @@ def ringModIdeals (I : D ⥤ Ideal R) : D ⥤ ModuleCat.{u} R where
   map_comp f g := by apply Submodule.linearMap_qext; rfl
 #align local_cohomology.ring_mod_ideals localCohomology.ringModIdeals
 
--- TODO:  Once this file is ported, move this file to the right location.
-instance moduleCat_enough_projectives' : EnoughProjectives (ModuleCat.{u} R) :=
+-- Porting note: TODO:  Once this file is ported, move this instance to the right location.
+instance moduleCat_enoughProjectives' : EnoughProjectives (ModuleCat.{u} R) :=
   ModuleCat.moduleCat_enoughProjectives.{u}
 set_option linter.uppercaseLean3 false in
-#align local_cohomology.Module_enough_projectives' localCohomology.moduleCat_enough_projectives'
+#align local_cohomology.Module_enough_projectives' localCohomology.moduleCat_enoughProjectives'
 
 /-- The diagram we will take the colimit of to define local cohomology, corresponding to the
 directed system determined by the functor `I` -/
@@ -100,11 +100,11 @@ In this definition we do not assume any special property of the diagram `I`, but
 will be where `I` is (cofinal with) the diagram of powers of a single given ideal.
 
 Below, we give two equivalent (to be shown) definitions of the usual local cohomology with support
-in an ideal `J`, `local_cohomology` and `local_cohomology.of_self_le_radical`.
+in an ideal `J`, `localCohomology` and `localCohomology.ofSelfLERadical`.
 
 TODO: Show that any functor cofinal with `I` gives the same result.
  -/
-/-- `local_cohomology.of_diagram I i` is the functor sending a module `M` over a commutative
+/-- `localCohomology.ofDiagram I i` is the functor sending a module `M` over a commutative
 ring `R` to the direct limit of `Ext^i(R/J, M)`, where `J` ranges over a collection of ideals
 of `R`, represented as a functor `I`. -/
 def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCat.{max u v} R :=
@@ -124,25 +124,25 @@ def idealPowersDiagram (J : Ideal R) : ℕᵒᵖ ⥤ Ideal R where
 #align local_cohomology.ideal_powers_diagram localCohomology.idealPowersDiagram
 
 /-- The full subcategory of all ideals with radical containing `J` -/
-def SelfLeRadical (J : Ideal R) : Type u :=
+def SelfLERadical (J : Ideal R) : Type u :=
   FullSubcategory fun J' : Ideal R => J ≤ J'.radical
 --deriving Category
 
 -- Porting note: `deriving Category` is not able to derive this instance
-instance (J : Ideal R) : Category (SelfLeRadical J) :=
+instance (J : Ideal R) : Category (SelfLERadical J) :=
   (FullSubcategory.category _)
 
-#align local_cohomology.self_le_radical localCohomology.SelfLeRadical
+#align local_cohomology.self_le_radical localCohomology.SelfLERadical
 
-instance SelfLeRadical.inhabited (J : Ideal R) : Inhabited (SelfLeRadical J)
+instance SelfLERadical.inhabited (J : Ideal R) : Inhabited (SelfLERadical J)
     where default := ⟨J, Ideal.le_radical⟩
-#align local_cohomology.self_le_radical.inhabited localCohomology.SelfLeRadical.inhabited
+#align local_cohomology.self_le_radical.inhabited localCohomology.SelfLERadical.inhabited
 
 /-- The diagram of all ideals with radical containing `J`, represented as a functor.
 This is the "largest" diagram that computes local cohomology with support in `J`. -/
-def selfLeRadicalDiagram (J : Ideal R) : SelfLeRadical J ⥤ Ideal R :=
+def selfLERadicalDiagram (J : Ideal R) : SelfLERadical J ⥤ Ideal R :=
   fullSubcategoryInclusion _
-#align local_cohomology.self_le_radical_diagram localCohomology.selfLeRadicalDiagram
+#align local_cohomology.self_le_radical_diagram localCohomology.selfLERadicalDiagram
 
 end Diagrams
 
@@ -150,7 +150,7 @@ end localCohomology
 
 /-! We give two models for the local cohomology with support in an ideal `J`: first in terms of
 the powers of `J` (`local_cohomology`), then in terms of *all* ideals with radical
-containing `J` (`local_cohomology.of_self_le_radical`). -/
+containing `J` (`local_cohomology.ofSelfLERadical`). -/
 
 
 section ModelsForLocalCohomology
@@ -159,7 +159,7 @@ open localCohomology
 
 variable {R : Type u} [CommRing R]
 
-/-- `local_cohomology J i` is `i`-th the local cohomology module of a module `M` over
+/-- `localCohomology J i` is `i`-th the local cohomology module of a module `M` over
 a commutative ring `R` with support in the ideal `J` of `R`, defined as the direct limit
 of `Ext^i(R/J^t, M)` over all powers `t : ℕ`. -/
 def localCohomology (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
@@ -168,11 +168,11 @@ def localCohomology (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u}
 
 /-- Local cohomology as the direct limit of `Ext^i(R/J', M)` over *all* ideals `J'` with radical
 containing `J`. -/
-def localCohomology.ofSelfLeRadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
-  ofDiagram.{u} (selfLeRadicalDiagram.{u} J) i
-#align local_cohomology.of_self_le_radical localCohomology.ofSelfLeRadical
+def localCohomology.ofSelfLERadical (J : Ideal R) (i : ℕ) : ModuleCat.{u} R ⥤ ModuleCat.{u} R :=
+  ofDiagram.{u} (selfLERadicalDiagram.{u} J) i
+#align local_cohomology.of_self_le_radical localCohomology.ofSelfLERadical
 
-/- TODO: Construct `local_cohomology J i ≅ local_cohomology.of_self_le_radical J i`. Use this to
+/- TODO: Construct `localCohomology J i ≅ localCohomology.ofSelfLERadical J i`. Use this to
 show that local cohomology depends only on `J.radical`. -/
 end ModelsForLocalCohomology
 
@@ -182,36 +182,34 @@ open localCohomology
 
 variable {R : Type u} [CommRing R] (I J : Ideal R)
 
-/-- Lifting `ideal_powers_diagram J` from a diagram valued in `ideals R` to a diagram
-valued in `self_le_radical J`. -/
-def localCohomology.idealPowersToSelfLeRadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLeRadical J :=
+/-- Lifting `idealPowersDiagram J` from a diagram valued in `ideals R` to a diagram
+valued in `SelfLERadical J`. -/
+def localCohomology.idealPowersToSelfLERadical (J : Ideal R) : ℕᵒᵖ ⥤ SelfLERadical J :=
   FullSubcategory.lift _ (idealPowersDiagram J) fun k => by
     change _ ≤ (J ^ unop k).radical
     cases' unop k with n
     · simp [Ideal.radical_top, pow_zero, Ideal.one_eq_top, le_top, Nat.zero_eq]
     · simp only [J.radical_pow _ n.succ_pos, Ideal.le_radical]
-#align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLeRadical
+#align local_cohomology.ideal_powers_to_self_le_radical localCohomology.idealPowersToSelfLERadical
 
-/-- The composition with the inclusion into `ideals R` is isomorphic to `ideal_powers_diagram J`. -/
-def localCohomology.idealPowersToSelfLeRadicalCompInclusion (J : Ideal R) :
-    localCohomology.idealPowersToSelfLeRadical J ⋙ selfLeRadicalDiagram J ≅ idealPowersDiagram J :=
+/-- The composition with the inclusion into `ideals R` is isomorphic to `idealPowersDiagram J`. -/
+def localCohomology.idealPowersToSelfLERadicalCompInclusion (J : Ideal R) :
+    localCohomology.idealPowersToSelfLERadical J ⋙ selfLERadicalDiagram J ≅ idealPowersDiagram J :=
   FullSubcategory.lift_comp_inclusion _ _ _
-#align local_cohomology.ideal_powers_to_self_le_radical_comp_inclusion localCohomology.idealPowersToSelfLeRadicalCompInclusion
+#align local_cohomology.ideal_powers_to_self_le_radical_comp_inclusion localCohomology.idealPowersToSelfLERadicalCompInclusion
 
-/-- The lemma below essentially says that `ideal_powers_to_self_le_radical I` is initial in
-`self_le_radical_diagram I`.
+/-- The lemma below essentially says that `idealPowersToSelfLERadical I` is initial in
+`selfLERadicalDiagram I`.
 
-PORTING NOTE: This lemma should probably be moved to `ring_theory/finiteness.lean`
-to be near `ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
-theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
+Porting note: This lemma should probably be moved to `Mathlib/RingTheory/Finiteness.lean`
+to be near `Ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
+theorem Ideal.exists_pow_le_of_le_radical_of_fg (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
     ∃ k : ℕ, I ^ k ≤ J := by
   obtain ⟨k, hk⟩ := J.exists_radical_pow_le_of_fg hJ
   use k
   calc
     I ^ k ≤ J.radical ^ k := Ideal.pow_mono hIJ _
     _ ≤ J := hk
-    
-#align ideal.exists_pow_le_of_le_radical_of_fg Ideal.exists_pow_le_of_le_radical_of_fG
+#align ideal.exists_pow_le_of_le_radical_of_fg Ideal.exists_pow_le_of_le_radical_of_fg
 
 end LocalCohomologyEquiv
-
chore: fix many typos (#4983)

These are all doc fixes

Diff
@@ -104,7 +104,7 @@ in an ideal `J`, `local_cohomology` and `local_cohomology.of_self_le_radical`.
 
 TODO: Show that any functor cofinal with `I` gives the same result.
  -/
-/-- `local_cohomology.of_diagram I i` is the the functor sending a module `M` over a commutative
+/-- `local_cohomology.of_diagram I i` is the functor sending a module `M` over a commutative
 ring `R` to the direct limit of `Ext^i(R/J, M)`, where `J` ranges over a collection of ideals
 of `R`, represented as a functor `I`. -/
 def ofDiagram (I : D ⥤ Ideal R) (i : ℕ) : ModuleCat.{max u v} R ⥤ ModuleCat.{max u v} R :=
feat: port Algebra.Homology.LocalCohomology (#4749)

Co-authored-by: Calvin Lee <calvins.lee@utah.edu>

Dependencies 10 + 700

701 files ported (98.6%)
267058 lines ported (98.7%)
Show graph

The unported dependencies are