Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4e861f2

Browse files
committed
feat(group_theory/submonoid/basic): weaken assumptions for has_one instance to one_mem_class for set_like subobjects (#16104)
1 parent b4a51d9 commit 4e861f2

9 files changed

Lines changed: 23 additions & 19 deletions

File tree

src/algebra/algebra/subalgebra/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ protected lemma coe_sub {R : Type u} {A : Type v} [comm_ring R] [ring A] [algebr
278278
↑(algebra_map R' S r) = algebra_map R' A r := rfl
279279

280280
protected lemma coe_pow (x : S) (n : ℕ) : (↑(x^n) : A) = (↑x)^n := submonoid_class.coe_pow x n
281-
protected lemma coe_eq_zero {x : S} : (x : A) = 0 ↔ x = 0 := add_submonoid_class.coe_eq_zero
282-
protected lemma coe_eq_one {x : S} : (x : A) = 1 ↔ x = 1 := submonoid_class.coe_eq_one
281+
protected lemma coe_eq_zero {x : S} : (x : A) = 0 ↔ x = 0 := zero_mem_class.coe_eq_zero
282+
protected lemma coe_eq_one {x : S} : (x : A) = 1 ↔ x = 1 := one_mem_class.coe_eq_one
283283

284284
-- todo: standardize on the names these morphisms
285285
-- compare with submodule.subtype

src/algebra/direct_sum/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ lemma coe_of_apply {M S : Type*} [decidable_eq ι] [add_comm_monoid M]
263263
begin
264264
obtain rfl | h := decidable.eq_or_ne i j,
265265
{ rw [direct_sum.of_eq_same, if_pos rfl], },
266-
{ rw [direct_sum.of_eq_of_ne _ _ _ _ h, if_neg h, add_submonoid_class.coe_zero], },
266+
{ rw [direct_sum.of_eq_of_ne _ _ _ _ h, if_neg h, zero_mem_class.coe_zero], },
267267
end
268268

269269
/-- The `direct_sum` formed by a collection of additive submonoids (or subgroups, or submodules) of

src/algebra/direct_sum/decomposition.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ by rw [decompose_of_mem _ hx, direct_sum.of_eq_same, subtype.coe_mk]
109109
lemma decompose_of_mem_ne {x : M} {i j : ι} (hx : x ∈ ℳ i) (hij : i ≠ j):
110110
(decompose ℳ x j : M) = 0 :=
111111
by rw [decompose_of_mem _ hx, direct_sum.of_eq_of_ne _ _ _ _ hij,
112-
add_submonoid_class.coe_zero]
112+
zero_mem_class.coe_zero]
113113

114114
/-- If `M` is graded by `ι` with degree `i` component `ℳ i`, then it is isomorphic as
115115
an additive monoid to a direct sum of components. -/

src/algebra/module/injective.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ begin
261261
rw extension_of_max_adjoin.extend_ideal_to_is_extension i f h y r
262262
(by rw eq1; exact submodule.zero_mem _ : r • y ∈ _),
263263
simp only [extension_of_max_adjoin.ideal_to, linear_map.coe_mk, eq1, subtype.coe_mk,
264-
add_submonoid_class.zero_def, (extension_of_max i f).to_linear_pmap.map_zero]
264+
zero_mem_class.zero_def, (extension_of_max i f).to_linear_pmap.map_zero]
265265
end
266266

267267
lemma extension_of_max_adjoin.extend_ideal_to_wd (h : module.Baer R Q) {y : N} (r r' : R)

src/field_theory/intermediate_field.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ begin
370370
← is_scalar_tower.algebra_map_eq, ← eval₂_eq_eval_map] },
371371
{ obtain ⟨P, hPmo, hProot⟩ := h,
372372
refine ⟨P, hPmo, _⟩,
373-
rw [← aeval_def, aeval_coe, aeval_def, hProot, add_submonoid_class.coe_zero] },
373+
rw [← aeval_def, aeval_coe, aeval_def, hProot, zero_mem_class.coe_zero] },
374374
end
375375

376376
/-- The map `E → F` when `E` is an intermediate field contained in the intermediate field `F`.

src/group_theory/submonoid/operations.lean

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,25 +388,29 @@ end galois_insertion
388388

389389
end submonoid
390390

391-
namespace submonoid_class
391+
namespace one_mem_class
392392

393-
variables {A : Type*} [set_like A M] [hA : submonoid_class A M] (S' : A)
393+
variables {A M₁ : Type*} [set_like A M] [has_one M₁] [hA : one_mem_class A M] (S' : A)
394394
include hA
395395

396396
/-- A submonoid of a monoid inherits a 1. -/
397397
@[to_additive "An `add_submonoid` of an `add_monoid` inherits a zero."]
398-
instance has_one : has_one S' := ⟨⟨_, one_mem S'⟩⟩
398+
instance has_one : has_one S' := ⟨⟨1, one_mem_class.one_mem S'⟩⟩
399399

400-
@[simp, norm_cast, to_additive] lemma coe_one : ((1 : S') : M) = 1 := rfl
400+
@[simp, norm_cast, to_additive] lemma coe_one : ((1 : S') : M) = 1 := rfl
401401

402402
variables {S'}
403-
@[simp, norm_cast, to_additive] lemma coe_eq_one {x : S'} : (↑x : M) = 1 ↔ x = 1 :=
404-
(subtype.ext_iff.symm : (x : M) = (1 : S') ↔ x = 1)
403+
@[simp, norm_cast, to_additive] lemma coe_eq_one {x : S'} : (↑x : M) = 1 ↔ x = 1 :=
404+
(subtype.ext_iff.symm : (x : M) = (1 : S') ↔ x = 1)
405405
variables (S')
406406

407-
@[to_additive] lemma one_def : (1 : S') = ⟨1, one_mem S'⟩ := rfl
407+
@[to_additive] lemma one_def : (1 : S') = ⟨1, one_mem_class.one_mem S'⟩ := rfl
408+
409+
end one_mem_class
408410

409-
omit hA
411+
namespace submonoid_class
412+
413+
variables {A : Type*} [set_like A M] [hA : submonoid_class A M] (S' : A)
410414

411415
/-- An `add_submonoid` of an `add_monoid` inherits a scalar multiplication. -/
412416
instance _root_.add_submonoid_class.has_nsmul {M} [add_monoid M] {A : Type*} [set_like A M]

src/ring_theory/graded_algebra/basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ by rw [graded_ring.proj_apply, decompose_symm_of, equiv.apply_symm_apply]
9999

100100
lemma graded_ring.mem_support_iff [Π i (x : 𝒜 i), decidable (x ≠ 0)] (r : A) (i : ι) :
101101
i ∈ (decompose 𝒜 r).support ↔ graded_ring.proj 𝒜 i r ≠ 0 :=
102-
dfinsupp.mem_support_iff.trans add_submonoid_class.coe_eq_zero.not.symm
102+
dfinsupp.mem_support_iff.trans zero_mem_class.coe_eq_zero.not.symm
103103

104104
end graded_ring
105105

@@ -246,10 +246,10 @@ def graded_ring.proj_zero_ring_hom : A →+* A :=
246246
map_add' := λ _ _, by { rw decompose_add, refl },
247247
map_mul' := begin
248248
refine direct_sum.decomposition.induction_on 𝒜 (λ x, _) _ _,
249-
{ simp only [zero_mul, decompose_zero, zero_apply, add_submonoid_class.coe_zero] },
249+
{ simp only [zero_mul, decompose_zero, zero_apply, zero_mem_class.coe_zero] },
250250
{ rintros i ⟨c, hc⟩,
251251
refine direct_sum.decomposition.induction_on 𝒜 _ _ _,
252-
{ simp only [mul_zero, decompose_zero, zero_apply, add_submonoid_class.coe_zero] },
252+
{ simp only [mul_zero, decompose_zero, zero_apply, zero_mem_class.coe_zero] },
253253
{ rintros j ⟨c', hc'⟩,
254254
{ simp only [subtype.coe_mk],
255255
by_cases h : i + j = 0,

src/ring_theory/graded_algebra/homogeneous_ideal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def homogeneous_ideal.irrelevant : homogeneous_ideal 𝒜 :=
553553
⟨(graded_ring.proj_zero_ring_hom 𝒜).ker, λ i r (hr : (decompose 𝒜 r 0 : A) = 0), begin
554554
change (decompose 𝒜 (decompose 𝒜 r _ : A) 0 : A) = 0,
555555
by_cases h : i = 0,
556-
{ rw [h, hr, decompose_zero, zero_apply, add_submonoid_class.coe_zero] },
556+
{ rw [h, hr, decompose_zero, zero_apply, zero_mem_class.coe_zero] },
557557
{ rw [decompose_of_mem_ne 𝒜 (set_like.coe_mem _) h] }
558558
end
559559

src/ring_theory/polynomial/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ begin
696696
obtain ⟨x, hx'⟩ := x,
697697
obtain ⟨y, rfl⟩ := (ring_hom.mem_range).1 hx',
698698
refine subtype.eq _,
699-
simp only [ring_hom.comp_apply, quotient.eq_zero_iff_mem, add_submonoid_class.coe_zero,
699+
simp only [ring_hom.comp_apply, quotient.eq_zero_iff_mem, zero_mem_class.coe_zero,
700700
subtype.val_eq_coe],
701701
suffices : C (i y) ∈ (I.map (polynomial.map_ring_hom i)),
702702
{ obtain ⟨f, hf⟩ := mem_image_of_mem_map_of_surjective (polynomial.map_ring_hom i)

0 commit comments

Comments
 (0)