Skip to content

Commit c4988d1

Browse files
feat: make isNoetherian_of_isNoetherianRing_of_finite an instance (#8999)
Make `isNoetherian_of_isNoetherianRing_of_finite an instance`: this was impossible in Lean 3 because of a loop.
1 parent a210341 commit c4988d1

File tree

10 files changed

+7
-21
lines changed

10 files changed

+7
-21
lines changed

Mathlib/Algebra/DirectSum/LinearMap.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ domain and codomain.
1717

1818
open Set BigOperators DirectSum
1919

20-
attribute [local instance]
21-
isNoetherian_of_isNoetherianRing_of_finite
22-
Module.free_of_finite_type_torsion_free'
20+
attribute [local instance] Module.free_of_finite_type_torsion_free'
2321

2422
variable {ι R M : Type*} [CommRing R] [AddCommGroup M] [Module R M]
2523
{N : ι → Submodule R M} [DecidableEq ι] (h : IsInternal N)

Mathlib/Algebra/Lie/Killing.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ variable (R K L M : Type*) [CommRing R] [LieRing L] [LieAlgebra R L]
5454
[Module.Free R M] [Module.Finite R M]
5555
[Field K] [LieAlgebra K L] [Module K M] [LieModule K L M] [FiniteDimensional K M]
5656

57-
attribute [local instance] isNoetherian_of_isNoetherianRing_of_finite
5857
attribute [local instance] Module.free_of_finite_type_torsion_free'
5958

6059
local notation "φ" => LieModule.toEndomorphism R L M

Mathlib/Algebra/Lie/Weights/Linear.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ or `R` has characteristic zero.
4040

4141
open Set
4242

43-
attribute [local instance]
44-
isNoetherian_of_isNoetherianRing_of_finite
45-
Module.free_of_finite_type_torsion_free'
43+
attribute [local instance] Module.free_of_finite_type_torsion_free'
4644

4745
variable (R L M : Type*) [CommRing R] [LieRing L] [LieAlgebra R L]
4846
[AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]

Mathlib/Algebra/Module/PID.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ theorem equiv_directSum_of_isTorsion [h' : Module.Finite R N] (hN : Module.IsTor
243243
∀ i,
244244
∃ (d : ℕ) (k : Fin d → ℕ),
245245
Nonempty <| torsionBy R N (p i ^ e i) ≃ₗ[R] ⨁ j, R ⧸ R ∙ p i ^ k j := by
246-
have := isNoetherian_of_isNoetherianRing_of_finite R N
247246
haveI := fun i => isNoetherian_submodule' (torsionBy R N <| p i ^ e i)
248247
exact fun i =>
249248
torsion_by_prime_power_decomposition.{u, v} (hp i)
@@ -266,7 +265,6 @@ theorem equiv_directSum_of_isTorsion [h' : Module.Finite R N] (hN : Module.IsTor
266265
theorem equiv_free_prod_directSum [h' : Module.Finite R N] :
267266
∃ (n : ℕ) (ι : Type u) (_ : Fintype ι) (p : ι → R) (_ : ∀ i, Irreducible <| p i) (e : ι → ℕ),
268267
Nonempty <| N ≃ₗ[R] (Fin n →₀ R) × ⨁ i : ι, R ⧸ R ∙ p i ^ e i := by
269-
have := isNoetherian_of_isNoetherianRing_of_finite R N
270268
haveI := isNoetherian_submodule' (torsion R N)
271269
haveI := Module.Finite.of_surjective _ (torsion R N).mkQ_surjective
272270
obtain ⟨I, fI, p, hp, e, ⟨h⟩⟩ :=

Mathlib/NumberTheory/Cyclotomic/Basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,7 @@ theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L]
352352
/-- A finite cyclotomic extension of an integral noetherian domain is integral -/
353353
theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] :
354354
Algebra.IsIntegral A B :=
355-
letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian <|
356-
isNoetherian_of_isNoetherianRing_of_finite A B
355+
letI := IsCyclotomicExtension.finite S A B; isIntegral_of_noetherian inferInstance
357356
#align is_cyclotomic_extension.integral IsCyclotomicExtension.integral
358357

359358
/-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/

Mathlib/Probability/Cdf.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ lemma tendsto_cdf_atBot : Tendsto (cdf μ) atBot (𝓝 0) := tendsto_condCdf_atB
6969
/-- The cdf tends to 1 at +∞. -/
7070
lemma tendsto_cdf_atTop : Tendsto (cdf μ) atTop (𝓝 1) := tendsto_condCdf_atTop _ _
7171

72-
set_option synthInstance.maxHeartbeats 25000 in
7372
lemma ofReal_cdf [IsProbabilityMeasure μ] (x : ℝ) : ENNReal.ofReal (cdf μ x) = μ (Iic x) := by
73+
have := IsProbabilityMeasure.toIsFiniteMeasure (Measure.prod (Measure.dirac ()) μ)
7474
have h := lintegral_condCdf ((Measure.dirac Unit.unit).prod μ) x
7575
simpa only [MeasureTheory.Measure.fst_prod, Measure.prod_prod, measure_univ, one_mul,
7676
lintegral_dirac] using h

Mathlib/RingTheory/Adjoin/Tower.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ theorem fg_of_fg_of_fg [IsNoetherianRing A] (hAC : (⊤ : Subalgebra A C).FG)
157157
Subalgebra.fg_of_submodule_fg <|
158158
have : IsNoetherianRing B₀ := isNoetherianRing_of_fg hAB₀
159159
have : Module.Finite B₀ C := ⟨hB₀C⟩
160-
have : IsNoetherian B₀ C := isNoetherian_of_isNoetherianRing_of_finite B₀ C
161160
fg_of_injective (IsScalarTower.toAlgHom B₀ B C).toLinearMap hBCi
162161
#align fg_of_fg_of_fg fg_of_fg_of_fg
163162

Mathlib/RingTheory/DedekindDomain/PID.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ theorem IsLocalization.OverPrime.mem_normalizedFactors_of_isPrime [DecidableEq (
239239
IsScalarTower.algebraMap_eq R (Localization.AtPrime p) Sₚ, ← Ideal.map_map,
240240
Localization.AtPrime.map_eq_maximalIdeal, Ideal.map_le_iff_le_comap,
241241
hpu (LocalRing.maximalIdeal _) ⟨this, _⟩, hpu (comap _ _) ⟨_, _⟩]
242-
· have hRS : Algebra.IsIntegral R S :=
243-
isIntegral_of_noetherian (isNoetherian_of_isNoetherianRing_of_finite R S)
242+
· have hRS : Algebra.IsIntegral R S := isIntegral_of_noetherian inferInstance
244243
exact mt (Ideal.eq_bot_of_comap_eq_bot (isIntegral_localization hRS)) hP0
245244
· exact Ideal.comap_isPrime (algebraMap (Localization.AtPrime p) Sₚ) P
246245
· exact (LocalRing.maximalIdeal.isMaximal _).isPrime

Mathlib/RingTheory/Filtration.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ variable {F}
404404

405405
theorem Stable.of_le [IsNoetherianRing R] [Module.Finite R M] (hF : F.Stable)
406406
{F' : I.Filtration M} (hf : F' ≤ F) : F'.Stable := by
407-
have := isNoetherian_of_isNoetherianRing_of_finite R M
408407
rw [← submodule_fg_iff_stable] at hF ⊢
409408
any_goals intro i; exact IsNoetherian.noetherian _
410409
have := isNoetherian_of_fg_of_noetherian _ hF
@@ -438,8 +437,7 @@ theorem Ideal.mem_iInf_smul_pow_eq_bot_iff [IsNoetherianRing R] [Module.Finite R
438437
have hN : ∀ k, (I.stableFiltration ⊤ ⊓ I.trivialFiltration N).N k = N :=
439438
fun k => inf_eq_right.mpr ((iInf_le _ k).trans <| le_of_eq <| by simp)
440439
constructor
441-
· have := isNoetherian_of_isNoetherianRing_of_finite R M
442-
obtain ⟨r, hr₁, hr₂⟩ :=
440+
· obtain ⟨r, hr₁, hr₂⟩ :=
443441
Submodule.exists_mem_and_smul_eq_self_of_fg_of_le_smul I N (IsNoetherian.noetherian N) (by
444442
obtain ⟨k, hk⟩ := (I.stableFiltration_stable ⊤).inter_right (I.trivialFiltration N)
445443
have := hk k (le_refl _)

Mathlib/RingTheory/Noetherian.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,7 @@ theorem isNoetherian_of_fg_of_noetherian {R M} [Ring R] [AddCommGroup M] [Module
594594
rw [Finsupp.not_mem_support_iff.1 hx, zero_smul]
595595
#align is_noetherian_of_fg_of_noetherian isNoetherian_of_fg_of_noetherian
596596

597-
-- It would be nice to make this an instance but it is empirically problematic, possibly because
598-
-- of the loop that it causes with `Module.IsNoetherian.finite`
599-
theorem isNoetherian_of_isNoetherianRing_of_finite (R M : Type*)
597+
instance isNoetherian_of_isNoetherianRing_of_finite (R M : Type*)
600598
[Ring R] [AddCommGroup M] [Module R M] [IsNoetherianRing R] [Module.Finite R M] :
601599
IsNoetherian R M :=
602600
have : IsNoetherian R (⊤ : Submodule R M) :=

0 commit comments

Comments
 (0)