Skip to content

Commit 45edaee

Browse files
committed
chore(Algebra): deprecate a few more NoZeroSMulDivisors lemmas (leanprover-community#34203)
These were forgotten in leanprover-community#33873.
1 parent b8ccc79 commit 45edaee

3 files changed

Lines changed: 24 additions & 43 deletions

File tree

Mathlib/Algebra/Algebra/Basic.lean

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -364,34 +364,6 @@ instance (R : Type*) [Ring R] [CharZero R] : FaithfulSMul ℤ R := by
364364

365365
end FaithfulSMul
366366

367-
namespace NoZeroSMulDivisors
368-
369-
-- see Note [lower instance priority]
370-
instance (priority := 100) instOfFaithfulSMul {R A : Type*}
371-
[CommSemiring R] [Nontrivial R] [Ring A] [Algebra R A] [NoZeroDivisors A] [FaithfulSMul R A] :
372-
IsTorsionFree R A where
373-
isSMulRegular r hr a b hab := by
374-
rw [← sub_eq_zero, ← smul_sub] at hab
375-
simpa [Algebra.smul_def, FaithfulSMul.algebraMap_eq_zero_iff, sub_eq_zero, hr.ne_zero] using hab
376-
377-
variable {R A : Type*} [CommRing R] [IsDomain R] [Ring A] [Algebra R A]
378-
379-
instance [Nontrivial A] [IsTorsionFree R A] : FaithfulSMul R A where
380-
eq_of_smul_eq_smul {r₁ r₂} h := by
381-
specialize h 1
382-
rw [← sub_eq_zero, ← sub_smul, smul_eq_zero, sub_eq_zero] at h
383-
exact h.resolve_right one_ne_zero
384-
385-
lemma iff_faithfulSMul [IsDomain A] : IsTorsionFree R A ↔ FaithfulSMul R A where
386-
mp _ := inferInstance
387-
mpr _ := inferInstance
388-
389-
theorem iff_algebraMap_injective [IsDomain A] :
390-
IsTorsionFree R A ↔ Injective (algebraMap R A) := by
391-
rw [iff_faithfulSMul, faithfulSMul_iff_algebraMap_injective]
392-
393-
end NoZeroSMulDivisors
394-
395367
section IsScalarTower
396368

397369
variable {R : Type*} [CommSemiring R]
@@ -457,32 +429,39 @@ lemma Module.IsTorsionFree.of_faithfulSMul [Semiring S] [Module S R] [Module S A
457429
(FaithfulSMul.algebraMap_injective R A).moduleIsTorsionFree _
458430
(by simp [Algebra.algebraMap_eq_smul_one])
459431

460-
lemma Module.IsTorsionFree.trans_faithfulSMul [Nontrivial R] [IsDomain A] [AddCommMonoid M]
432+
lemma Module.IsTorsionFree.trans_faithfulSMul [Nontrivial R] [IsCancelMulZero A] [AddCommMonoid M]
461433
[Module A M] [Module R M] [IsTorsionFree A M] [IsScalarTower R A M] : IsTorsionFree R M :=
462-
.comap (algebraMap R A) (fun r hr ↦ by simpa [isRegular_iff_ne_zero] using hr.ne_zero) (by simp)
434+
.comap (algebraMap R A) (fun r hr ↦ .of_ne_zero <| by simpa using hr.ne_zero) (by simp)
463435

464436
-- see Note [lower instance priority]
465-
instance (priority := 100) FaithfulSMul.to_isTorsionFree [Nontrivial R] [IsDomain A] :
437+
instance (priority := 100) FaithfulSMul.to_isTorsionFree [Nontrivial R] [IsCancelMulZero A] :
466438
IsTorsionFree R A := .trans_faithfulSMul R A A
467439

468440
end FaithfulSMul
469441

470442
namespace Module
471443
variable {R A : Type*} [CommRing R] [IsDomain R] [Ring A] [Algebra R A]
472444

473-
instance (priority := 100) IsTorsionFree.to_faithfulSMul [Nontrivial A] [IsTorsionFree R A] :
474-
FaithfulSMul R A where
445+
instance IsTorsionFree.to_faithfulSMul [IsCancelMulZero R] [Nontrivial A]
446+
[IsTorsionFree R A] : FaithfulSMul R A where
475447
eq_of_smul_eq_smul h := smul_left_injective _ one_ne_zero <| h 1
476448

477-
lemma isTorsionFree_iff_faithfulSMul [IsDomain A] : IsTorsionFree R A ↔ FaithfulSMul R A :=
449+
variable [IsDomain A]
450+
451+
lemma isTorsionFree_iff_faithfulSMul : IsTorsionFree R A ↔ FaithfulSMul R A :=
478452
fun _ ↦ inferInstance, fun _ ↦ inferInstance⟩
479453

480-
lemma isTorsionFree_iff_algebraMap_injective [IsDomain A] :
481-
IsTorsionFree R A ↔ Injective (algebraMap R A) := by
454+
lemma isTorsionFree_iff_algebraMap_injective : IsTorsionFree R A ↔ Injective (algebraMap R A) := by
482455
rw [isTorsionFree_iff_faithfulSMul, faithfulSMul_iff_algebraMap_injective]
483456

484457
end Module
485458

459+
@[deprecated (since := "2026-01-21")]
460+
alias NoZeroSMulDivisors.iff_algebraMap_injective := isTorsionFree_iff_algebraMap_injective
461+
462+
@[deprecated (since := "2026-01-21")]
463+
alias NoZeroSMulDivisors.iff_faithfulSMul := isTorsionFree_iff_faithfulSMul
464+
486465
/-! TODO: The following lemmas no longer involve `Algebra` at all, and could be moved closer
487466
to `Algebra/Module/Submodule.lean`. Currently this is tricky because `ker`, `range`, `⊤`, and `⊥`
488467
are all defined in `LinearAlgebra/Basic.lean`. -/

Mathlib/Algebra/Module/Torsion/Free.lean

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ lemma Module.IsTorsionFree.trans [Module S R] [IsTorsionFree S R] [IsScalarTower
9191
exact ⟨fun x y hxy ↦ hs.isSMulRegular <| by simpa using hxy,
9292
fun x y hxy ↦ hs.isSMulRegular <| by simpa using hxy⟩
9393

94-
variable [IsDomain R]
94+
variable [IsCancelMulZero R]
9595

9696
lemma IsSMulRegular.of_ne_zero (hr : r ≠ 0) : IsSMulRegular M r :=
9797
(IsRegular.of_ne_zero hr).isSMulRegular
@@ -160,14 +160,12 @@ lemma Module.IsTorsionFree.of_smul_eq_zero [Nontrivial R]
160160
isSMulRegular r hr m₁ m₂ hm := by
161161
simpa [sub_eq_zero, hr.ne_zero] using h r (m₁ - m₂) (by simpa [smul_sub, sub_eq_zero] using hm)
162162

163-
variable [IsDomain R]
164-
165-
lemma Module.isTorsionFree_iff_smul_eq_zero :
163+
lemma Module.isTorsionFree_iff_smul_eq_zero [IsDomain R] :
166164
IsTorsionFree R M ↔ ∀ (r : R) (m : M), r • m = 0 → r = 0 ∨ m = 0 where
167165
mp _ _ _ := smul_eq_zero.1
168166
mpr := .of_smul_eq_zero
169167

170-
variable [IsTorsionFree R M]
168+
variable [IsCancelMulZero R] [IsTorsionFree R M]
171169

172170
variable (R) in
173171
lemma smul_left_injective (hm : m ≠ 0) : ((· • m) : R → M).Injective := by

Mathlib/RingTheory/Extension/Generators.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,18 @@ lemma ker_naive {σ : Type*} {I : Ideal (MvPolynomial σ R)}
574574
(Generators.naive s hs).ker = I :=
575575
I.mk_ker
576576

577-
@[simp]
577+
-- FIXME: `simpNF` times out synthesizing
578+
-- `FaithfulSMul (Algebra.Generators.ofAlgHom f h).toExtension.Ring S`.
579+
@[simp, nolint simpNF]
578580
lemma ker_ofAlgHom {I : Type*} (f : MvPolynomial I R →ₐ[R] S) (h : Function.Surjective ⇑f) :
579581
(ofAlgHom f h).ker = RingHom.ker f.toRingHom := by
580582
change RingHom.ker _ = _
581583
congr
582584
exact MvPolynomial.ringHom_ext (by simp) (by simp [ofAlgHom])
583585

584-
@[simp]
586+
-- FIXME: `simpNF` times out synthesizing
587+
-- `FaithfulSMul (P.ofAlgEquiv e).toExtension.Ring T`.
588+
@[simp, nolint simpNF]
585589
lemma ker_ofAlgEquiv (P : Generators R S ι) {T : Type*} [CommRing T] [Algebra R T] (e : S ≃ₐ[R] T) :
586590
(P.ofAlgEquiv e).ker = P.ker := by
587591
rw [ker_eq_ker_aeval_val, ofAlgEquiv_val, Function.comp_def, ← AlgHom.coe_coe,

0 commit comments

Comments
 (0)