Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: introduce Ideal.IsTwoSided class for quotients of noncommutative rings #17930

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
94d510a
refactor: generalize mul of Submodule and smul of Ideal on Submodule …
alreadydone Oct 13, 2024
c31a232
Discard changes to Mathlib/RingTheory/JacobsonIdeal.lean
alreadydone Oct 13, 2024
71046e2
fixes
alreadydone Oct 13, 2024
fb0536c
fixes
alreadydone Oct 13, 2024
3cbb1e9
fixes
alreadydone Oct 14, 2024
810908a
fixes
alreadydone Oct 14, 2024
0c22392
fixes
alreadydone Oct 14, 2024
2af93ae
fixes
alreadydone Oct 14, 2024
e3e517d
missing docstring
alreadydone Oct 14, 2024
1fcc086
Merge branch 'master' into Ideal.mul
alreadydone Oct 18, 2024
913d508
Merge branch 'master' into Ideal.mul
alreadydone Oct 18, 2024
ff7e3bb
fixes
alreadydone Oct 18, 2024
68cb67d
Refactor: Two-sided ideals
alreadydone Oct 16, 2024
322eb98
more of Ideal.IsTwoSided
alreadydone Oct 17, 2024
86b689d
more of IsTwoSided
alreadydone Oct 18, 2024
eeafa2d
IsTwoSided fixes
alreadydone Oct 18, 2024
8f163e5
fix
alreadydone Oct 18, 2024
4f9546c
undergrad.yaml
alreadydone Oct 18, 2024
176de21
overview.yaml
alreadydone Oct 18, 2024
f08c454
docstring
alreadydone Oct 19, 2024
49e4e1f
unused argument
alreadydone Oct 19, 2024
cb0757f
Discard changes to Mathlib/Algebra/Module/Submodule/Map.lean
alreadydone Oct 21, 2024
ca7370b
Merge remote-tracking branch 'origin/master' into Ideal.IsTwoSided
alreadydone Nov 8, 2024
2cabb3b
merge
alreadydone Nov 8, 2024
89d15dc
Discard changes to Mathlib/Algebra/Group/Submonoid/Pointwise.lean
alreadydone Nov 8, 2024
fb87f2f
Discard changes to Mathlib/LinearAlgebra/TensorProduct/Quotient.lean
alreadydone Nov 8, 2024
e868a77
fix
alreadydone Nov 8, 2024
367e0cd
fix
alreadydone Nov 8, 2024
0624405
fix + new lemma
alreadydone Nov 9, 2024
d2d97ff
colon IsTwoSided
alreadydone Nov 9, 2024
1551fa0
fix
alreadydone Nov 9, 2024
c3c9bee
fix
alreadydone Nov 9, 2024
d36b428
heartbeats
alreadydone Nov 9, 2024
5c4b4cd
fix
alreadydone Nov 9, 2024
b6fc12b
use variable
alreadydone Nov 9, 2024
77d3408
protect
alreadydone Nov 9, 2024
f00c453
try high priority for CommRing IsTwoSided instance
alreadydone Nov 9, 2024
bf4fefd
experiment: lower priority of `Ideal.Quotient.ring`
alreadydone Nov 9, 2024
9cca44c
Update RingQuot.lean
alreadydone Nov 9, 2024
028e367
try low priority for Ideal.Quotient.ring
alreadydone Nov 9, 2024
c354ef1
use `variable`
alreadydone Nov 9, 2024
ae80df9
try making `commRing` "extend" `ring`
alreadydone Nov 10, 2024
a593f70
try making `Ideal.Quotient.ring` local instance as needed
alreadydone Nov 10, 2024
65c24fb
add docstring
alreadydone Nov 10, 2024
99ed09b
make commRing extend ring again
alreadydone Nov 10, 2024
d44b060
try improve def of Ideal.Quotient.ring
alreadydone Nov 10, 2024
77fe4cd
revert ring to global instance
alreadydone Nov 10, 2024
71d9303
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Nov 11, 2024
8661741
Discard changes to Mathlib/RingTheory/Smooth/Kaehler.lean
alreadydone Nov 13, 2024
4450189
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Nov 13, 2024
a6ad7f4
experiment: un-generalize `quotientEquiv` and dependents
alreadydone Nov 13, 2024
586871b
experiment: un-generalize `quotEquivOfEq` too
alreadydone Nov 13, 2024
a78a31d
experiment: un-generalize more
alreadydone Nov 13, 2024
fee2f23
Revert "experiment: un-generalize more"
alreadydone Nov 17, 2024
867c56c
Revert "experiment: un-generalize `quotEquivOfEq` too"
alreadydone Nov 17, 2024
acca5fd
Revert "experiment: un-generalize `quotientEquiv` and dependents"
alreadydone Nov 17, 2024
a3ff84c
`priority := low` for all IsTwoSided instances but the CommRing one
alreadydone Nov 17, 2024
bc0b9b2
restore Ideal.instHasQuotient
alreadydone Nov 17, 2024
39b8576
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Nov 18, 2024
bd41a31
CommRing shortcut instance
alreadydone Nov 18, 2024
26a71d3
restore
alreadydone Nov 18, 2024
64bbc5e
Merge remote-tracking branch 'origin/master' into Ideal.IsTwoSided
alreadydone Nov 18, 2024
9b7ebcb
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Nov 20, 2024
de78454
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Nov 25, 2024
3b7e59d
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Dec 2, 2024
1fede4f
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Dec 4, 2024
6f5bbe3
fix
alreadydone Dec 5, 2024
4b4810b
restore `nolint simpNF` and adaptation_note
alreadydone Dec 5, 2024
c4b4660
fix a diamond
alreadydone Dec 5, 2024
c297f96
more CommRing shortcut instances
alreadydone Dec 5, 2024
5b9c7d9
Discard changes to Mathlib/RingTheory/Jacobson.lean
alreadydone Dec 6, 2024
31418f2
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Dec 6, 2024
c3b5bd6
fix
alreadydone Dec 6, 2024
e6022df
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Dec 10, 2024
a23734d
Update Mathlib/RingTheory/Ideal/Quotient/Operations.lean
alreadydone Dec 10, 2024
b08a94b
try more shortcut instances
alreadydone Dec 11, 2024
e4fa66b
experiment: `priority := 1` for all but one IsTwoSided instance
alreadydone Dec 16, 2024
51f7d40
keep only CommRing HasQuotient shortcut instance
alreadydone Dec 20, 2024
f5d31c7
Revert "keep only CommRing HasQuotient shortcut instance"
alreadydone Dec 22, 2024
e56e862
Revert "experiment: `priority := 1` for all but one IsTwoSided instance"
alreadydone Dec 22, 2024
49dbf9e
CommRing IsTwoSided shortcut instance
alreadydone Dec 22, 2024
53313de
change order of commRing and divisionRing in field
alreadydone Dec 22, 2024
08e995d
Revert "`priority := low` for all IsTwoSided instances but the CommRi…
alreadydone Dec 23, 2024
6f2bc3b
Revert "Revert "`priority := low` for all IsTwoSided instances but th…
alreadydone Dec 23, 2024
00e44e4
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Dec 23, 2024
0f6f5ef
fix
alreadydone Dec 23, 2024
3db42cf
Merge branch 'master' into Ideal.IsTwoSided
alreadydone Jan 10, 2025
80a2ec8
fixes
alreadydone Jan 10, 2025
a180e68
test: remove `nolint simpNF`
alreadydone Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Mathlib/Algebra/Algebra/Operations.lean
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,16 @@ protected theorem pow_zero : M ^ 0 = 1 := rfl

protected theorem pow_succ {n : ℕ} : M ^ (n + 1) = M ^ n * M := rfl

protected theorem pow_add {m n : ℕ} (h : n ≠ 0) : M ^ (m + n) = M ^ m * M ^ n :=
npowRec_add m n h _ M.one_mul

protected theorem pow_one : M ^ 1 = M := by
rw [Submodule.pow_succ, Submodule.pow_zero, Submodule.one_mul]

/-- `Submodule.pow_succ` with the right hand side commuted. -/
protected theorem pow_succ' {n : ℕ} (h : n ≠ 0) : M ^ (n + 1) = M * M ^ n := by
rw [add_comm, M.pow_add h, Submodule.pow_one]

theorem pow_toAddSubmonoid {n : ℕ} (h : n ≠ 0) : (M ^ n).toAddSubmonoid = M.toAddSubmonoid ^ n := by
induction n with
| zero => exact (h rfl).elim
Expand Down
9 changes: 9 additions & 0 deletions Mathlib/Algebra/GroupWithZero/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ lemma sq_eq_zero_iff : a ^ 2 = 0 ↔ a = 0 := pow_eq_zero_iff two_ne_zero
@[simp] lemma pow_eq_zero_iff' [Nontrivial M₀] : a ^ n = 0 ↔ a = 0 ∧ n ≠ 0 := by
obtain rfl | hn := eq_or_ne n 0 <;> simp [*]

theorem exists_right_inv_of_exists_left_inv {α} [MonoidWithZero α]
(h : ∀ a : α, a ≠ 0 → ∃ b : α, b * a = 1) {a : α} (ha : a ≠ 0) : ∃ b : α, a * b = 1 := by
obtain _ | _ := subsingleton_or_nontrivial α
· exact ⟨a, Subsingleton.elim _ _⟩
obtain ⟨b, hb⟩ := h a ha
obtain ⟨c, hc⟩ := h b (left_ne_zero_of_mul <| hb.trans_ne one_ne_zero)
refine ⟨b, ?_⟩
conv_lhs => rw [← one_mul (a * b), ← hc, mul_assoc, ← mul_assoc b, hb, one_mul, hc]

end MonoidWithZero

section CancelMonoidWithZero
Expand Down
2 changes: 2 additions & 0 deletions Mathlib/Algebra/Module/LinearMap/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ def _root_.RingHom.toSemilinearMap (f : R →+* S) : R →ₛₗ[f] S :=
{ f with
map_smul' := f.map_mul }

@[simp] theorem _root_.RingHom.coe_toSemilinearMap (f : R →+* S) : ⇑f.toSemilinearMap = f := rfl

section

variable [Semiring R₁] [Semiring R₂] [Semiring R₃]
Expand Down
119 changes: 82 additions & 37 deletions Mathlib/Algebra/Module/Torsion.lean
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ open nonZeroDivisors

section Defs

variable (R M : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M]

namespace Submodule

variable (R M : Type*) [CommSemiring R] [AddCommMonoid M] [Module R M]

-- TODO: generalize to `Submodule S M` with `SMulCommClass R S M`.
/-- The `a`-torsion submodule for `a` in `R`, containing all elements `x` of `M` such that
`a • x = 0`. -/
@[simps!]
Expand Down Expand Up @@ -190,6 +191,8 @@ end Submodule

namespace Module

variable (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M]

/-- An `a`-torsion module is a module where every element is `a`-torsion. -/
abbrev IsTorsionBy (a : R) :=
∀ ⦃x : M⦄, a • x = 0
Expand All @@ -207,9 +210,18 @@ abbrev IsTorsion' (S : Type*) [SMul S M] :=
abbrev IsTorsion :=
∀ ⦃x : M⦄, ∃ a : R⁰, a • x = 0

theorem isTorsionBySet_annihilator : IsTorsionBySet R M (Module.annihilator R M) :=
theorem isTorsionBySet_annihilator : IsTorsionBySet R M (annihilator R M) :=
fun _ r ↦ Module.mem_annihilator.mp r.2 _

theorem isTorsionBy_iff_mem_annihilator {a : R} :
IsTorsionBy R M a ↔ a ∈ annihilator R M := by
rw [IsTorsionBy, mem_annihilator]

theorem isTorsionBySet_iff_subset_annihilator {s : Set R} :
IsTorsionBySet R M s ↔ s ⊆ annihilator R M := by
simp_rw [IsTorsionBySet, Set.subset_def, SetLike.mem_coe, mem_annihilator]
rw [forall_comm, SetCoe.forall]

end Module

end Defs
Expand All @@ -223,10 +235,10 @@ variable {R M : Type*}

section

variable [CommSemiring R] [AddCommMonoid M] [Module R M] (s : Set R) (a : R)

namespace Submodule

variable [CommSemiring R] [AddCommMonoid M] [Module R M] (s : Set R) (a : R)

@[simp]
theorem smul_torsionBy (x : torsionBy R M a) : a • x = 0 :=
Subtype.ext x.prop
Expand Down Expand Up @@ -291,13 +303,32 @@ open Submodule

namespace Module

variable [Semiring R] [AddCommMonoid M] [Module R M] (s : Set R) (a : R)

theorem isTorsionBySet_of_subset {s t : Set R} (h : s ⊆ t)
(ht : IsTorsionBySet R M t) : IsTorsionBySet R M s :=
fun m r ↦ @ht m ⟨r, h r.2⟩

@[simp]
theorem isTorsionBySet_singleton_iff : IsTorsionBySet R M {a} ↔ IsTorsionBy R M a := by
refine ⟨fun h x => @h _ ⟨_, Set.mem_singleton _⟩, fun h x => ?_⟩
rintro ⟨b, rfl : b = a⟩; exact @h _

theorem isTorsionBySet_iff_is_torsion_by_span :
IsTorsionBySet R M s ↔ IsTorsionBySet R M (Ideal.span s) := by
simpa only [isTorsionBySet_iff_subset_annihilator] using Ideal.span_le.symm

theorem isTorsionBySet_span_singleton_iff : IsTorsionBySet R M (R ∙ a) ↔ IsTorsionBy R M a :=
(isTorsionBySet_iff_is_torsion_by_span _).symm.trans <| isTorsionBySet_singleton_iff _

end Module

namespace Module

variable [CommSemiring R] [AddCommMonoid M] [Module R M] (s : Set R) (a : R)

theorem isTorsionBySet_iff_torsionBySet_eq_top :
IsTorsionBySet R M s ↔ Submodule.torsionBySet R M s = ⊤ :=
IsTorsionBySet R M s ↔ torsionBySet R M s = ⊤ :=
⟨fun h => eq_top_iff.mpr fun _ _ => (mem_torsionBySet_iff _ _).mpr <| @h _, fun h x => by
rw [← mem_torsionBySet_iff, h]
trivial⟩
Expand All @@ -307,14 +338,6 @@ theorem isTorsionBy_iff_torsionBy_eq_top : IsTorsionBy R M a ↔ torsionBy R M a
rw [← torsionBySet_singleton_eq, ← isTorsionBySet_singleton_iff,
isTorsionBySet_iff_torsionBySet_eq_top]

theorem isTorsionBySet_iff_is_torsion_by_span :
IsTorsionBySet R M s ↔ IsTorsionBySet R M (Ideal.span s) := by
rw [isTorsionBySet_iff_torsionBySet_eq_top, isTorsionBySet_iff_torsionBySet_eq_top,
torsionBySet_eq_torsionBySet_span]

theorem isTorsionBySet_span_singleton_iff : IsTorsionBySet R M (R ∙ a) ↔ IsTorsionBy R M a :=
(isTorsionBySet_iff_is_torsion_by_span _).symm.trans <| isTorsionBySet_singleton_iff _

theorem isTorsionBySet_iff_subseteq_ker_lsmul :
IsTorsionBySet R M s ↔ s ⊆ LinearMap.ker (LinearMap.lsmul R M) where
mp h r hr := LinearMap.mem_ker.mpr <| LinearMap.ext fun x => @h x ⟨r, hr⟩
Expand All @@ -330,6 +353,8 @@ namespace Submodule

open Module

variable [CommSemiring R] [AddCommMonoid M] [Module R M] (s : Set R) (a : R)

theorem torsionBySet_isTorsionBySet : IsTorsionBySet R (torsionBySet R M s) s :=
fun ⟨_, hx⟩ a => Subtype.ext <| (mem_torsionBySet_iff _ _).mp hx a

Expand Down Expand Up @@ -434,10 +459,9 @@ end

section NeedsGroup

variable [CommRing R] [AddCommGroup M] [Module R M]

namespace Submodule

variable [CommRing R] [AddCommGroup M] [Module R M]
variable {ι : Type*} [DecidableEq ι] {S : Finset ι}

/-- If the `p i` are pairwise coprime, a `⨅ i, p i`-torsion module is the internal direct sum of
Expand Down Expand Up @@ -469,43 +493,54 @@ end Submodule

namespace Module

variable [Ring R] [AddCommGroup M] [Module R M]
variable {I : Ideal R} {r : R}

/-- can't be an instance because `hM` can't be inferred -/
def IsTorsionBySet.hasSMul (hM : IsTorsionBySet R M I) : SMul (R ⧸ I) M where
smul b x := I.liftQ (LinearMap.lsmul R M)
((isTorsionBySet_iff_subseteq_ker_lsmul _).mp hM) b x
smul b := QuotientAddGroup.lift I.toAddSubgroup (smulAddHom R M)
(by rwa [isTorsionBySet_iff_subset_annihilator] at hM) b

/-- can't be an instance because `hM` can't be inferred -/
abbrev IsTorsionBy.hasSMul (hM : IsTorsionBy R M r) : SMul (R ⧸ Ideal.span {r}) M :=
((isTorsionBySet_span_singleton_iff r).mpr hM).hasSMul

@[simp]
theorem IsTorsionBySet.mk_smul (hM : IsTorsionBySet R M I) (b : R) (x : M) :
theorem IsTorsionBySet.mk_smul [I.IsTwoSided] (hM : IsTorsionBySet R M I) (b : R) (x : M) :
haveI := hM.hasSMul
Ideal.Quotient.mk I b • x = b • x :=
rfl

@[simp]
theorem IsTorsionBy.mk_smul (hM : IsTorsionBy R M r) (b : R) (x : M) :
theorem IsTorsionBy.mk_smul [(Ideal.span {r}).IsTwoSided] (hM : IsTorsionBy R M r) (b : R) (x : M) :
haveI := hM.hasSMul
Ideal.Quotient.mk (Ideal.span {r}) b • x = b • x :=
rfl

/-- An `(R ⧸ I)`-module is an `R`-module which `IsTorsionBySet R M I`. -/
def IsTorsionBySet.module (hM : IsTorsionBySet R M I) : Module (R ⧸ I) M :=
def IsTorsionBySet.module [I.IsTwoSided] (hM : IsTorsionBySet R M I) : Module (R ⧸ I) M :=
letI := hM.hasSMul; I.mkQ_surjective.moduleLeft _ (IsTorsionBySet.mk_smul hM)

instance IsTorsionBySet.isScalarTower (hM : IsTorsionBySet R M I)
instance IsTorsionBySet.isScalarTower [I.IsTwoSided] (hM : IsTorsionBySet R M I)
{S : Type*} [SMul S R] [SMul S M] [IsScalarTower S R M] [IsScalarTower S R R] :
@IsScalarTower S (R ⧸ I) M _ (IsTorsionBySet.module hM).toSMul _ :=
-- Porting note: still needed to be fed the Module R / I M instance
@IsScalarTower.mk S (R ⧸ I) M _ (IsTorsionBySet.module hM).toSMul _
(fun b d x => Quotient.inductionOn' d fun c => (smul_assoc b c x : _))

/-- If a `R`-module `M` is annihilated by a two-sided ideal `I`, then the identity is a semilinear
map from the `R`-module `M` to the `R ⧸ I`-module `M`. -/
def IsTorsionBySet.semilinearMap [I.IsTwoSided] (hM : IsTorsionBySet R M I) :
let _ := hM.module; M →ₛₗ[Ideal.Quotient.mk I] M :=
let _ := hM.module
{ toFun := id
map_add' := fun _ _ ↦ rfl
map_smul' := fun _ _ ↦ rfl }

/-- An `(R ⧸ Ideal.span {r})`-module is an `R`-module for which `IsTorsionBy R M r`. -/
abbrev IsTorsionBy.module (hM : IsTorsionBy R M r) : Module (R ⧸ Ideal.span {r}) M :=
((isTorsionBySet_span_singleton_iff r).mpr hM).module
abbrev IsTorsionBy.module [h : (Ideal.span {r}).IsTwoSided] (hM : IsTorsionBy R M r) :
Module (R ⧸ Ideal.span {r}) M := by
rw [Ideal.span] at h; exact ((isTorsionBySet_span_singleton_iff r).mpr hM).module

/-- Any module is also a module over the quotient of the ring by the annihilator.
Not an instance because it causes synthesis failures / timeouts. -/
Expand Down Expand Up @@ -540,34 +575,44 @@ lemma isTorsionBySet_quotient_set_smul :
(isTorsionBySet_quotient_iff _ _).mpr fun _ _ h =>
mem_set_smul_of_mem_mem h mem_top

lemma isTorsionBy_quotient_element_smul :
IsTorsionBy R (M⧸r • (⊤ : Submodule R M)) r :=
(isTorsionBy_quotient_iff _ _).mpr (smul_mem_pointwise_smul · r ⊤ ⟨⟩)

lemma isTorsionBySet_quotient_ideal_smul :
IsTorsionBySet R (M⧸I • (⊤ : Submodule R M)) I :=
(isTorsionBySet_quotient_iff _ _).mpr fun _ _ h => smul_mem_smul h ⟨⟩

instance : Module (R ⧸ Ideal.span s) (M ⧸ s • (⊤ : Submodule R M)) :=
((isTorsionBySet_iff_is_torsion_by_span s).mp
(isTorsionBySet_quotient_set_smul M s)).module

instance : Module (R ⧸ I) (M ⧸ I • (⊤ : Submodule R M)) :=
instance [I.IsTwoSided] : Module (R ⧸ I) (M ⧸ I • (⊤ : Submodule R M)) :=
(isTorsionBySet_quotient_ideal_smul M I).module

instance : Module (R ⧸ Ideal.span {r}) (M ⧸ r • (⊤ : Submodule R M)) :=
(isTorsionBy_quotient_element_smul M r).module

lemma Quotient.mk_smul_mk (r : R) (m : M) :
lemma Quotient.mk_smul_mk [I.IsTwoSided] (r : R) (m : M) :
Ideal.Quotient.mk I r •
Submodule.Quotient.mk (p := (I • ⊤ : Submodule R M)) m =
Submodule.Quotient.mk (p := (I • ⊤ : Submodule R M)) (r • m) :=
rfl

end Module

namespace Module

variable (M) [CommRing R] [AddCommGroup M] [Module R M] (s : Set R) (r : R)

open Pointwise

lemma isTorsionBy_quotient_element_smul :
IsTorsionBy R (M⧸r • (⊤ : Submodule R M)) r :=
(isTorsionBy_quotient_iff _ _).mpr (Submodule.smul_mem_pointwise_smul · r ⊤ ⟨⟩)

instance : Module (R ⧸ Ideal.span s) (M ⧸ s • (⊤ : Submodule R M)) :=
((isTorsionBySet_iff_is_torsion_by_span s).mp
(isTorsionBySet_quotient_set_smul M s)).module

instance : Module (R ⧸ Ideal.span {r}) (M ⧸ r • (⊤ : Submodule R M)) :=
(isTorsionBy_quotient_element_smul M r).module

end Module

namespace Submodule

variable [CommRing R] [AddCommGroup M] [Module R M]

instance (I : Ideal R) : Module (R ⧸ I) (torsionBySet R M I) :=
-- Porting note: times out without the (R := R)
Module.IsTorsionBySet.module <| torsionBySet_isTorsionBySet (R := R) I
Expand Down
5 changes: 1 addition & 4 deletions Mathlib/Algebra/RingQuot.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import Mathlib.RingTheory.Ideal.Quotient.Defs
import Mathlib.RingTheory.Ideal.Span

/-!
# Quotients of non-commutative rings

Unfortunately, ideals have only been developed in the commutative case as `Ideal`,
and it's not immediately clear how one should formalise ideals in the non-commutative case.
# Quotients of semirings

In this file, we directly define the quotient of a semiring by any relation,
by building a bigger relation that represents the ideal generated by that relation.
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/LinearAlgebra/Quotient/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ theorem mk_sub : (mk (x - y) : M ⧸ p) = mk x - mk y :=

protected nonrec lemma «forall» {P : M ⧸ p → Prop} : (∀ a, P a) ↔ ∀ a, P (mk a) := Quotient.forall

theorem subsingleton_iff : Subsingleton (M ⧸ p) ↔ ∀ x : M, x ∈ p := by
rw [subsingleton_iff_forall_eq 0, Submodule.Quotient.forall]
simp_rw [Submodule.Quotient.mk_eq_zero]

section SMul

variable {S : Type*} [SMul S R] [SMul S M] [IsScalarTower S R M] (P : Submodule R M)
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/NumberTheory/Padics/RingHoms.lean
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ theorem ker_toZMod : RingHom.ker (toZMod : ℤ_[p] →+* ZMod p) = maximalIdeal
· apply sub_zmodRepr_mem

/-- The equivalence between the residue field of the `p`-adic integers and `ℤ/pℤ` -/
def residueField : IsLocalRing.ResidueField ℤ_[p] ≃+* ZMod p := by
exact_mod_cast (@PadicInt.ker_toZMod p _) ▸ RingHom.quotientKerEquivOfSurjective
(ZMod.ringHom_surjective PadicInt.toZMod)
def residueField : IsLocalRing.ResidueField ℤ_[p] ≃+* ZMod p :=
(Ideal.quotEquivOfEq PadicInt.ker_toZMod.symm).trans <|
RingHom.quotientKerEquivOfSurjective (ZMod.ringHom_surjective PadicInt.toZMod)

/-- `appr n x` gives a value `v : ℕ` such that `x` and `↑v : ℤ_p` are congruent mod `p^n`.
See `appr_spec`. -/
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/RingTheory/AdicCompletion/Algebra.lean
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ theorem evalₐ_mkₐ (n : ℕ) (x : AdicCauchySequence I R) :
theorem Ideal.mk_eq_mk {m n : ℕ} (hmn : m ≤ n) (r : AdicCauchySequence I R) :
Ideal.Quotient.mk (I ^ m) (r.val n) = Ideal.Quotient.mk (I ^ m) (r.val m) := by
have h : I ^ m = I ^ m • ⊤ := by simp
rw [h, ← Ideal.Quotient.mk_eq_mk, ← Ideal.Quotient.mk_eq_mk]
rw [← Ideal.Quotient.mk_eq_mk, ← Ideal.Quotient.mk_eq_mk, h]
exact (r.property hmn).symm

theorem smul_mk {m n : ℕ} (hmn : m ≤ n) (r : AdicCauchySequence I R)
Expand Down
3 changes: 3 additions & 0 deletions Mathlib/RingTheory/Ideal/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def pi : Ideal (ι → α) where
theorem mem_pi (x : ι → α) : x ∈ I.pi ι ↔ ∀ i, x i ∈ I :=
Iff.rfl

instance (priority := low) [I.IsTwoSided] : (I.pi ι).IsTwoSided :=
⟨fun _b hb i ↦ mul_mem_right _ _ (hb i)⟩

end Pi

end Ideal
Expand Down
Loading
Loading