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

[Merged by Bors] - chore(*/centralizer): add forgotten to_additives #19168

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions src/group_theory/subgroup/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1604,12 +1604,13 @@ set_like.ext' (set.centralizer_univ G)
@[to_additive] lemma le_centralizer_iff : H ≤ K.centralizer ↔ K ≤ H.centralizer :=
⟨λ h x hx y hy, (h hy x hx).symm, λ h x hx y hy, (h hy x hx).symm⟩

lemma center_le_centralizer (s) : center G ≤ centralizer s := set.center_subset_centralizer s
@[to_additive] lemma center_le_centralizer (s) : center G ≤ centralizer s :=
set.center_subset_centralizer s

@[to_additive] lemma centralizer_le (h : H ≤ K) : centralizer K ≤ centralizer H :=
submonoid.centralizer_le h

@[simp] lemma centralizer_eq_top_iff_subset {s} : centralizer s = ⊤ ↔ s ≤ center G :=
@[simp, to_additive] lemma centralizer_eq_top_iff_subset {s} : centralizer s = ⊤ ↔ s ≤ center G :=
set_like.ext'_iff.trans set.centralizer_eq_top_iff_subset

@[to_additive] instance subgroup.centralizer.characteristic [hH : H.characteristic] :
Expand Down
6 changes: 4 additions & 2 deletions src/group_theory/submonoid/centralizer.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ variables {S}
@[to_additive] lemma mem_centralizer_iff {z : M} : z ∈ centralizer S ↔ ∀ g ∈ S, g * z = z * g :=
iff.rfl

lemma center_le_centralizer (s) : center M ≤ centralizer s := s.center_subset_centralizer
@[to_additive] lemma center_le_centralizer (s) : center M ≤ centralizer s :=
s.center_subset_centralizer

@[to_additive] instance decidable_mem_centralizer (a) [decidable $ ∀ b ∈ S, b * a = a * b] :
decidable (a ∈ centralizer S) :=
Expand All @@ -60,7 +61,8 @@ decidable_of_iff' _ mem_centralizer_iff
lemma centralizer_le (h : S ⊆ T) : centralizer T ≤ centralizer S :=
set.centralizer_subset h

@[simp] lemma centralizer_eq_top_iff_subset {s : set M} : centralizer s = ⊤ ↔ s ⊆ center M :=
@[simp, to_additive] lemma centralizer_eq_top_iff_subset {s : set M} :
centralizer s = ⊤ ↔ s ⊆ center M :=
set_like.ext'_iff.trans set.centralizer_eq_top_iff_subset

variables (M)
Expand Down
8 changes: 6 additions & 2 deletions src/group_theory/subsemigroup/centralizer.lean
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ end
lemma centralizer_subset [has_mul M] (h : S ⊆ T) : centralizer T ⊆ centralizer S :=
λ t ht s hs, ht s (h hs)

@[to_additive add_center_subset_add_centralizer]
Copy link
Member

@urkud urkud Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What name does to_additive generate here? Why does it generate a wrong name here and generates a correct name for center_le_centralizer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gives the same name. I'm not sure why later on it's not an issue, maybe when a section closes the database for to_additive updates, or the like. I think it's the same in lean4

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and generates a correct name for center_le_centralizer?

Because the correct additivized name for subgroup.center_le_centralizer is add_subsemigroup.center_le_centralizer, there's no need to replace centralizer with add_centralizer.

Only the set lemmas need these renames.

lemma center_subset_centralizer [has_mul M] (S : set M) : set.center M ⊆ S.centralizer :=
λ x hx m _, hx m

@[simp] lemma centralizer_eq_top_iff_subset {s : set M} [has_mul M] :
@[simp, to_additive add_centralizer_eq_top_iff_subset]
lemma centralizer_eq_top_iff_subset {s : set M} [has_mul M] :
centralizer s = set.univ ↔ s ⊆ center M :=
eq_top_iff.trans $ ⟨λ h x hx g, (h trivial _ hx).symm,
λ h x _ m hm, (h hm x).symm⟩
Expand Down Expand Up @@ -144,13 +146,15 @@ iff.rfl
decidable (a ∈ centralizer S) :=
decidable_of_iff' _ mem_centralizer_iff

@[to_additive]
lemma center_le_centralizer (S) : center M ≤ centralizer S := S.center_subset_centralizer

@[to_additive]
lemma centralizer_le (h : S ⊆ T) : centralizer T ≤ centralizer S :=
set.centralizer_subset h

@[simp] lemma centralizer_eq_top_iff_subset {s : set M} : centralizer s = ⊤ ↔ s ⊆ center M :=
@[simp, to_additive]
lemma centralizer_eq_top_iff_subset {s : set M} : centralizer s = ⊤ ↔ s ⊆ center M :=
set_like.ext'_iff.trans set.centralizer_eq_top_iff_subset

variables (M)
Expand Down