group_theory.submonoid.centerMathlib.GroupTheory.Submonoid.Center

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
 import GroupTheory.Submonoid.Operations
-import GroupTheory.Subsemigroup.Center
+import Algebra.Group.Center
 
 #align_import group_theory.submonoid.center from "leanprover-community/mathlib"@"baba818b9acea366489e8ba32d2cc0fcaf50a1f7"
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.GroupTheory.Submonoid.Operations
-import Mathbin.GroupTheory.Subsemigroup.Center
+import GroupTheory.Submonoid.Operations
+import GroupTheory.Subsemigroup.Center
 
 #align_import group_theory.submonoid.center from "leanprover-community/mathlib"@"baba818b9acea366489e8ba32d2cc0fcaf50a1f7"
 
Diff
@@ -37,7 +37,7 @@ variable (M : Type _) [Monoid M]
 def center : Submonoid M where
   carrier := Set.center M
   one_mem' := Set.one_mem_center M
-  mul_mem' a b := Set.mul_mem_center
+  hMul_mem' a b := Set.mul_mem_center
 #align submonoid.center Submonoid.center
 #align add_submonoid.center AddSubmonoid.center
 -/
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module group_theory.submonoid.center
-! leanprover-community/mathlib commit baba818b9acea366489e8ba32d2cc0fcaf50a1f7
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.GroupTheory.Submonoid.Operations
 import Mathbin.GroupTheory.Subsemigroup.Center
 
+#align_import group_theory.submonoid.center from "leanprover-community/mathlib"@"baba818b9acea366489e8ba32d2cc0fcaf50a1f7"
+
 /-!
 # Centers of monoids
 
Diff
@@ -45,51 +45,65 @@ def center : Submonoid M where
 #align add_submonoid.center AddSubmonoid.center
 -/
 
+#print Submonoid.coe_center /-
 @[to_additive]
 theorem coe_center : ↑(center M) = Set.center M :=
   rfl
 #align submonoid.coe_center Submonoid.coe_center
 #align add_submonoid.coe_center AddSubmonoid.coe_center
+-/
 
+#print Submonoid.center_toSubsemigroup /-
 @[simp]
 theorem center_toSubsemigroup : (center M).toSubsemigroup = Subsemigroup.center M :=
   rfl
 #align submonoid.center_to_subsemigroup Submonoid.center_toSubsemigroup
+-/
 
+#print AddSubmonoid.center_toAddSubsemigroup /-
 theorem AddSubmonoid.center_toAddSubsemigroup (M) [AddMonoid M] :
     (AddSubmonoid.center M).toAddSubsemigroup = AddSubsemigroup.center M :=
   rfl
 #align add_submonoid.center_to_add_subsemigroup AddSubmonoid.center_toAddSubsemigroup
+-/
 
 attribute [to_additive AddSubmonoid.center_toAddSubsemigroup] Submonoid.center_toSubsemigroup
 
 variable {M}
 
+#print Submonoid.mem_center_iff /-
 @[to_additive]
 theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g :=
   Iff.rfl
 #align submonoid.mem_center_iff Submonoid.mem_center_iff
 #align add_submonoid.mem_center_iff AddSubmonoid.mem_center_iff
+-/
 
+#print Submonoid.decidableMemCenter /-
 @[to_additive]
 instance decidableMemCenter (a) [Decidable <| ∀ b : M, b * a = a * b] : Decidable (a ∈ center M) :=
   decidable_of_iff' _ mem_center_iff
 #align submonoid.decidable_mem_center Submonoid.decidableMemCenter
 #align add_submonoid.decidable_mem_center AddSubmonoid.decidableMemCenter
+-/
 
 /-- The center of a monoid is commutative. -/
 instance : CommMonoid (center M) :=
   { (center M).toMonoid with mul_comm := fun a b => Subtype.ext <| b.Prop _ }
 
+#print Submonoid.center.smulCommClass_left /-
 /-- The center of a monoid acts commutatively on that monoid. -/
 instance center.smulCommClass_left : SMulCommClass (center M) M M
     where smul_comm m x y := (Commute.left_comm (m.Prop x) y).symm
 #align submonoid.center.smul_comm_class_left Submonoid.center.smulCommClass_left
+-/
 
+#print Submonoid.center.smulCommClass_right /-
 /-- The center of a monoid acts commutatively on that monoid. -/
 instance center.smulCommClass_right : SMulCommClass M (center M) M :=
   SMulCommClass.symm _ _ _
 #align submonoid.center.smul_comm_class_right Submonoid.center.smulCommClass_right
+-/
 
 /-! Note that `smul_comm_class (center M) (center M) M` is already implied by
 `submonoid.smul_comm_class_right` -/
@@ -103,10 +117,12 @@ section
 
 variable (M : Type _) [CommMonoid M]
 
+#print Submonoid.center_eq_top /-
 @[simp]
 theorem center_eq_top : center M = ⊤ :=
   SetLike.coe_injective (Set.center_eq_univ M)
 #align submonoid.center_eq_top Submonoid.center_eq_top
+-/
 
 end
 
Diff
@@ -45,35 +45,17 @@ def center : Submonoid M where
 #align add_submonoid.center AddSubmonoid.center
 -/
 
-/- warning: submonoid.coe_center -> Submonoid.coe_center is a dubious translation:
-lean 3 declaration is
-  forall (M : Type.{u1}) [_inst_1 : Monoid.{u1} M], Eq.{succ u1} (Set.{u1} M) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Set.{u1} M) (HasLiftT.mk.{succ u1, succ u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Set.{u1} M) (CoeTCₓ.coe.{succ u1, succ u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Set.{u1} M) (SetLike.Set.hasCoeT.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.setLike.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))))) (Submonoid.center.{u1} M _inst_1)) (Set.center.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)))
-but is expected to have type
-  forall (M : Type.{u1}) [_inst_1 : Monoid.{u1} M], Eq.{succ u1} (Set.{u1} M) (SetLike.coe.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.instSetLikeSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (Submonoid.center.{u1} M _inst_1)) (Set.center.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)))
-Case conversion may be inaccurate. Consider using '#align submonoid.coe_center Submonoid.coe_centerₓ'. -/
 @[to_additive]
 theorem coe_center : ↑(center M) = Set.center M :=
   rfl
 #align submonoid.coe_center Submonoid.coe_center
 #align add_submonoid.coe_center AddSubmonoid.coe_center
 
-/- warning: submonoid.center_to_subsemigroup -> Submonoid.center_toSubsemigroup is a dubious translation:
-lean 3 declaration is
-  forall (M : Type.{u1}) [_inst_1 : Monoid.{u1} M], Eq.{succ u1} (Subsemigroup.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.toSubsemigroup.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1) (Submonoid.center.{u1} M _inst_1)) (Subsemigroup.center.{u1} M (Monoid.toSemigroup.{u1} M _inst_1))
-but is expected to have type
-  forall (M : Type.{u1}) [_inst_1 : Monoid.{u1} M], Eq.{succ u1} (Subsemigroup.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.toSubsemigroup.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1) (Submonoid.center.{u1} M _inst_1)) (Subsemigroup.center.{u1} M (Monoid.toSemigroup.{u1} M _inst_1))
-Case conversion may be inaccurate. Consider using '#align submonoid.center_to_subsemigroup Submonoid.center_toSubsemigroupₓ'. -/
 @[simp]
 theorem center_toSubsemigroup : (center M).toSubsemigroup = Subsemigroup.center M :=
   rfl
 #align submonoid.center_to_subsemigroup Submonoid.center_toSubsemigroup
 
-/- warning: add_submonoid.center_to_add_subsemigroup -> AddSubmonoid.center_toAddSubsemigroup is a dubious translation:
-lean 3 declaration is
-  forall (M : Type.{u1}) [_inst_2 : AddMonoid.{u1} M], Eq.{succ u1} (AddSubsemigroup.{u1} M (AddZeroClass.toHasAdd.{u1} M (AddMonoid.toAddZeroClass.{u1} M _inst_2))) (AddSubmonoid.toAddSubsemigroup.{u1} M (AddMonoid.toAddZeroClass.{u1} M _inst_2) (AddSubmonoid.center.{u1} M _inst_2)) (AddSubsemigroup.center.{u1} M (AddMonoid.toAddSemigroup.{u1} M _inst_2))
-but is expected to have type
-  forall (M : Type.{u1}) [_inst_2 : AddMonoid.{u1} M], Eq.{succ u1} (AddSubsemigroup.{u1} M (AddZeroClass.toAdd.{u1} M (AddMonoid.toAddZeroClass.{u1} M _inst_2))) (AddSubmonoid.toAddSubsemigroup.{u1} M (AddMonoid.toAddZeroClass.{u1} M _inst_2) (AddSubmonoid.center.{u1} M _inst_2)) (AddSubsemigroup.center.{u1} M (AddMonoid.toAddSemigroup.{u1} M _inst_2))
-Case conversion may be inaccurate. Consider using '#align add_submonoid.center_to_add_subsemigroup AddSubmonoid.center_toAddSubsemigroupₓ'. -/
 theorem AddSubmonoid.center_toAddSubsemigroup (M) [AddMonoid M] :
     (AddSubmonoid.center M).toAddSubsemigroup = AddSubsemigroup.center M :=
   rfl
@@ -83,24 +65,12 @@ attribute [to_additive AddSubmonoid.center_toAddSubsemigroup] Submonoid.center_t
 
 variable {M}
 
-/- warning: submonoid.mem_center_iff -> Submonoid.mem_center_iff is a dubious translation:
-lean 3 declaration is
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {z : M}, Iff (Membership.Mem.{u1, u1} M (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.setLike.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) z (Submonoid.center.{u1} M _inst_1)) (forall (g : M), Eq.{succ u1} M (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) g z) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) z g))
-but is expected to have type
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] {z : M}, Iff (Membership.mem.{u1, u1} M (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.instSetLikeSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) z (Submonoid.center.{u1} M _inst_1)) (forall (g : M), Eq.{succ u1} M (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) g z) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) z g))
-Case conversion may be inaccurate. Consider using '#align submonoid.mem_center_iff Submonoid.mem_center_iffₓ'. -/
 @[to_additive]
 theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g :=
   Iff.rfl
 #align submonoid.mem_center_iff Submonoid.mem_center_iff
 #align add_submonoid.mem_center_iff AddSubmonoid.mem_center_iff
 
-/- warning: submonoid.decidable_mem_center -> Submonoid.decidableMemCenter is a dubious translation:
-lean 3 declaration is
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] (a : M) [_inst_2 : Decidable (forall (b : M), Eq.{succ u1} M (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) b a) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) a b))], Decidable (Membership.Mem.{u1, u1} M (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (SetLike.hasMem.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.setLike.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) a (Submonoid.center.{u1} M _inst_1))
-but is expected to have type
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M] (a : M) [_inst_2 : Decidable (forall (b : M), Eq.{succ u1} M (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) b a) (HMul.hMul.{u1, u1, u1} M M M (instHMul.{u1} M (MulOneClass.toMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) a b))], Decidable (Membership.mem.{u1, u1} M (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.instSetLikeSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) a (Submonoid.center.{u1} M _inst_1))
-Case conversion may be inaccurate. Consider using '#align submonoid.decidable_mem_center Submonoid.decidableMemCenterₓ'. -/
 @[to_additive]
 instance decidableMemCenter (a) [Decidable <| ∀ b : M, b * a = a * b] : Decidable (a ∈ center M) :=
   decidable_of_iff' _ mem_center_iff
@@ -111,23 +81,11 @@ instance decidableMemCenter (a) [Decidable <| ∀ b : M, b * a = a * b] : Decida
 instance : CommMonoid (center M) :=
   { (center M).toMonoid with mul_comm := fun a b => Subtype.ext <| b.Prop _ }
 
-/- warning: submonoid.center.smul_comm_class_left -> Submonoid.center.smulCommClass_left is a dubious translation:
-lean 3 declaration is
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M], SMulCommClass.{u1, u1, u1} (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.setLike.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.center.{u1} M _inst_1)) M M (Submonoid.hasSmul.{u1, u1} M M (Monoid.toMulOneClass.{u1} M _inst_1) (Mul.toSMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.center.{u1} M _inst_1)) (Mul.toSMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)))
-but is expected to have type
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M], SMulCommClass.{u1, u1, u1} (Subtype.{succ u1} M (fun (x : M) => Membership.mem.{u1, u1} M (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.instSetLikeSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) x (Submonoid.center.{u1} M _inst_1))) M M (Submonoid.smul.{u1, u1} M M (Monoid.toMulOneClass.{u1} M _inst_1) (MulAction.toSMul.{u1, u1} M M _inst_1 (Monoid.toMulAction.{u1} M _inst_1)) (Submonoid.center.{u1} M _inst_1)) (MulAction.toSMul.{u1, u1} M M _inst_1 (Monoid.toMulAction.{u1} M _inst_1))
-Case conversion may be inaccurate. Consider using '#align submonoid.center.smul_comm_class_left Submonoid.center.smulCommClass_leftₓ'. -/
 /-- The center of a monoid acts commutatively on that monoid. -/
 instance center.smulCommClass_left : SMulCommClass (center M) M M
     where smul_comm m x y := (Commute.left_comm (m.Prop x) y).symm
 #align submonoid.center.smul_comm_class_left Submonoid.center.smulCommClass_left
 
-/- warning: submonoid.center.smul_comm_class_right -> Submonoid.center.smulCommClass_right is a dubious translation:
-lean 3 declaration is
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M], SMulCommClass.{u1, u1, u1} M (coeSort.{succ u1, succ (succ u1)} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) Type.{u1} (SetLike.hasCoeToSort.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.setLike.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.center.{u1} M _inst_1)) M (Mul.toSMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.hasSmul.{u1, u1} M M (Monoid.toMulOneClass.{u1} M _inst_1) (Mul.toSMul.{u1} M (MulOneClass.toHasMul.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) (Submonoid.center.{u1} M _inst_1))
-but is expected to have type
-  forall {M : Type.{u1}} [_inst_1 : Monoid.{u1} M], SMulCommClass.{u1, u1, u1} M (Subtype.{succ u1} M (fun (x : M) => Membership.mem.{u1, u1} M (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) (SetLike.instMembership.{u1, u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1)) M (Submonoid.instSetLikeSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M _inst_1))) x (Submonoid.center.{u1} M _inst_1))) M (MulAction.toSMul.{u1, u1} M M _inst_1 (Monoid.toMulAction.{u1} M _inst_1)) (Submonoid.smul.{u1, u1} M M (Monoid.toMulOneClass.{u1} M _inst_1) (MulAction.toSMul.{u1, u1} M M _inst_1 (Monoid.toMulAction.{u1} M _inst_1)) (Submonoid.center.{u1} M _inst_1))
-Case conversion may be inaccurate. Consider using '#align submonoid.center.smul_comm_class_right Submonoid.center.smulCommClass_rightₓ'. -/
 /-- The center of a monoid acts commutatively on that monoid. -/
 instance center.smulCommClass_right : SMulCommClass M (center M) M :=
   SMulCommClass.symm _ _ _
@@ -145,12 +103,6 @@ section
 
 variable (M : Type _) [CommMonoid M]
 
-/- warning: submonoid.center_eq_top -> Submonoid.center_eq_top is a dubious translation:
-lean 3 declaration is
-  forall (M : Type.{u1}) [_inst_1 : CommMonoid.{u1} M], Eq.{succ u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))) (Submonoid.center.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1)) (Top.top.{u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))) (Submonoid.hasTop.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))))
-but is expected to have type
-  forall (M : Type.{u1}) [_inst_1 : CommMonoid.{u1} M], Eq.{succ u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))) (Submonoid.center.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1)) (Top.top.{u1} (Submonoid.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))) (Submonoid.instTopSubmonoid.{u1} M (Monoid.toMulOneClass.{u1} M (CommMonoid.toMonoid.{u1} M _inst_1))))
-Case conversion may be inaccurate. Consider using '#align submonoid.center_eq_top Submonoid.center_eq_topₓ'. -/
 @[simp]
 theorem center_eq_top : center M = ⊤ :=
   SetLike.coe_injective (Set.center_eq_univ M)

Changes in mathlib4

mathlib3
mathlib4
chore(diamonds): appropriate transparency levels for diamond checks (#10910)

Currently, we have multiple "no-diamond" tests of the form

example : x = y := rfl

where X and Y are instances of some class. The problem is that since simp and type class synthesis operate at reducible_and_instances transparency this check means little.

We went through all the mentions of diamonds and either added with_reducible_and_instancse or added a reference to the issue #10906.

Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>

Diff
@@ -72,9 +72,8 @@ instance center.commMonoid : CommMonoid (center M) :=
   { (center M).toMonoid, Subsemigroup.center.commSemigroup with }
 
 -- no instance diamond, unlike the primed version
-example :
-    center.commMonoid.toMonoid = Submonoid.toMonoid (center M) :=
-  rfl
+example : center.commMonoid.toMonoid = Submonoid.toMonoid (center M) := by
+  with_reducible_and_instances rfl
 
 @[to_additive]
 theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g := by
refactor(Algebra): Define the center appropriately for non-associative algebras (#6996)

For a sensible theory, we require that the centre of an algebra is closed under multiplication. The definition currently in Mathlib works for associative algebras, but not non-associative algebras. This PR uses the definition from Cabrera García and Rodríguez Palacios, which works for any multiplication (addition) and which coincides with the current definition in the associative case.

I did consider whether the centralizer should also be re-defined in terms of operator commutation, but this still results in a centralizer which is not closed under multiplication in the non-associative case. I have therefore retained the current definition, but changed centralizer_eq_top_iff_subset and centralizer_univ to only work in the associative case.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com> Co-authored-by: Christopher Hoskin <christopher.hoskin@overleaf.com>

Diff
@@ -23,13 +23,15 @@ other files.
 
 namespace Submonoid
 
-section
+section MulOneClass
 
-variable (M : Type*) [Monoid M]
+variable (M : Type*) [MulOneClass M]
 
-/-- The center of a monoid `M` is the set of elements that commute with everything in `M` -/
+/-- The center of a multiplication with unit `M` is the set of elements that commute with everything
+in `M` -/
 @[to_additive
-      "The center of a monoid `M` is the set of elements that commute with everything in `M`"]
+      "The center of an addition with zero `M` is the set of elements that commute with everything
+      in `M`"]
 def center : Submonoid M where
   carrier := Set.center M
   one_mem' := Set.one_mem_center M
@@ -50,9 +52,34 @@ theorem center_toSubsemigroup : (center M).toSubsemigroup = Subsemigroup.center
 
 variable {M}
 
+/-- The center of a multiplication with unit is commutative and associative.
+
+This is not an instance as it forms an non-defeq diamond with `Submonoid.toMonoid` in the `npow`
+field. -/
+@[to_additive "The center of an addition with zero is commutative and associative."]
+abbrev center.commMonoid' : CommMonoid (center M) :=
+  { (center M).toMulOneClass, Subsemigroup.center.commSemigroup with }
+
+end MulOneClass
+
+section Monoid
+
+variable {M} [Monoid M]
+
+/-- The center of a monoid is commutative. -/
+@[to_additive]
+instance center.commMonoid : CommMonoid (center M) :=
+  { (center M).toMonoid, Subsemigroup.center.commSemigroup with }
+
+-- no instance diamond, unlike the primed version
+example :
+    center.commMonoid.toMonoid = Submonoid.toMonoid (center M) :=
+  rfl
+
 @[to_additive]
-theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g :=
-  Iff.rfl
+theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g := by
+  rw [← Semigroup.mem_center_iff]
+  exact Iff.rfl
 #align submonoid.mem_center_iff Submonoid.mem_center_iff
 #align add_submonoid.mem_center_iff AddSubmonoid.mem_center_iff
 
@@ -62,14 +89,11 @@ instance decidableMemCenter (a) [Decidable <| ∀ b : M, b * a = a * b] : Decida
 #align submonoid.decidable_mem_center Submonoid.decidableMemCenter
 #align add_submonoid.decidable_mem_center AddSubmonoid.decidableMemCenter
 
-/-- The center of a monoid is commutative. -/
-instance center.commMonoid : CommMonoid (center M) :=
-  { (center M).toMonoid with
-    mul_comm := fun _ b => Subtype.ext <| b.prop _ }
+
 
 /-- The center of a monoid acts commutatively on that monoid. -/
 instance center.smulCommClass_left : SMulCommClass (center M) M M where
-  smul_comm m x y := (Commute.left_comm (m.prop x) y).symm
+  smul_comm m x y := Commute.left_comm (m.prop.comm x) y
 #align submonoid.center.smul_comm_class_left Submonoid.center.smulCommClass_left
 
 /-- The center of a monoid acts commutatively on that monoid. -/
@@ -82,7 +106,7 @@ instance center.smulCommClass_right : SMulCommClass M (center M) M :=
 
 example : SMulCommClass (center M) (center M) M := by infer_instance
 
-end
+end Monoid
 
 section
 
@@ -105,7 +129,11 @@ equivalence in general; one case when it is is for groups with zero, which is co
 @[to_additive (attr := simps! apply_coe_val)
   "For an additive monoid, the units of the center inject into the center of the units."]
 def unitsCenterToCenterUnits [Monoid M] : (Submonoid.center M)ˣ →* Submonoid.center (Mˣ) :=
-  (Units.map (Submonoid.center M).subtype).codRestrict _ <| fun u r ↦ Units.ext <| u.1.prop r
+  (Units.map (Submonoid.center M).subtype).codRestrict _ <|
+      fun u ↦ Submonoid.mem_center_iff.mpr <|
+        fun r ↦ Units.ext <| by
+        rw [Units.val_mul, Units.coe_map, Submonoid.coe_subtype, Units.val_mul, Units.coe_map,
+          Submonoid.coe_subtype, u.1.prop.comm r]
 
 @[to_additive]
 theorem unitsCenterToCenterUnits_injective [Monoid M] :
style: fix wrapping of where (#7149)
Diff
@@ -68,8 +68,8 @@ instance center.commMonoid : CommMonoid (center M) :=
     mul_comm := fun _ b => Subtype.ext <| b.prop _ }
 
 /-- The center of a monoid acts commutatively on that monoid. -/
-instance center.smulCommClass_left : SMulCommClass (center M) M M
-    where smul_comm m x y := (Commute.left_comm (m.prop x) y).symm
+instance center.smulCommClass_left : SMulCommClass (center M) M M where
+  smul_comm m x y := (Commute.left_comm (m.prop x) y).symm
 #align submonoid.center.smul_comm_class_left Submonoid.center.smulCommClass_left
 
 /-- The center of a monoid acts commutatively on that monoid. -/
feat: unit equivalences (#6526)

Useful for Wedderburn's little theorem.

Co-authored-by: Eric Rodriguez <37984851+ericrbg@users.noreply.github.com>

Diff
@@ -97,5 +97,20 @@ end
 
 end Submonoid
 
+variable (M)
+
+/-- For a monoid, the units of the center inject into the center of the units. This is not an
+equivalence in general; one case when it is is for groups with zero, which is covered in
+`centerUnitsEquivUnitsCenter`. -/
+@[to_additive (attr := simps! apply_coe_val)
+  "For an additive monoid, the units of the center inject into the center of the units."]
+def unitsCenterToCenterUnits [Monoid M] : (Submonoid.center M)ˣ →* Submonoid.center (Mˣ) :=
+  (Units.map (Submonoid.center M).subtype).codRestrict _ <| fun u r ↦ Units.ext <| u.1.prop r
+
+@[to_additive]
+theorem unitsCenterToCenterUnits_injective [Monoid M] :
+    Function.Injective (unitsCenterToCenterUnits M) :=
+  fun _a _b h => Units.ext <| Subtype.ext <| congr_arg (Units.val ∘ Subtype.val) h
+
 -- Guard against import creep
 assert_not_exists Finset
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -25,7 +25,7 @@ namespace Submonoid
 
 section
 
-variable (M : Type _) [Monoid M]
+variable (M : Type*) [Monoid M]
 
 /-- The center of a monoid `M` is the set of elements that commute with everything in `M` -/
 @[to_additive
@@ -86,7 +86,7 @@ end
 
 section
 
-variable (M : Type _) [CommMonoid M]
+variable (M : Type*) [CommMonoid M]
 
 @[simp]
 theorem center_eq_top : center M = ⊤ :=
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module group_theory.submonoid.center
-! leanprover-community/mathlib commit 6cb77a8eaff0ddd100e87b1591c6d3ad319514ff
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.GroupTheory.Submonoid.Operations
 import Mathlib.GroupTheory.Subsemigroup.Center
 
+#align_import group_theory.submonoid.center from "leanprover-community/mathlib"@"6cb77a8eaff0ddd100e87b1591c6d3ad319514ff"
+
 /-!
 # Centers of monoids
 
feat: assert_not_exists (#4245)
Diff
@@ -100,6 +100,5 @@ end
 
 end Submonoid
 
--- Porting note: `assert_not_exists` is not ported yet
 -- Guard against import creep
---assert_not_exists finset
+assert_not_exists Finset
feat: to_additive raises linter errors; nested to_additive (#1819)
  • Turn info messages of to_additive into linter errors
  • Allow @[to_additive (attr := to_additive)] to additivize the generated lemma. This is useful for Pow -> SMul -> VAdd lemmas. We can write e.g. @[to_additive (attr := to_additive, simp)] to add the simp attribute to all 3 generated lemmas, and we can provide other options to each to_additive call separately (specifying a name / reorder).
  • The previous point was needed to cleanly get rid of some linter warnings. It also required some additional changes (addToAdditiveAttr now returns a value, turn a few (meta) definitions into mutual partial def, reorder some definitions, generalize additivizeLemmas to lists of more than 2 elements) that should have no visible effects for the user.
Diff
@@ -46,18 +46,11 @@ theorem coe_center : ↑(center M) = Set.center M :=
 #align submonoid.coe_center Submonoid.coe_center
 #align add_submonoid.coe_center AddSubmonoid.coe_center
 
-@[simp]
+@[to_additive (attr := simp) AddSubmonoid.center_toAddSubsemigroup]
 theorem center_toSubsemigroup : (center M).toSubsemigroup = Subsemigroup.center M :=
   rfl
 #align submonoid.center_to_subsemigroup Submonoid.center_toSubsemigroup
 
-theorem _root_.AddSubmonoid.center_toAddSubsemigroup (M) [AddMonoid M] :
-    (AddSubmonoid.center M).toAddSubsemigroup = AddSubsemigroup.center M :=
-  rfl
-#align add_submonoid.center_to_add_subsemigroup AddSubmonoid.center_toAddSubsemigroup
-
-attribute [to_additive AddSubmonoid.center_toAddSubsemigroup] Submonoid.center_toSubsemigroup
-
 variable {M}
 
 @[to_additive]
@@ -90,7 +83,6 @@ instance center.smulCommClass_right : SMulCommClass M (center M) M :=
 /-! Note that `smulCommClass (center M) (center M) M` is already implied by
 `Submonoid.smulCommClass_right` -/
 
-
 example : SMulCommClass (center M) (center M) M := by infer_instance
 
 end
feat: port RingTheory.Subsemiring.Basic (#1862)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Vierkantor <vierkantor@vierkantor.com>

Diff
@@ -73,7 +73,7 @@ instance decidableMemCenter (a) [Decidable <| ∀ b : M, b * a = a * b] : Decida
 #align add_submonoid.decidable_mem_center AddSubmonoid.decidableMemCenter
 
 /-- The center of a monoid is commutative. -/
-instance : CommMonoid (center M) :=
+instance center.commMonoid : CommMonoid (center M) :=
   { (center M).toMonoid with
     mul_comm := fun _ b => Subtype.ext <| b.prop _ }
 
chore: add #align statements for to_additive decls (#1816)

Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com>

Diff
@@ -56,7 +56,7 @@ theorem _root_.AddSubmonoid.center_toAddSubsemigroup (M) [AddMonoid M] :
   rfl
 #align add_submonoid.center_to_add_subsemigroup AddSubmonoid.center_toAddSubsemigroup
 
-attribute [to_additive AddSubmonoid.center_to_add_subsemigroup] Submonoid.center_toSubsemigroup
+attribute [to_additive AddSubmonoid.center_toAddSubsemigroup] Submonoid.center_toSubsemigroup
 
 variable {M}
 
feat: port GroupTheory.Submonoid.Center (#1315)

Also includes fixes in other files as well (Set.Center to Set.center and a few more like that).

Dependencies 2 + 94

95 files ported (97.9%)
48776 lines ported (99.7%)
Show graph

The unported dependencies are