algebra.group.inj_surjMathlib.Algebra.Group.InjSurj

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)

(last sync)

(no changes)

feat(algebra/group/inj_surj): Missing transfer instances (#18247)

Transfer add_comm_monoid_with_one/add_comm_group_with_one along injective/surjective functions. Also add a missing reducible tag.

Diff
@@ -179,6 +179,17 @@ protected def comm_monoid [comm_monoid M₂] (f : M₁ → M₂) (hf : injective
   comm_monoid M₁ :=
 { .. hf.comm_semigroup f mul, .. hf.monoid f one mul npow }
 
+/-- A type endowed with `0`, `1` and `+` is an additive commutative monoid with one, if it admits an
+injective map that preserves `0`, `1` and `+` to an additive commutative monoid with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def add_comm_monoid_with_one {M₁} [has_zero M₁] [has_one M₁] [has_add M₁] [has_smul ℕ M₁]
+  [has_nat_cast M₁] [add_comm_monoid_with_one M₂] (f : M₁ → M₂) (hf : injective f) (zero : f 0 = 0)
+  (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ x (n : ℕ), f (n • x) = n • f x)
+  (nat_cast : ∀ n : ℕ, f n = n) :
+  add_comm_monoid_with_one M₁ :=
+{ ..hf.add_monoid_with_one f zero one add nsmul nat_cast, ..hf.add_comm_monoid f zero add nsmul }
+
 /-- A type endowed with `1` and `*` is a cancel commutative monoid,
 if it admits an injective map that preserves `1` and `*` to a cancel commutative monoid.
 See note [reducible non-instances]. -/
@@ -303,6 +314,21 @@ protected def comm_group [comm_group M₂] (f : M₁ → M₂) (hf : injective f
   comm_group M₁ :=
 { .. hf.comm_monoid f one mul npow, .. hf.group f one mul inv div npow zpow }
 
+/-- A type endowed with `0`, `1` and `+` is an additive commutative group with one, if it admits an
+injective map that preserves `0`, `1` and `+` to an additive commutative group with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def add_comm_group_with_one {M₁} [has_zero M₁] [has_one M₁] [has_add M₁] [has_smul ℕ M₁]
+  [has_neg M₁] [has_sub M₁] [has_smul ℤ M₁] [has_nat_cast M₁] [has_int_cast M₁]
+  [add_comm_group_with_one M₂] (f : M₁ → M₂) (hf : injective f)
+  (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y)
+  (neg : ∀ x, f (- x) = - f x) (sub : ∀ x y, f (x - y) = f x - f y)
+  (nsmul : ∀ x (n : ℕ), f (n • x) = n • f x) (zsmul : ∀ x (n : ℤ), f (n • x) = n • f x)
+  (nat_cast : ∀ n : ℕ, f n = n) (int_cast : ∀ n : ℤ, f n = n) :
+  add_comm_group_with_one M₁ :=
+{ ..hf.add_group_with_one f zero one add neg sub nsmul zsmul nat_cast int_cast,
+  ..hf.add_comm_monoid f zero add nsmul }
+
 end injective
 
 /-!
@@ -395,6 +421,19 @@ protected def comm_monoid [comm_monoid M₁] (f : M₁ → M₂) (hf : surjectiv
   comm_monoid M₂ :=
 { .. hf.comm_semigroup f mul, .. hf.monoid f one mul npow }
 
+/-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
+if it admits a surjective map that preserves `0`, `1` and `*` from an additive monoid with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def add_comm_monoid_with_one
+  {M₂} [has_zero M₂] [has_one M₂] [has_add M₂] [has_smul ℕ M₂] [has_nat_cast M₂]
+  [add_comm_monoid_with_one M₁] (f : M₁ → M₂) (hf : surjective f)
+  (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y)
+  (nsmul : ∀ x (n : ℕ), f (n • x) = n • f x)
+  (nat_cast : ∀ n : ℕ, f n = n) :
+  add_comm_monoid_with_one M₂ :=
+{ ..hf.add_monoid_with_one f zero one add nsmul nat_cast, ..hf.add_comm_monoid _ zero _ nsmul }
+
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. -/
 @[reducible, to_additive "A type has an involutive negation if it admits a surjective map that
@@ -446,6 +485,7 @@ protected def group [group M₁] (f : M₁ → M₂) (hf : surjective f)
 /-- A type endowed with `0`, `1`, `+` is an additive group with one,
 if it admits a surjective map that preserves `0`, `1`, and `+` to an additive group with one.
 See note [reducible non-instances]. -/
+@[reducible]
 protected def add_group_with_one
   {M₂} [has_zero M₂] [has_one M₂] [has_add M₂] [has_neg M₂] [has_sub M₂]
   [has_smul ℕ M₂] [has_smul ℤ M₂] [has_nat_cast M₂] [has_int_cast M₂]
@@ -475,6 +515,22 @@ protected def comm_group [comm_group M₁] (f : M₁ → M₂) (hf : surjective
   comm_group M₂ :=
 { .. hf.comm_monoid f one mul npow, .. hf.group f one mul inv div npow zpow }
 
+/-- A type endowed with `0`, `1`, `+` is an additive commutative group with one, if it admits a
+surjective map that preserves `0`, `1`, and `+` to an additive commutative group with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def add_comm_group_with_one
+  {M₂} [has_zero M₂] [has_one M₂] [has_add M₂] [has_neg M₂] [has_sub M₂]
+  [has_smul ℕ M₂] [has_smul ℤ M₂] [has_nat_cast M₂] [has_int_cast M₂]
+  [add_comm_group_with_one M₁] (f : M₁ → M₂) (hf : surjective f)
+  (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y)
+  (neg : ∀ x, f (- x) = - f x) (sub : ∀ x y, f (x - y) = f x - f y)
+  (nsmul : ∀ x (n : ℕ), f (n • x) = n • f x) (zsmul : ∀ x (n : ℤ), f (n • x) = n • f x)
+  (nat_cast : ∀ n : ℕ, f n = n) (int_cast : ∀ n : ℤ, f n = n) :
+  add_comm_group_with_one M₂ :=
+{ ..hf.add_group_with_one f zero one add neg sub nsmul zsmul nat_cast int_cast,
+  ..hf.add_comm_monoid _ zero add nsmul }
+
 end surjective
 
 end function

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -357,9 +357,9 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
     hf.AddMonoidWithOne f zero one add nsmul
       nat_cast with
     intCast := coe
-    intCast_ofNat := fun n => hf (by simp only [nat_cast, int_cast, Int.cast_ofNat])
+    intCast_ofNat := fun n => hf (by simp only [nat_cast, int_cast, Int.cast_natCast])
     intCast_negSucc := fun n =>
-      hf (by erw [int_cast, neg, nat_cast, Int.cast_neg, Int.cast_ofNat]) }
+      hf (by erw [int_cast, neg, nat_cast, Int.cast_neg, Int.cast_natCast]) }
 #align function.injective.add_group_with_one Function.Injective.addGroupWithOne
 -/
 
@@ -592,8 +592,8 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
     hf.AddGroup f zero add neg sub nsmul
       zsmul with
     intCast := coe
-    intCast_ofNat := fun n => by rw [← int_cast, Int.cast_ofNat, nat_cast]
-    intCast_negSucc := fun n => by rw [← int_cast, Int.cast_neg, Int.cast_ofNat, neg, nat_cast];
+    intCast_ofNat := fun n => by rw [← int_cast, Int.cast_natCast, nat_cast]
+    intCast_negSucc := fun n => by rw [← int_cast, Int.cast_neg, Int.cast_natCast, neg, nat_cast];
       rfl }
 #align function.surjective.add_group_with_one Function.Surjective.addGroupWithOne
 -/
Diff
@@ -137,7 +137,7 @@ protected def monoid [Monoid M₂] (f : M₁ → M₂) (hf : Injective f) (one :
     hf.MulOneClass f one mul with
     npow := fun n x => x ^ n
     npow_zero := fun x => hf <| by erw [npow, one, pow_zero]
-    npow_succ := fun n x => hf <| by erw [npow, pow_succ, mul, npow] }
+    npow_succ := fun n x => hf <| by erw [npow, pow_succ', mul, npow] }
 #align function.injective.monoid Function.Injective.monoid
 #align function.injective.add_monoid Function.Injective.addMonoid
 -/
@@ -280,8 +280,8 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
     ‹Div M₁› with
     zpow := fun n x => x ^ n
     zpow_zero' := fun x => hf <| by erw [zpow, zpow_zero, one]
-    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_coe_nat, pow_succ, zpow, zpow_coe_nat]
-    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_coe_nat]
+    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_natCast, pow_succ', zpow, zpow_natCast]
+    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_natCast]
     div_eq_hMul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
@@ -468,7 +468,7 @@ protected def monoid [Monoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one
     hf.MulOneClass f one mul with
     npow := fun n x => x ^ n
     npow_zero := hf.forall.2 fun x => by erw [← npow, pow_zero, ← one]
-    npow_succ := fun n => hf.forall.2 fun x => by erw [← npow, pow_succ, ← npow, ← mul] }
+    npow_succ := fun n => hf.forall.2 fun x => by erw [← npow, pow_succ', ← npow, ← mul] }
 #align function.surjective.monoid Function.Surjective.monoid
 #align function.surjective.add_monoid Function.Surjective.addMonoid
 -/
@@ -552,9 +552,9 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
     zpow := fun n x => x ^ n
     zpow_zero' := hf.forall.2 fun x => by erw [← zpow, zpow_zero, ← one]
     zpow_succ' := fun n =>
-      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_coe_nat, zpow_coe_nat, pow_succ, ← mul]
+      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_natCast, zpow_natCast, pow_succ', ← mul]
     zpow_neg' := fun n =>
-      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_negSucc, zpow_coe_nat, inv]
+      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_negSucc, zpow_natCast, inv]
     div_eq_hMul_inv := hf.Forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
Diff
@@ -280,8 +280,8 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
     ‹Div M₁› with
     zpow := fun n x => x ^ n
     zpow_zero' := fun x => hf <| by erw [zpow, zpow_zero, one]
-    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_ofNat, pow_succ, zpow, zpow_ofNat]
-    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_ofNat]
+    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_coe_nat, pow_succ, zpow, zpow_coe_nat]
+    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_coe_nat]
     div_eq_hMul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
@@ -552,9 +552,9 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
     zpow := fun n x => x ^ n
     zpow_zero' := hf.forall.2 fun x => by erw [← zpow, zpow_zero, ← one]
     zpow_succ' := fun n =>
-      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_ofNat, zpow_ofNat, pow_succ, ← mul]
+      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_coe_nat, zpow_coe_nat, pow_succ, ← mul]
     zpow_neg' := fun n =>
-      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_negSucc, zpow_ofNat, inv]
+      hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_negSucc, zpow_coe_nat, inv]
     div_eq_hMul_inv := hf.Forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2020 Johan Commelin. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin
 -/
-import Mathbin.Algebra.Group.Defs
-import Mathbin.Logic.Function.Basic
-import Mathbin.Data.Int.Cast.Basic
+import Algebra.Group.Defs
+import Logic.Function.Basic
+import Data.Int.Cast.Basic
 
 #align_import algebra.group.inj_surj from "leanprover-community/mathlib"@"d23418e009d2bc37f9e1047ecaa229790b7356be"
 
Diff
@@ -80,7 +80,7 @@ protected def leftCancelSemigroup [LeftCancelSemigroup M₂] (f : M₁ → M₂)
     (mul : ∀ x y, f (x * y) = f x * f y) : LeftCancelSemigroup M₁ :=
   { hf.Semigroup f mul with
     mul := (· * ·)
-    mul_left_cancel := fun x y z H =>
+    hMul_left_cancel := fun x y z H =>
       hf <| (mul_right_inj (f x)).1 <| by erw [← mul, ← mul, H] <;> rfl }
 #align function.injective.left_cancel_semigroup Function.Injective.leftCancelSemigroup
 #align function.injective.add_left_cancel_semigroup Function.Injective.addLeftCancelSemigroup
@@ -97,7 +97,7 @@ protected def rightCancelSemigroup [RightCancelSemigroup M₂] (f : M₁ → M
     (mul : ∀ x y, f (x * y) = f x * f y) : RightCancelSemigroup M₁ :=
   { hf.Semigroup f mul with
     mul := (· * ·)
-    mul_right_cancel := fun x y z H =>
+    hMul_right_cancel := fun x y z H =>
       hf <| (mul_left_inj (f y)).1 <| by erw [← mul, ← mul, H] <;> rfl }
 #align function.injective.right_cancel_semigroup Function.Injective.rightCancelSemigroup
 #align function.injective.add_right_cancel_semigroup Function.Injective.addRightCancelSemigroup
@@ -282,7 +282,7 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
     zpow_zero' := fun x => hf <| by erw [zpow, zpow_zero, one]
     zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_ofNat, pow_succ, zpow, zpow_ofNat]
     zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_ofNat]
-    div_eq_mul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
+    div_eq_hMul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
 -/
@@ -302,7 +302,7 @@ protected def divisionMonoid [DivisionMonoid M₂] (f : M₁ → M₂) (hf : Inj
     hf.InvolutiveInv f
       inv with
     mul_inv_rev := fun x y => hf <| by erw [inv, mul, mul_inv_rev, mul, inv, inv]
-    inv_eq_of_mul := fun x y h =>
+    inv_eq_of_hMul := fun x y h =>
       hf <| by erw [inv, inv_eq_of_mul_eq_one_right (by erw [← mul, h, one])] }
 #align function.injective.division_monoid Function.Injective.divisionMonoid
 #align function.injective.subtraction_monoid Function.Injective.subtractionMonoid
@@ -337,7 +337,7 @@ protected def group [Group M₂] (f : M₁ → M₂) (hf : Injective f) (one : f
     (div : ∀ x y, f (x / y) = f x / f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
     (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n) : Group M₁ :=
   { hf.DivInvMonoid f one mul inv div npow zpow with
-    mul_left_inv := fun x => hf <| by erw [mul, inv, mul_left_inv, one] }
+    hMul_left_inv := fun x => hf <| by erw [mul, inv, mul_left_inv, one] }
 #align function.injective.group Function.Injective.group
 #align function.injective.add_group Function.Injective.addGroup
 -/
@@ -555,7 +555,7 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
       hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_ofNat, zpow_ofNat, pow_succ, ← mul]
     zpow_neg' := fun n =>
       hf.forall.2 fun x => by erw [← zpow, ← zpow, zpow_negSucc, zpow_ofNat, inv]
-    div_eq_mul_inv := hf.Forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
+    div_eq_hMul_inv := hf.Forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
 -/
@@ -572,7 +572,7 @@ protected def group [Group M₁] (f : M₁ → M₂) (hf : Surjective f) (one :
     (div : ∀ x y, f (x / y) = f x / f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
     (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n) : Group M₂ :=
   { hf.DivInvMonoid f one mul inv div npow zpow with
-    mul_left_inv := hf.forall.2 fun x => by erw [← inv, ← mul, mul_left_inv, one] <;> rfl }
+    hMul_left_inv := hf.forall.2 fun x => by erw [← inv, ← mul, mul_left_inv, one] <;> rfl }
 #align function.surjective.group Function.Surjective.group
 #align function.surjective.add_group Function.Surjective.addGroup
 -/
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Johan Commelin. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin
-
-! This file was ported from Lean 3 source module algebra.group.inj_surj
-! leanprover-community/mathlib commit d23418e009d2bc37f9e1047ecaa229790b7356be
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Group.Defs
 import Mathbin.Logic.Function.Basic
 import Mathbin.Data.Int.Cast.Basic
 
+#align_import algebra.group.inj_surj from "leanprover-community/mathlib"@"d23418e009d2bc37f9e1047ecaa229790b7356be"
+
 /-!
 # Lifting algebraic data classes along injective/surjective maps
 
Diff
@@ -44,6 +44,7 @@ namespace Injective
 
 variable {M₁ : Type _} {M₂ : Type _} [Mul M₁]
 
+#print Function.Injective.semigroup /-
 /-- A type endowed with `*` is a semigroup,
 if it admits an injective map that preserves `*` to a semigroup.
 See note [reducible non-instances]. -/
@@ -55,7 +56,9 @@ protected def semigroup [Semigroup M₂] (f : M₁ → M₂) (hf : Injective f)
   { ‹Mul M₁› with mul_assoc := fun x y z => hf <| by erw [mul, mul, mul, mul, mul_assoc] }
 #align function.injective.semigroup Function.Injective.semigroup
 #align function.injective.add_semigroup Function.Injective.addSemigroup
+-/
 
+#print Function.Injective.commSemigroup /-
 /-- A type endowed with `*` is a commutative semigroup,
 if it admits an injective map that preserves `*` to a commutative semigroup.
 See note [reducible non-instances]. -/
@@ -67,7 +70,9 @@ protected def commSemigroup [CommSemigroup M₂] (f : M₁ → M₂) (hf : Injec
   { hf.Semigroup f mul with mul_comm := fun x y => hf <| by erw [mul, mul, mul_comm] }
 #align function.injective.comm_semigroup Function.Injective.commSemigroup
 #align function.injective.add_comm_semigroup Function.Injective.addCommSemigroup
+-/
 
+#print Function.Injective.leftCancelSemigroup /-
 /-- A type endowed with `*` is a left cancel semigroup,
 if it admits an injective map that preserves `*` to a left cancel semigroup.
 See note [reducible non-instances]. -/
@@ -82,7 +87,9 @@ protected def leftCancelSemigroup [LeftCancelSemigroup M₂] (f : M₁ → M₂)
       hf <| (mul_right_inj (f x)).1 <| by erw [← mul, ← mul, H] <;> rfl }
 #align function.injective.left_cancel_semigroup Function.Injective.leftCancelSemigroup
 #align function.injective.add_left_cancel_semigroup Function.Injective.addLeftCancelSemigroup
+-/
 
+#print Function.Injective.rightCancelSemigroup /-
 /-- A type endowed with `*` is a right cancel semigroup,
 if it admits an injective map that preserves `*` to a right cancel semigroup.
 See note [reducible non-instances]. -/
@@ -97,9 +104,11 @@ protected def rightCancelSemigroup [RightCancelSemigroup M₂] (f : M₁ → M
       hf <| (mul_left_inj (f y)).1 <| by erw [← mul, ← mul, H] <;> rfl }
 #align function.injective.right_cancel_semigroup Function.Injective.rightCancelSemigroup
 #align function.injective.add_right_cancel_semigroup Function.Injective.addRightCancelSemigroup
+-/
 
 variable [One M₁]
 
+#print Function.Injective.mulOneClass /-
 /-- A type endowed with `1` and `*` is a mul_one_class,
 if it admits an injective map that preserves `1` and `*` to a mul_one_class.
 See note [reducible non-instances]. -/
@@ -114,9 +123,11 @@ protected def mulOneClass [MulOneClass M₂] (f : M₁ → M₂) (hf : Injective
     mul_one := fun x => hf <| by erw [mul, one, mul_one] }
 #align function.injective.mul_one_class Function.Injective.mulOneClass
 #align function.injective.add_zero_class Function.Injective.addZeroClass
+-/
 
 variable [Pow M₁ ℕ]
 
+#print Function.Injective.monoid /-
 /-- A type endowed with `1` and `*` is a monoid,
 if it admits an injective map that preserves `1` and `*` to a monoid.
 See note [reducible non-instances]. -/
@@ -132,7 +143,9 @@ protected def monoid [Monoid M₂] (f : M₁ → M₂) (hf : Injective f) (one :
     npow_succ := fun n x => hf <| by erw [npow, pow_succ, mul, npow] }
 #align function.injective.monoid Function.Injective.monoid
 #align function.injective.add_monoid Function.Injective.addMonoid
+-/
 
+#print Function.Injective.addMonoidWithOne /-
 /-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
 if it admits an injective map that preserves `0`, `1` and `+` to an additive monoid with one.
 See note [reducible non-instances]. -/
@@ -147,7 +160,9 @@ protected def addMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul 
     natCast_succ := fun n => hf (by erw [nat_cast, Nat.cast_succ, add, one, nat_cast])
     one := 1 }
 #align function.injective.add_monoid_with_one Function.Injective.addMonoidWithOne
+-/
 
+#print Function.Injective.leftCancelMonoid /-
 /-- A type endowed with `1` and `*` is a left cancel monoid,
 if it admits an injective map that preserves `1` and `*` to a left cancel monoid.
 See note [reducible non-instances]. -/
@@ -160,7 +175,9 @@ protected def leftCancelMonoid [LeftCancelMonoid M₂] (f : M₁ → M₂) (hf :
   { hf.LeftCancelSemigroup f mul, hf.Monoid f one mul npow with }
 #align function.injective.left_cancel_monoid Function.Injective.leftCancelMonoid
 #align function.injective.add_left_cancel_monoid Function.Injective.addLeftCancelMonoid
+-/
 
+#print Function.Injective.rightCancelMonoid /-
 /-- A type endowed with `1` and `*` is a right cancel monoid,
 if it admits an injective map that preserves `1` and `*` to a right cancel monoid.
 See note [reducible non-instances]. -/
@@ -173,7 +190,9 @@ protected def rightCancelMonoid [RightCancelMonoid M₂] (f : M₁ → M₂) (hf
   { hf.RightCancelSemigroup f mul, hf.Monoid f one mul npow with }
 #align function.injective.right_cancel_monoid Function.Injective.rightCancelMonoid
 #align function.injective.add_right_cancel_monoid Function.Injective.addRightCancelMonoid
+-/
 
+#print Function.Injective.cancelMonoid /-
 /-- A type endowed with `1` and `*` is a cancel monoid,
 if it admits an injective map that preserves `1` and `*` to a cancel monoid.
 See note [reducible non-instances]. -/
@@ -186,7 +205,9 @@ protected def cancelMonoid [CancelMonoid M₂] (f : M₁ → M₂) (hf : Injecti
   { hf.LeftCancelMonoid f one mul npow, hf.RightCancelMonoid f one mul npow with }
 #align function.injective.cancel_monoid Function.Injective.cancelMonoid
 #align function.injective.add_cancel_monoid Function.Injective.addCancelMonoid
+-/
 
+#print Function.Injective.commMonoid /-
 /-- A type endowed with `1` and `*` is a commutative monoid,
 if it admits an injective map that preserves `1` and `*` to a commutative monoid.
 See note [reducible non-instances]. -/
@@ -199,7 +220,9 @@ protected def commMonoid [CommMonoid M₂] (f : M₁ → M₂) (hf : Injective f
   { hf.CommSemigroup f mul, hf.Monoid f one mul npow with }
 #align function.injective.comm_monoid Function.Injective.commMonoid
 #align function.injective.add_comm_monoid Function.Injective.addCommMonoid
+-/
 
+#print Function.Injective.addCommMonoidWithOne /-
 /-- A type endowed with `0`, `1` and `+` is an additive commutative monoid with one, if it admits an
 injective map that preserves `0`, `1` and `+` to an additive commutative monoid with one.
 See note [reducible non-instances]. -/
@@ -210,7 +233,9 @@ protected def addCommMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMu
     (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₁ :=
   { hf.AddMonoidWithOne f zero one add nsmul nat_cast, hf.AddCommMonoid f zero add nsmul with }
 #align function.injective.add_comm_monoid_with_one Function.Injective.addCommMonoidWithOne
+-/
 
+#print Function.Injective.cancelCommMonoid /-
 /-- A type endowed with `1` and `*` is a cancel commutative monoid,
 if it admits an injective map that preserves `1` and `*` to a cancel commutative monoid.
 See note [reducible non-instances]. -/
@@ -223,7 +248,9 @@ protected def cancelCommMonoid [CancelCommMonoid M₂] (f : M₁ → M₂) (hf :
   { hf.LeftCancelSemigroup f mul, hf.CommMonoid f one mul npow with }
 #align function.injective.cancel_comm_monoid Function.Injective.cancelCommMonoid
 #align function.injective.add_cancel_comm_monoid Function.Injective.addCancelCommMonoid
+-/
 
+#print Function.Injective.involutiveInv /-
 --See note [reducible non-instances]
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. -/
@@ -237,9 +264,11 @@ protected def involutiveInv {M₁ : Type _} [Inv M₁] [InvolutiveInv M₂] (f :
   inv_inv x := hf <| by rw [inv, inv, inv_inv]
 #align function.injective.has_involutive_inv Function.Injective.involutiveInv
 #align function.injective.has_involutive_neg Function.Injective.involutiveNeg
+-/
 
 variable [Inv M₁] [Div M₁] [Pow M₁ ℤ]
 
+#print Function.Injective.divInvMonoid /-
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `div_inv_monoid`
 if it admits an injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `div_inv_monoid`.
 See note [reducible non-instances]. -/
@@ -259,7 +288,9 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
     div_eq_mul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
+-/
 
+#print Function.Injective.divisionMonoid /-
 -- See note [reducible non-instances]
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `division_monoid`
 if it admits an injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `division_monoid`. -/
@@ -278,7 +309,9 @@ protected def divisionMonoid [DivisionMonoid M₂] (f : M₁ → M₂) (hf : Inj
       hf <| by erw [inv, inv_eq_of_mul_eq_one_right (by erw [← mul, h, one])] }
 #align function.injective.division_monoid Function.Injective.divisionMonoid
 #align function.injective.subtraction_monoid Function.Injective.subtractionMonoid
+-/
 
+#print Function.Injective.divisionCommMonoid /-
 -- See note [reducible non-instances]
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `division_comm_monoid`
 if it admits an injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `division_comm_monoid`.
@@ -293,7 +326,9 @@ protected def divisionCommMonoid [DivisionCommMonoid M₂] (f : M₁ → M₂) (
   { hf.DivisionMonoid f one mul inv div npow zpow, hf.CommSemigroup f mul with }
 #align function.injective.division_comm_monoid Function.Injective.divisionCommMonoid
 #align function.injective.subtraction_comm_monoid Function.Injective.subtractionCommMonoid
+-/
 
+#print Function.Injective.group /-
 /-- A type endowed with `1`, `*` and `⁻¹` is a group,
 if it admits an injective map that preserves `1`, `*` and `⁻¹` to a group.
 See note [reducible non-instances]. -/
@@ -308,7 +343,9 @@ protected def group [Group M₂] (f : M₁ → M₂) (hf : Injective f) (one : f
     mul_left_inv := fun x => hf <| by erw [mul, inv, mul_left_inv, one] }
 #align function.injective.group Function.Injective.group
 #align function.injective.add_group Function.Injective.addGroup
+-/
 
+#print Function.Injective.addGroupWithOne /-
 /-- A type endowed with `0`, `1` and `+` is an additive group with one,
 if it admits an injective map that preserves `0`, `1` and `+` to an additive group with one.
 See note [reducible non-instances]. -/
@@ -327,7 +364,9 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
     intCast_negSucc := fun n =>
       hf (by erw [int_cast, neg, nat_cast, Int.cast_neg, Int.cast_ofNat]) }
 #align function.injective.add_group_with_one Function.Injective.addGroupWithOne
+-/
 
+#print Function.Injective.commGroup /-
 /-- A type endowed with `1`, `*` and `⁻¹` is a commutative group,
 if it admits an injective map that preserves `1`, `*` and `⁻¹` to a commutative group.
 See note [reducible non-instances]. -/
@@ -341,7 +380,9 @@ protected def commGroup [CommGroup M₂] (f : M₁ → M₂) (hf : Injective f)
   { hf.CommMonoid f one mul npow, hf.Group f one mul inv div npow zpow with }
 #align function.injective.comm_group Function.Injective.commGroup
 #align function.injective.add_comm_group Function.Injective.addCommGroup
+-/
 
+#print Function.Injective.addCommGroupWithOne /-
 /-- A type endowed with `0`, `1` and `+` is an additive commutative group with one, if it admits an
 injective map that preserves `0`, `1` and `+` to an additive commutative group with one.
 See note [reducible non-instances]. -/
@@ -355,6 +396,7 @@ protected def addCommGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul
   { hf.AddGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
     hf.AddCommMonoid f zero add nsmul with }
 #align function.injective.add_comm_group_with_one Function.Injective.addCommGroupWithOne
+-/
 
 end Injective
 
@@ -367,6 +409,7 @@ namespace Surjective
 
 variable {M₁ : Type _} {M₂ : Type _} [Mul M₂]
 
+#print Function.Surjective.semigroup /-
 /-- A type endowed with `*` is a semigroup,
 if it admits a surjective map that preserves `*` from a semigroup.
 See note [reducible non-instances]. -/
@@ -378,7 +421,9 @@ protected def semigroup [Semigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
   { ‹Mul M₂› with mul_assoc := hf.forall₃.2 fun x y z => by simp only [← mul, mul_assoc] }
 #align function.surjective.semigroup Function.Surjective.semigroup
 #align function.surjective.add_semigroup Function.Surjective.addSemigroup
+-/
 
+#print Function.Surjective.commSemigroup /-
 /-- A type endowed with `*` is a commutative semigroup,
 if it admits a surjective map that preserves `*` from a commutative semigroup.
 See note [reducible non-instances]. -/
@@ -390,9 +435,11 @@ protected def commSemigroup [CommSemigroup M₁] (f : M₁ → M₂) (hf : Surje
   { hf.Semigroup f mul with mul_comm := hf.Forall₂.2 fun x y => by erw [← mul, ← mul, mul_comm] }
 #align function.surjective.comm_semigroup Function.Surjective.commSemigroup
 #align function.surjective.add_comm_semigroup Function.Surjective.addCommSemigroup
+-/
 
 variable [One M₂]
 
+#print Function.Surjective.mulOneClass /-
 /-- A type endowed with `1` and `*` is a mul_one_class,
 if it admits a surjective map that preserves `1` and `*` from a mul_one_class.
 See note [reducible non-instances]. -/
@@ -407,9 +454,11 @@ protected def mulOneClass [MulOneClass M₁] (f : M₁ → M₂) (hf : Surjectiv
     mul_one := hf.forall.2 fun x => by erw [← one, ← mul, mul_one] }
 #align function.surjective.mul_one_class Function.Surjective.mulOneClass
 #align function.surjective.add_zero_class Function.Surjective.addZeroClass
+-/
 
 variable [Pow M₂ ℕ]
 
+#print Function.Surjective.monoid /-
 /-- A type endowed with `1` and `*` is a monoid,
 if it admits a surjective map that preserves `1` and `*` to a monoid.
 See note [reducible non-instances]. -/
@@ -425,7 +474,9 @@ protected def monoid [Monoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one
     npow_succ := fun n => hf.forall.2 fun x => by erw [← npow, pow_succ, ← npow, ← mul] }
 #align function.surjective.monoid Function.Surjective.monoid
 #align function.surjective.add_monoid Function.Surjective.addMonoid
+-/
 
+#print Function.Surjective.addMonoidWithOne /-
 /-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
 if it admits a surjective map that preserves `0`, `1` and `*` from an additive monoid with one.
 See note [reducible non-instances]. -/
@@ -440,7 +491,9 @@ protected def addMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul 
     natCast_succ := fun n => by rw [← nat_cast, Nat.cast_succ, add, one, nat_cast]; rfl
     one := 1 }
 #align function.surjective.add_monoid_with_one Function.Surjective.addMonoidWithOne
+-/
 
+#print Function.Surjective.commMonoid /-
 /-- A type endowed with `1` and `*` is a commutative monoid,
 if it admits a surjective map that preserves `1` and `*` from a commutative monoid.
 See note [reducible non-instances]. -/
@@ -453,7 +506,9 @@ protected def commMonoid [CommMonoid M₁] (f : M₁ → M₂) (hf : Surjective
   { hf.CommSemigroup f mul, hf.Monoid f one mul npow with }
 #align function.surjective.comm_monoid Function.Surjective.commMonoid
 #align function.surjective.add_comm_monoid Function.Surjective.addCommMonoid
+-/
 
+#print Function.Surjective.addCommMonoidWithOne /-
 /-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
 if it admits a surjective map that preserves `0`, `1` and `*` from an additive monoid with one.
 See note [reducible non-instances]. -/
@@ -464,7 +519,9 @@ protected def addCommMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMu
     (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₂ :=
   { hf.AddMonoidWithOne f zero one add nsmul nat_cast, hf.AddCommMonoid _ zero _ nsmul with }
 #align function.surjective.add_comm_monoid_with_one Function.Surjective.addCommMonoidWithOne
+-/
 
+#print Function.Surjective.involutiveInv /-
 --See note [reducible non-instances]
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. -/
@@ -478,9 +535,11 @@ protected def involutiveInv {M₂ : Type _} [Inv M₂] [InvolutiveInv M₁] (f :
   inv_inv := hf.forall.2 fun x => by erw [← inv, ← inv, inv_inv]
 #align function.surjective.has_involutive_inv Function.Surjective.involutiveInv
 #align function.surjective.has_involutive_neg Function.Surjective.involutiveNeg
+-/
 
 variable [Inv M₂] [Div M₂] [Pow M₂ ℤ]
 
+#print Function.Surjective.divInvMonoid /-
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `div_inv_monoid`
 if it admits a surjective map that preserves `1`, `*`, `⁻¹`, and `/` to a `div_inv_monoid`.
 See note [reducible non-instances]. -/
@@ -502,7 +561,9 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
     div_eq_mul_inv := hf.Forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
+-/
 
+#print Function.Surjective.group /-
 /-- A type endowed with `1`, `*` and `⁻¹` is a group,
 if it admits a surjective map that preserves `1`, `*` and `⁻¹` to a group.
 See note [reducible non-instances]. -/
@@ -517,7 +578,9 @@ protected def group [Group M₁] (f : M₁ → M₂) (hf : Surjective f) (one :
     mul_left_inv := hf.forall.2 fun x => by erw [← inv, ← mul, mul_left_inv, one] <;> rfl }
 #align function.surjective.group Function.Surjective.group
 #align function.surjective.add_group Function.Surjective.addGroup
+-/
 
+#print Function.Surjective.addGroupWithOne /-
 /-- A type endowed with `0`, `1`, `+` is an additive group with one,
 if it admits a surjective map that preserves `0`, `1`, and `+` to an additive group with one.
 See note [reducible non-instances]. -/
@@ -536,7 +599,9 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
     intCast_negSucc := fun n => by rw [← int_cast, Int.cast_neg, Int.cast_ofNat, neg, nat_cast];
       rfl }
 #align function.surjective.add_group_with_one Function.Surjective.addGroupWithOne
+-/
 
+#print Function.Surjective.commGroup /-
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a commutative group,
 if it admits a surjective map that preserves `1`, `*`, `⁻¹`, and `/` from a commutative group.
 See note [reducible non-instances]. -/
@@ -550,7 +615,9 @@ protected def commGroup [CommGroup M₁] (f : M₁ → M₂) (hf : Surjective f)
   { hf.CommMonoid f one mul npow, hf.Group f one mul inv div npow zpow with }
 #align function.surjective.comm_group Function.Surjective.commGroup
 #align function.surjective.add_comm_group Function.Surjective.addCommGroup
+-/
 
+#print Function.Surjective.addCommGroupWithOne /-
 /-- A type endowed with `0`, `1`, `+` is an additive commutative group with one, if it admits a
 surjective map that preserves `0`, `1`, and `+` to an additive commutative group with one.
 See note [reducible non-instances]. -/
@@ -564,6 +631,7 @@ protected def addCommGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg
   { hf.AddGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
     hf.AddCommMonoid _ zero add nsmul with }
 #align function.surjective.add_comm_group_with_one Function.Surjective.addCommGroupWithOne
+-/
 
 end Surjective
 
Diff
@@ -44,12 +44,6 @@ namespace Injective
 
 variable {M₁ : Type _} {M₂ : Type _} [Mul M₁]
 
-/- warning: function.injective.semigroup -> Function.Injective.semigroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : Semigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toHasMul.{u2} M₂ _inst_2)) (f x) (f y))) -> (Semigroup.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : Semigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toMul.{u2} M₂ _inst_2)) (f x) (f y))) -> (Semigroup.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.semigroup Function.Injective.semigroupₓ'. -/
 /-- A type endowed with `*` is a semigroup,
 if it admits an injective map that preserves `*` to a semigroup.
 See note [reducible non-instances]. -/
@@ -62,12 +56,6 @@ protected def semigroup [Semigroup M₂] (f : M₁ → M₂) (hf : Injective f)
 #align function.injective.semigroup Function.Injective.semigroup
 #align function.injective.add_semigroup Function.Injective.addSemigroup
 
-/- warning: function.injective.comm_semigroup -> Function.Injective.commSemigroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : CommSemigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toHasMul.{u2} M₂ (CommSemigroup.toSemigroup.{u2} M₂ _inst_2))) (f x) (f y))) -> (CommSemigroup.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : CommSemigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toMul.{u2} M₂ (CommSemigroup.toSemigroup.{u2} M₂ _inst_2))) (f x) (f y))) -> (CommSemigroup.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.comm_semigroup Function.Injective.commSemigroupₓ'. -/
 /-- A type endowed with `*` is a commutative semigroup,
 if it admits an injective map that preserves `*` to a commutative semigroup.
 See note [reducible non-instances]. -/
@@ -80,12 +68,6 @@ protected def commSemigroup [CommSemigroup M₂] (f : M₁ → M₂) (hf : Injec
 #align function.injective.comm_semigroup Function.Injective.commSemigroup
 #align function.injective.add_comm_semigroup Function.Injective.addCommSemigroup
 
-/- warning: function.injective.left_cancel_semigroup -> Function.Injective.leftCancelSemigroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : LeftCancelSemigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toHasMul.{u2} M₂ (LeftCancelSemigroup.toSemigroup.{u2} M₂ _inst_2))) (f x) (f y))) -> (LeftCancelSemigroup.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : LeftCancelSemigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toMul.{u2} M₂ (LeftCancelSemigroup.toSemigroup.{u2} M₂ _inst_2))) (f x) (f y))) -> (LeftCancelSemigroup.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.left_cancel_semigroup Function.Injective.leftCancelSemigroupₓ'. -/
 /-- A type endowed with `*` is a left cancel semigroup,
 if it admits an injective map that preserves `*` to a left cancel semigroup.
 See note [reducible non-instances]. -/
@@ -101,12 +83,6 @@ protected def leftCancelSemigroup [LeftCancelSemigroup M₂] (f : M₁ → M₂)
 #align function.injective.left_cancel_semigroup Function.Injective.leftCancelSemigroup
 #align function.injective.add_left_cancel_semigroup Function.Injective.addLeftCancelSemigroup
 
-/- warning: function.injective.right_cancel_semigroup -> Function.Injective.rightCancelSemigroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : RightCancelSemigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toHasMul.{u2} M₂ (RightCancelSemigroup.toSemigroup.{u2} M₂ _inst_2))) (f x) (f y))) -> (RightCancelSemigroup.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : RightCancelSemigroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (Semigroup.toMul.{u2} M₂ (RightCancelSemigroup.toSemigroup.{u2} M₂ _inst_2))) (f x) (f y))) -> (RightCancelSemigroup.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.right_cancel_semigroup Function.Injective.rightCancelSemigroupₓ'. -/
 /-- A type endowed with `*` is a right cancel semigroup,
 if it admits an injective map that preserves `*` to a right cancel semigroup.
 See note [reducible non-instances]. -/
@@ -124,12 +100,6 @@ protected def rightCancelSemigroup [RightCancelSemigroup M₂] (f : M₁ → M
 
 variable [One M₁]
 
-/- warning: function.injective.mul_one_class -> Function.Injective.mulOneClass is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : MulOneClass.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ _inst_3))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ _inst_3)) (f x) (f y))) -> (MulOneClass.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : MulOneClass.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (MulOneClass.toOne.{u2} M₂ _inst_3)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ _inst_3)) (f x) (f y))) -> (MulOneClass.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.mul_one_class Function.Injective.mulOneClassₓ'. -/
 /-- A type endowed with `1` and `*` is a mul_one_class,
 if it admits an injective map that preserves `1` and `*` to a mul_one_class.
 See note [reducible non-instances]. -/
@@ -147,12 +117,6 @@ protected def mulOneClass [MulOneClass M₂] (f : M₁ → M₂) (hf : Injective
 
 variable [Pow M₁ ℕ]
 
-/- warning: function.injective.monoid -> Function.Injective.monoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Monoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ _inst_4)))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ _inst_4))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ _inst_4)) (f x) n)) -> (Monoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Monoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (Monoid.toOne.{u2} M₂ _inst_4)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ _inst_4))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ _inst_4)) (f x) n)) -> (Monoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.monoid Function.Injective.monoidₓ'. -/
 /-- A type endowed with `1` and `*` is a monoid,
 if it admits an injective map that preserves `1` and `*` to a monoid.
 See note [reducible non-instances]. -/
@@ -169,12 +133,6 @@ protected def monoid [Monoid M₂] (f : M₁ → M₂) (hf : Injective f) (one :
 #align function.injective.monoid Function.Injective.monoid
 #align function.injective.add_monoid Function.Injective.addMonoid
 
-/- warning: function.injective.add_monoid_with_one -> Function.Injective.addMonoidWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_4 : Zero.{u2} M₁] [_inst_5 : One.{u2} M₁] [_inst_6 : Add.{u2} M₁] [_inst_7 : SMul.{0, u2} Nat M₁] [_inst_8 : NatCast.{u2} M₁] [_inst_9 : AddMonoidWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (OfNat.mk.{u2} M₁ 0 (Zero.zero.{u2} M₁ _inst_4)))) (OfNat.ofNat.{u1} M₂ 0 (OfNat.mk.{u1} M₂ 0 (Zero.zero.{u1} M₂ (AddZeroClass.toHasZero.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ _inst_9))))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (OfNat.mk.{u2} M₁ 1 (One.one.{u2} M₁ _inst_5)))) (OfNat.ofNat.{u1} M₂ 1 (OfNat.mk.{u1} M₂ 1 (One.one.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ _inst_9))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_6) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toHasAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ _inst_9)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (SMul.smul.{0, u2} Nat M₁ _inst_7 n x)) (SMul.smul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ _inst_9)) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u2} Nat M₁ (CoeTCₓ.coe.{1, succ u2} Nat M₁ (Nat.castCoe.{u2} M₁ _inst_8))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u1} Nat M₂ (CoeTCₓ.coe.{1, succ u1} Nat M₂ (Nat.castCoe.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ _inst_9)))) n)) -> (AddMonoidWithOne.{u2} M₁)
-but is expected to have type
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_4 : Zero.{u2} M₁] [_inst_5 : One.{u2} M₁] [_inst_6 : Add.{u2} M₁] [_inst_7 : SMul.{0, u2} Nat M₁] [_inst_8 : NatCast.{u2} M₁] [_inst_9 : AddMonoidWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (Zero.toOfNat0.{u2} M₁ _inst_4))) (OfNat.ofNat.{u1} M₂ 0 (Zero.toOfNat0.{u1} M₂ (AddMonoid.toZero.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ _inst_9))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (One.toOfNat1.{u2} M₁ _inst_5))) (OfNat.ofNat.{u1} M₂ 1 (One.toOfNat1.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ _inst_9)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_6) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ _inst_9)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (HSMul.hSMul.{0, u2, u2} Nat M₁ M₁ (instHSMul.{0, u2} Nat M₁ _inst_7) n x)) (HSMul.hSMul.{0, u1, u1} Nat M₂ M₂ (instHSMul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ _inst_9))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f (Nat.cast.{u2} M₁ _inst_8 n)) (Nat.cast.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ _inst_9) n)) -> (AddMonoidWithOne.{u2} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.add_monoid_with_one Function.Injective.addMonoidWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
 if it admits an injective map that preserves `0`, `1` and `+` to an additive monoid with one.
 See note [reducible non-instances]. -/
@@ -190,12 +148,6 @@ protected def addMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul 
     one := 1 }
 #align function.injective.add_monoid_with_one Function.Injective.addMonoidWithOne
 
-/- warning: function.injective.left_cancel_monoid -> Function.Injective.leftCancelMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : LeftCancelMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (LeftCancelMonoid.toMonoid.{u2} M₂ _inst_4))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (LeftCancelMonoid.toMonoid.{u2} M₂ _inst_4)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (LeftCancelMonoid.toMonoid.{u2} M₂ _inst_4))) (f x) n)) -> (LeftCancelMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : LeftCancelMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (LeftCancelMonoid.toOne.{u2} M₂ _inst_4)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (LeftCancelMonoid.toMonoid.{u2} M₂ _inst_4)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (LeftCancelMonoid.toMonoid.{u2} M₂ _inst_4))) (f x) n)) -> (LeftCancelMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.left_cancel_monoid Function.Injective.leftCancelMonoidₓ'. -/
 /-- A type endowed with `1` and `*` is a left cancel monoid,
 if it admits an injective map that preserves `1` and `*` to a left cancel monoid.
 See note [reducible non-instances]. -/
@@ -209,12 +161,6 @@ protected def leftCancelMonoid [LeftCancelMonoid M₂] (f : M₁ → M₂) (hf :
 #align function.injective.left_cancel_monoid Function.Injective.leftCancelMonoid
 #align function.injective.add_left_cancel_monoid Function.Injective.addLeftCancelMonoid
 
-/- warning: function.injective.right_cancel_monoid -> Function.Injective.rightCancelMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : RightCancelMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ _inst_4))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ _inst_4)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ _inst_4))) (f x) n)) -> (RightCancelMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : RightCancelMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (RightCancelMonoid.toOne.{u2} M₂ _inst_4)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ _inst_4)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ _inst_4))) (f x) n)) -> (RightCancelMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.right_cancel_monoid Function.Injective.rightCancelMonoidₓ'. -/
 /-- A type endowed with `1` and `*` is a right cancel monoid,
 if it admits an injective map that preserves `1` and `*` to a right cancel monoid.
 See note [reducible non-instances]. -/
@@ -228,12 +174,6 @@ protected def rightCancelMonoid [RightCancelMonoid M₂] (f : M₁ → M₂) (hf
 #align function.injective.right_cancel_monoid Function.Injective.rightCancelMonoid
 #align function.injective.add_right_cancel_monoid Function.Injective.addRightCancelMonoid
 
-/- warning: function.injective.cancel_monoid -> Function.Injective.cancelMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : CancelMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ _inst_4)))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ _inst_4))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ _inst_4)))) (f x) n)) -> (CancelMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : CancelMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (RightCancelMonoid.toOne.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ _inst_4))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ _inst_4))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ _inst_4)))) (f x) n)) -> (CancelMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.cancel_monoid Function.Injective.cancelMonoidₓ'. -/
 /-- A type endowed with `1` and `*` is a cancel monoid,
 if it admits an injective map that preserves `1` and `*` to a cancel monoid.
 See note [reducible non-instances]. -/
@@ -247,12 +187,6 @@ protected def cancelMonoid [CancelMonoid M₂] (f : M₁ → M₂) (hf : Injecti
 #align function.injective.cancel_monoid Function.Injective.cancelMonoid
 #align function.injective.add_cancel_monoid Function.Injective.addCancelMonoid
 
-/- warning: function.injective.comm_monoid -> Function.Injective.commMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : CommMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (CommMonoid.toMonoid.{u2} M₂ _inst_4))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (CommMonoid.toMonoid.{u2} M₂ _inst_4)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (CommMonoid.toMonoid.{u2} M₂ _inst_4))) (f x) n)) -> (CommMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : CommMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (Monoid.toOne.{u2} M₂ (CommMonoid.toMonoid.{u2} M₂ _inst_4))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (CommMonoid.toMonoid.{u2} M₂ _inst_4)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (CommMonoid.toMonoid.{u2} M₂ _inst_4))) (f x) n)) -> (CommMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.comm_monoid Function.Injective.commMonoidₓ'. -/
 /-- A type endowed with `1` and `*` is a commutative monoid,
 if it admits an injective map that preserves `1` and `*` to a commutative monoid.
 See note [reducible non-instances]. -/
@@ -266,12 +200,6 @@ protected def commMonoid [CommMonoid M₂] (f : M₁ → M₂) (hf : Injective f
 #align function.injective.comm_monoid Function.Injective.commMonoid
 #align function.injective.add_comm_monoid Function.Injective.addCommMonoid
 
-/- warning: function.injective.add_comm_monoid_with_one -> Function.Injective.addCommMonoidWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_4 : Zero.{u2} M₁] [_inst_5 : One.{u2} M₁] [_inst_6 : Add.{u2} M₁] [_inst_7 : SMul.{0, u2} Nat M₁] [_inst_8 : NatCast.{u2} M₁] [_inst_9 : AddCommMonoidWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (OfNat.mk.{u2} M₁ 0 (Zero.zero.{u2} M₁ _inst_4)))) (OfNat.ofNat.{u1} M₂ 0 (OfNat.mk.{u1} M₂ 0 (Zero.zero.{u1} M₂ (AddZeroClass.toHasZero.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9)))))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (OfNat.mk.{u2} M₁ 1 (One.one.{u2} M₁ _inst_5)))) (OfNat.ofNat.{u1} M₂ 1 (OfNat.mk.{u1} M₂ 1 (One.one.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9)))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_6) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toHasAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (SMul.smul.{0, u2} Nat M₁ _inst_7 n x)) (SMul.smul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u2} Nat M₁ (CoeTCₓ.coe.{1, succ u2} Nat M₁ (Nat.castCoe.{u2} M₁ _inst_8))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u1} Nat M₂ (CoeTCₓ.coe.{1, succ u1} Nat M₂ (Nat.castCoe.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9))))) n)) -> (AddCommMonoidWithOne.{u2} M₁)
-but is expected to have type
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_4 : Zero.{u2} M₁] [_inst_5 : One.{u2} M₁] [_inst_6 : Add.{u2} M₁] [_inst_7 : SMul.{0, u2} Nat M₁] [_inst_8 : NatCast.{u2} M₁] [_inst_9 : AddCommMonoidWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (Zero.toOfNat0.{u2} M₁ _inst_4))) (OfNat.ofNat.{u1} M₂ 0 (Zero.toOfNat0.{u1} M₂ (AddMonoid.toZero.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9)))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (One.toOfNat1.{u2} M₁ _inst_5))) (OfNat.ofNat.{u1} M₂ 1 (One.toOfNat1.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_6) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (HSMul.hSMul.{0, u2, u2} Nat M₁ M₁ (instHSMul.{0, u2} Nat M₁ _inst_7) n x)) (HSMul.hSMul.{0, u1, u1} Nat M₂ M₂ (instHSMul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9)))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f (Nat.cast.{u2} M₁ _inst_8 n)) (Nat.cast.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₂ _inst_9)) n)) -> (AddCommMonoidWithOne.{u2} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.add_comm_monoid_with_one Function.Injective.addCommMonoidWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive commutative monoid with one, if it admits an
 injective map that preserves `0`, `1` and `+` to an additive commutative monoid with one.
 See note [reducible non-instances]. -/
@@ -283,12 +211,6 @@ protected def addCommMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMu
   { hf.AddMonoidWithOne f zero one add nsmul nat_cast, hf.AddCommMonoid f zero add nsmul with }
 #align function.injective.add_comm_monoid_with_one Function.Injective.addCommMonoidWithOne
 
-/- warning: function.injective.cancel_comm_monoid -> Function.Injective.cancelCommMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : CancelCommMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ (CancelCommMonoid.toCancelMonoid.{u2} M₂ _inst_4))))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ (CancelCommMonoid.toCancelMonoid.{u2} M₂ _inst_4)))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ (CancelCommMonoid.toCancelMonoid.{u2} M₂ _inst_4))))) (f x) n)) -> (CancelCommMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : CancelCommMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (RightCancelMonoid.toOne.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ (CancelCommMonoid.toCancelMonoid.{u2} M₂ _inst_4)))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ (CancelCommMonoid.toCancelMonoid.{u2} M₂ _inst_4)))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (RightCancelMonoid.toMonoid.{u2} M₂ (CancelMonoid.toRightCancelMonoid.{u2} M₂ (CancelCommMonoid.toCancelMonoid.{u2} M₂ _inst_4))))) (f x) n)) -> (CancelCommMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.cancel_comm_monoid Function.Injective.cancelCommMonoidₓ'. -/
 /-- A type endowed with `1` and `*` is a cancel commutative monoid,
 if it admits an injective map that preserves `1` and `*` to a cancel commutative monoid.
 See note [reducible non-instances]. -/
@@ -302,12 +224,6 @@ protected def cancelCommMonoid [CancelCommMonoid M₂] (f : M₁ → M₂) (hf :
 #align function.injective.cancel_comm_monoid Function.Injective.cancelCommMonoid
 #align function.injective.add_cancel_comm_monoid Function.Injective.addCancelCommMonoid
 
-/- warning: function.injective.has_involutive_inv -> Function.Injective.involutiveInv is a dubious translation:
-lean 3 declaration is
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_4 : Inv.{u2} M₁] [_inst_5 : InvolutiveInv.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (forall (x : M₁), Eq.{succ u1} M₂ (f (Inv.inv.{u2} M₁ _inst_4 x)) (Inv.inv.{u1} M₂ (InvolutiveInv.toHasInv.{u1} M₂ _inst_5) (f x))) -> (InvolutiveInv.{u2} M₁)
-but is expected to have type
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_4 : Inv.{u2} M₁] [_inst_5 : InvolutiveInv.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (forall (x : M₁), Eq.{succ u1} M₂ (f (Inv.inv.{u2} M₁ _inst_4 x)) (Inv.inv.{u1} M₂ (InvolutiveInv.toInv.{u1} M₂ _inst_5) (f x))) -> (InvolutiveInv.{u2} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.has_involutive_inv Function.Injective.involutiveInvₓ'. -/
 --See note [reducible non-instances]
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. -/
@@ -324,12 +240,6 @@ protected def involutiveInv {M₁ : Type _} [Inv M₁] [InvolutiveInv M₂] (f :
 
 variable [Inv M₁] [Div M₁] [Pow M₁ ℤ]
 
-/- warning: function.injective.div_inv_monoid -> Function.Injective.divInvMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : DivInvMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ _inst_7))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ _inst_7)))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (DivInvMonoid.toHasInv.{u2} M₂ _inst_7) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toHasDiv.{u2} M₂ _inst_7)) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ _inst_7))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ _inst_7)) (f x) n)) -> (DivInvMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : DivInvMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (Monoid.toOne.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ _inst_7))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ _inst_7)))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (DivInvMonoid.toInv.{u2} M₂ _inst_7) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toDiv.{u2} M₂ _inst_7)) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ _inst_7))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ _inst_7)) (f x) n)) -> (DivInvMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.div_inv_monoid Function.Injective.divInvMonoidₓ'. -/
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `div_inv_monoid`
 if it admits an injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `div_inv_monoid`.
 See note [reducible non-instances]. -/
@@ -350,12 +260,6 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
 
-/- warning: function.injective.division_monoid -> Function.Injective.divisionMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : DivisionMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7)))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (DivInvMonoid.toHasInv.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7)) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toHasDiv.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7)))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) n)) -> (DivisionMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : DivisionMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (InvOneClass.toOne.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ _inst_7)))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (InvOneClass.toInv.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ _inst_7))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toDiv.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7)))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) n)) -> (DivisionMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.division_monoid Function.Injective.divisionMonoidₓ'. -/
 -- See note [reducible non-instances]
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `division_monoid`
 if it admits an injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `division_monoid`. -/
@@ -375,12 +279,6 @@ protected def divisionMonoid [DivisionMonoid M₂] (f : M₁ → M₂) (hf : Inj
 #align function.injective.division_monoid Function.Injective.divisionMonoid
 #align function.injective.subtraction_monoid Function.Injective.subtractionMonoid
 
-/- warning: function.injective.division_comm_monoid -> Function.Injective.divisionCommMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : DivisionCommMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7))))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (DivInvMonoid.toHasInv.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toHasDiv.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7))))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))) (f x) n)) -> (DivisionCommMonoid.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : DivisionCommMonoid.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (InvOneClass.toOne.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (InvOneClass.toInv.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toDiv.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7))))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (DivisionMonoid.toDivInvMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ _inst_7)))) (f x) n)) -> (DivisionCommMonoid.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.division_comm_monoid Function.Injective.divisionCommMonoidₓ'. -/
 -- See note [reducible non-instances]
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `division_comm_monoid`
 if it admits an injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `division_comm_monoid`.
@@ -396,12 +294,6 @@ protected def divisionCommMonoid [DivisionCommMonoid M₂] (f : M₁ → M₂) (
 #align function.injective.division_comm_monoid Function.Injective.divisionCommMonoid
 #align function.injective.subtraction_comm_monoid Function.Injective.subtractionCommMonoid
 
-/- warning: function.injective.group -> Function.Injective.group is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : Group.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7)))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (DivInvMonoid.toHasInv.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7)) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toHasDiv.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7)))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) n)) -> (Group.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : Group.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (InvOneClass.toOne.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ (Group.toDivisionMonoid.{u2} M₂ _inst_7))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (InvOneClass.toInv.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ (Group.toDivisionMonoid.{u2} M₂ _inst_7)))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toDiv.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7)))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ _inst_7))) (f x) n)) -> (Group.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.group Function.Injective.groupₓ'. -/
 /-- A type endowed with `1`, `*` and `⁻¹` is a group,
 if it admits an injective map that preserves `1`, `*` and `⁻¹` to a group.
 See note [reducible non-instances]. -/
@@ -417,9 +309,6 @@ protected def group [Group M₂] (f : M₁ → M₂) (hf : Injective f) (one : f
 #align function.injective.group Function.Injective.group
 #align function.injective.add_group Function.Injective.addGroup
 
-/- warning: function.injective.add_group_with_one -> Function.Injective.addGroupWithOne is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align function.injective.add_group_with_one Function.Injective.addGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive group with one,
 if it admits an injective map that preserves `0`, `1` and `+` to an additive group with one.
 See note [reducible non-instances]. -/
@@ -439,12 +328,6 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
       hf (by erw [int_cast, neg, nat_cast, Int.cast_neg, Int.cast_ofNat]) }
 #align function.injective.add_group_with_one Function.Injective.addGroupWithOne
 
-/- warning: function.injective.comm_group -> Function.Injective.commGroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : CommGroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ _inst_2)))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ (MulOneClass.toHasOne.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7))))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toHasMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7)))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (DivInvMonoid.toHasInv.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toHasDiv.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7))))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7)))) (f x) n)) -> (CommGroup.{u1} M₁)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u1} M₁] [_inst_2 : One.{u1} M₁] [_inst_3 : Pow.{u1, 0} M₁ Nat] [_inst_4 : Inv.{u1} M₁] [_inst_5 : Div.{u1} M₁] [_inst_6 : Pow.{u1, 0} M₁ Int] [_inst_7 : CommGroup.{u2} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ _inst_2))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ (InvOneClass.toOne.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ (CommGroup.toDivisionCommMonoid.{u2} M₂ _inst_7)))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ _inst_1) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ (MulOneClass.toMul.{u2} M₂ (Monoid.toMulOneClass.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7)))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ _inst_4 x)) (Inv.inv.{u2} M₂ (InvOneClass.toInv.{u2} M₂ (DivInvOneMonoid.toInvOneClass.{u2} M₂ (DivisionMonoid.toDivInvOneMonoid.{u2} M₂ (DivisionCommMonoid.toDivisionMonoid.{u2} M₂ (CommGroup.toDivisionCommMonoid.{u2} M₂ _inst_7))))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ _inst_5) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ (DivInvMonoid.toDiv.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat _inst_3) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat (Monoid.Pow.{u2} M₂ (DivInvMonoid.toMonoid.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7))))) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int _inst_6) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int (DivInvMonoid.Pow.{u2} M₂ (Group.toDivInvMonoid.{u2} M₂ (CommGroup.toGroup.{u2} M₂ _inst_7)))) (f x) n)) -> (CommGroup.{u1} M₁)
-Case conversion may be inaccurate. Consider using '#align function.injective.comm_group Function.Injective.commGroupₓ'. -/
 /-- A type endowed with `1`, `*` and `⁻¹` is a commutative group,
 if it admits an injective map that preserves `1`, `*` and `⁻¹` to a commutative group.
 See note [reducible non-instances]. -/
@@ -459,9 +342,6 @@ protected def commGroup [CommGroup M₂] (f : M₁ → M₂) (hf : Injective f)
 #align function.injective.comm_group Function.Injective.commGroup
 #align function.injective.add_comm_group Function.Injective.addCommGroup
 
-/- warning: function.injective.add_comm_group_with_one -> Function.Injective.addCommGroupWithOne is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align function.injective.add_comm_group_with_one Function.Injective.addCommGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive commutative group with one, if it admits an
 injective map that preserves `0`, `1` and `+` to an additive commutative group with one.
 See note [reducible non-instances]. -/
@@ -487,12 +367,6 @@ namespace Surjective
 
 variable {M₁ : Type _} {M₂ : Type _} [Mul M₂]
 
-/- warning: function.surjective.semigroup -> Function.Surjective.semigroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : Semigroup.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (Semigroup.toHasMul.{u1} M₁ _inst_2)) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (Semigroup.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : Semigroup.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (Semigroup.toMul.{u1} M₁ _inst_2)) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (Semigroup.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.semigroup Function.Surjective.semigroupₓ'. -/
 /-- A type endowed with `*` is a semigroup,
 if it admits a surjective map that preserves `*` from a semigroup.
 See note [reducible non-instances]. -/
@@ -505,12 +379,6 @@ protected def semigroup [Semigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
 #align function.surjective.semigroup Function.Surjective.semigroup
 #align function.surjective.add_semigroup Function.Surjective.addSemigroup
 
-/- warning: function.surjective.comm_semigroup -> Function.Surjective.commSemigroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : CommSemigroup.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (Semigroup.toHasMul.{u1} M₁ (CommSemigroup.toSemigroup.{u1} M₁ _inst_2))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (CommSemigroup.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : CommSemigroup.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (Semigroup.toMul.{u1} M₁ (CommSemigroup.toSemigroup.{u1} M₁ _inst_2))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (CommSemigroup.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.comm_semigroup Function.Surjective.commSemigroupₓ'. -/
 /-- A type endowed with `*` is a commutative semigroup,
 if it admits a surjective map that preserves `*` from a commutative semigroup.
 See note [reducible non-instances]. -/
@@ -525,12 +393,6 @@ protected def commSemigroup [CommSemigroup M₁] (f : M₁ → M₂) (hf : Surje
 
 variable [One M₂]
 
-/- warning: function.surjective.mul_one_class -> Function.Surjective.mulOneClass is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : MulOneClass.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (MulOneClass.toHasOne.{u1} M₁ _inst_3))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_2)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toHasMul.{u1} M₁ _inst_3)) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (MulOneClass.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : MulOneClass.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (MulOneClass.toOne.{u1} M₁ _inst_3)))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_2))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toMul.{u1} M₁ _inst_3)) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (MulOneClass.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.mul_one_class Function.Surjective.mulOneClassₓ'. -/
 /-- A type endowed with `1` and `*` is a mul_one_class,
 if it admits a surjective map that preserves `1` and `*` from a mul_one_class.
 See note [reducible non-instances]. -/
@@ -548,12 +410,6 @@ protected def mulOneClass [MulOneClass M₁] (f : M₁ → M₂) (hf : Surjectiv
 
 variable [Pow M₂ ℕ]
 
-/- warning: function.surjective.monoid -> Function.Surjective.monoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Monoid.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (MulOneClass.toHasOne.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ _inst_4)))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_2)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toHasMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ _inst_4))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ _inst_4)) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (Monoid.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Monoid.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (Monoid.toOne.{u1} M₁ _inst_4)))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_2))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ _inst_4))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ _inst_4)) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (Monoid.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.monoid Function.Surjective.monoidₓ'. -/
 /-- A type endowed with `1` and `*` is a monoid,
 if it admits a surjective map that preserves `1` and `*` to a monoid.
 See note [reducible non-instances]. -/
@@ -570,12 +426,6 @@ protected def monoid [Monoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one
 #align function.surjective.monoid Function.Surjective.monoid
 #align function.surjective.add_monoid Function.Surjective.addMonoid
 
-/- warning: function.surjective.add_monoid_with_one -> Function.Surjective.addMonoidWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_4 : Zero.{u2} M₂] [_inst_5 : One.{u2} M₂] [_inst_6 : Add.{u2} M₂] [_inst_7 : SMul.{0, u2} Nat M₂] [_inst_8 : NatCast.{u2} M₂] [_inst_9 : AddMonoidWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (OfNat.mk.{u1} M₁ 0 (Zero.zero.{u1} M₁ (AddZeroClass.toHasZero.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ _inst_9))))))) (OfNat.ofNat.{u2} M₂ 0 (OfNat.mk.{u2} M₂ 0 (Zero.zero.{u2} M₂ _inst_4)))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ _inst_9))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_5)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toHasAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ _inst_9)))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_6) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (SMul.smul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ _inst_9)) n x)) (SMul.smul.{0, u2} Nat M₂ _inst_7 n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u1} Nat M₁ (CoeTCₓ.coe.{1, succ u1} Nat M₁ (Nat.castCoe.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ _inst_9)))) n)) ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u2} Nat M₂ (CoeTCₓ.coe.{1, succ u2} Nat M₂ (Nat.castCoe.{u2} M₂ _inst_8))) n)) -> (AddMonoidWithOne.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_4 : Zero.{u2} M₂] [_inst_5 : One.{u2} M₂] [_inst_6 : Add.{u2} M₂] [_inst_7 : SMul.{0, u2} Nat M₂] [_inst_8 : NatCast.{u2} M₂] [_inst_9 : AddMonoidWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (Zero.toOfNat0.{u1} M₁ (AddMonoid.toZero.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ _inst_9))))) (OfNat.ofNat.{u2} M₂ 0 (Zero.toOfNat0.{u2} M₂ _inst_4))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ _inst_9)))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_5))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ _inst_9)))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_6) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HSMul.hSMul.{0, u1, u1} Nat M₁ M₁ (instHSMul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ _inst_9))) n x)) (HSMul.hSMul.{0, u2, u2} Nat M₂ M₂ (instHSMul.{0, u2} Nat M₂ _inst_7) n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f (Nat.cast.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ _inst_9) n)) (Nat.cast.{u2} M₂ _inst_8 n)) -> (AddMonoidWithOne.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.add_monoid_with_one Function.Surjective.addMonoidWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
 if it admits a surjective map that preserves `0`, `1` and `*` from an additive monoid with one.
 See note [reducible non-instances]. -/
@@ -591,12 +441,6 @@ protected def addMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul 
     one := 1 }
 #align function.surjective.add_monoid_with_one Function.Surjective.addMonoidWithOne
 
-/- warning: function.surjective.comm_monoid -> Function.Surjective.commMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : CommMonoid.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (MulOneClass.toHasOne.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (CommMonoid.toMonoid.{u1} M₁ _inst_4))))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_2)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toHasMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (CommMonoid.toMonoid.{u1} M₁ _inst_4)))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (CommMonoid.toMonoid.{u1} M₁ _inst_4))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (CommMonoid.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : CommMonoid.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (Monoid.toOne.{u1} M₁ (CommMonoid.toMonoid.{u1} M₁ _inst_4))))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_2))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (CommMonoid.toMonoid.{u1} M₁ _inst_4)))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (CommMonoid.toMonoid.{u1} M₁ _inst_4))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (CommMonoid.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.comm_monoid Function.Surjective.commMonoidₓ'. -/
 /-- A type endowed with `1` and `*` is a commutative monoid,
 if it admits a surjective map that preserves `1` and `*` from a commutative monoid.
 See note [reducible non-instances]. -/
@@ -610,12 +454,6 @@ protected def commMonoid [CommMonoid M₁] (f : M₁ → M₂) (hf : Surjective
 #align function.surjective.comm_monoid Function.Surjective.commMonoid
 #align function.surjective.add_comm_monoid Function.Surjective.addCommMonoid
 
-/- warning: function.surjective.add_comm_monoid_with_one -> Function.Surjective.addCommMonoidWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_4 : Zero.{u2} M₂] [_inst_5 : One.{u2} M₂] [_inst_6 : Add.{u2} M₂] [_inst_7 : SMul.{0, u2} Nat M₂] [_inst_8 : NatCast.{u2} M₂] [_inst_9 : AddCommMonoidWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (OfNat.mk.{u1} M₁ 0 (Zero.zero.{u1} M₁ (AddZeroClass.toHasZero.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9)))))))) (OfNat.ofNat.{u2} M₂ 0 (OfNat.mk.{u2} M₂ 0 (Zero.zero.{u2} M₂ _inst_4)))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9)))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_5)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toHasAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9))))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_6) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (SMul.smul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9))) n x)) (SMul.smul.{0, u2} Nat M₂ _inst_7 n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u1} Nat M₁ (CoeTCₓ.coe.{1, succ u1} Nat M₁ (Nat.castCoe.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9))))) n)) ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u2} Nat M₂ (CoeTCₓ.coe.{1, succ u2} Nat M₂ (Nat.castCoe.{u2} M₂ _inst_8))) n)) -> (AddCommMonoidWithOne.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_4 : Zero.{u2} M₂] [_inst_5 : One.{u2} M₂] [_inst_6 : Add.{u2} M₂] [_inst_7 : SMul.{0, u2} Nat M₂] [_inst_8 : NatCast.{u2} M₂] [_inst_9 : AddCommMonoidWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (Zero.toOfNat0.{u1} M₁ (AddMonoid.toZero.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9)))))) (OfNat.ofNat.{u2} M₂ 0 (Zero.toOfNat0.{u2} M₂ _inst_4))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9))))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_5))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9))))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_6) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HSMul.hSMul.{0, u1, u1} Nat M₁ M₁ (instHSMul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9)))) n x)) (HSMul.hSMul.{0, u2, u2} Nat M₂ M₂ (instHSMul.{0, u2} Nat M₂ _inst_7) n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f (Nat.cast.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} M₁ _inst_9)) n)) (Nat.cast.{u2} M₂ _inst_8 n)) -> (AddCommMonoidWithOne.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.add_comm_monoid_with_one Function.Surjective.addCommMonoidWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
 if it admits a surjective map that preserves `0`, `1` and `*` from an additive monoid with one.
 See note [reducible non-instances]. -/
@@ -627,12 +465,6 @@ protected def addCommMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMu
   { hf.AddMonoidWithOne f zero one add nsmul nat_cast, hf.AddCommMonoid _ zero _ nsmul with }
 #align function.surjective.add_comm_monoid_with_one Function.Surjective.addCommMonoidWithOne
 
-/- warning: function.surjective.has_involutive_inv -> Function.Surjective.involutiveInv is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_4 : Inv.{u2} M₂] [_inst_5 : InvolutiveInv.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (InvolutiveInv.toHasInv.{u1} M₁ _inst_5) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (InvolutiveInv.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_4 : Inv.{u2} M₂] [_inst_5 : InvolutiveInv.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (InvolutiveInv.toInv.{u1} M₁ _inst_5) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (InvolutiveInv.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.has_involutive_inv Function.Surjective.involutiveInvₓ'. -/
 --See note [reducible non-instances]
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. -/
@@ -649,12 +481,6 @@ protected def involutiveInv {M₂ : Type _} [Inv M₂] [InvolutiveInv M₁] (f :
 
 variable [Inv M₂] [Div M₂] [Pow M₂ ℤ]
 
-/- warning: function.surjective.div_inv_monoid -> Function.Surjective.divInvMonoid is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Inv.{u2} M₂] [_inst_5 : Div.{u2} M₂] [_inst_6 : Pow.{u2, 0} M₂ Int] [_inst_7 : DivInvMonoid.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (MulOneClass.toHasOne.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ _inst_7))))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_2)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toHasMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ _inst_7)))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (DivInvMonoid.toHasInv.{u1} M₁ _inst_7) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ (DivInvMonoid.toHasDiv.{u1} M₁ _inst_7)) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ _inst_5) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ _inst_7))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int (DivInvMonoid.Pow.{u1} M₁ _inst_7)) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int _inst_6) (f x) n)) -> (DivInvMonoid.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Inv.{u2} M₂] [_inst_5 : Div.{u2} M₂] [_inst_6 : Pow.{u2, 0} M₂ Int] [_inst_7 : DivInvMonoid.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (Monoid.toOne.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ _inst_7))))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_2))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ _inst_7)))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (DivInvMonoid.toInv.{u1} M₁ _inst_7) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ (DivInvMonoid.toDiv.{u1} M₁ _inst_7)) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ _inst_5) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ _inst_7))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int (DivInvMonoid.Pow.{u1} M₁ _inst_7)) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int _inst_6) (f x) n)) -> (DivInvMonoid.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.div_inv_monoid Function.Surjective.divInvMonoidₓ'. -/
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `div_inv_monoid`
 if it admits a surjective map that preserves `1`, `*`, `⁻¹`, and `/` to a `div_inv_monoid`.
 See note [reducible non-instances]. -/
@@ -677,12 +503,6 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
 
-/- warning: function.surjective.group -> Function.Surjective.group is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Inv.{u2} M₂] [_inst_5 : Div.{u2} M₂] [_inst_6 : Pow.{u2, 0} M₂ Int] [_inst_7 : Group.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (MulOneClass.toHasOne.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7)))))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_2)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toHasMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7))))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (DivInvMonoid.toHasInv.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7)) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ (DivInvMonoid.toHasDiv.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7))) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ _inst_5) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7)))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int (DivInvMonoid.Pow.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int _inst_6) (f x) n)) -> (Group.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Inv.{u2} M₂] [_inst_5 : Div.{u2} M₂] [_inst_6 : Pow.{u2, 0} M₂ Int] [_inst_7 : Group.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (InvOneClass.toOne.{u1} M₁ (DivInvOneMonoid.toInvOneClass.{u1} M₁ (DivisionMonoid.toDivInvOneMonoid.{u1} M₁ (Group.toDivisionMonoid.{u1} M₁ _inst_7))))))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_2))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7))))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (InvOneClass.toInv.{u1} M₁ (DivInvOneMonoid.toInvOneClass.{u1} M₁ (DivisionMonoid.toDivInvOneMonoid.{u1} M₁ (Group.toDivisionMonoid.{u1} M₁ _inst_7)))) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ (DivInvMonoid.toDiv.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7))) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ _inst_5) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7)))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int (DivInvMonoid.Pow.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ _inst_7))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int _inst_6) (f x) n)) -> (Group.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.group Function.Surjective.groupₓ'. -/
 /-- A type endowed with `1`, `*` and `⁻¹` is a group,
 if it admits a surjective map that preserves `1`, `*` and `⁻¹` to a group.
 See note [reducible non-instances]. -/
@@ -698,9 +518,6 @@ protected def group [Group M₁] (f : M₁ → M₂) (hf : Surjective f) (one :
 #align function.surjective.group Function.Surjective.group
 #align function.surjective.add_group Function.Surjective.addGroup
 
-/- warning: function.surjective.add_group_with_one -> Function.Surjective.addGroupWithOne is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align function.surjective.add_group_with_one Function.Surjective.addGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1`, `+` is an additive group with one,
 if it admits a surjective map that preserves `0`, `1`, and `+` to an additive group with one.
 See note [reducible non-instances]. -/
@@ -720,12 +537,6 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
       rfl }
 #align function.surjective.add_group_with_one Function.Surjective.addGroupWithOne
 
-/- warning: function.surjective.comm_group -> Function.Surjective.commGroup is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Inv.{u2} M₂] [_inst_5 : Div.{u2} M₂] [_inst_6 : Pow.{u2, 0} M₂ Int] [_inst_7 : CommGroup.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (MulOneClass.toHasOne.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7))))))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_2)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toHasMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7)))))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (DivInvMonoid.toHasInv.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7))) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ (DivInvMonoid.toHasDiv.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7)))) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ _inst_5) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7))))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int (DivInvMonoid.Pow.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7)))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int _inst_6) (f x) n)) -> (CommGroup.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_1 : Mul.{u2} M₂] [_inst_2 : One.{u2} M₂] [_inst_3 : Pow.{u2, 0} M₂ Nat] [_inst_4 : Inv.{u2} M₂] [_inst_5 : Div.{u2} M₂] [_inst_6 : Pow.{u2, 0} M₂ Int] [_inst_7 : CommGroup.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (InvOneClass.toOne.{u1} M₁ (DivInvOneMonoid.toInvOneClass.{u1} M₁ (DivisionMonoid.toDivInvOneMonoid.{u1} M₁ (DivisionCommMonoid.toDivisionMonoid.{u1} M₁ (CommGroup.toDivisionCommMonoid.{u1} M₁ _inst_7)))))))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_2))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HMul.hMul.{u1, u1, u1} M₁ M₁ M₁ (instHMul.{u1} M₁ (MulOneClass.toMul.{u1} M₁ (Monoid.toMulOneClass.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7)))))) x y)) (HMul.hMul.{u2, u2, u2} M₂ M₂ M₂ (instHMul.{u2} M₂ _inst_1) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Inv.inv.{u1} M₁ (InvOneClass.toInv.{u1} M₁ (DivInvOneMonoid.toInvOneClass.{u1} M₁ (DivisionMonoid.toDivInvOneMonoid.{u1} M₁ (DivisionCommMonoid.toDivisionMonoid.{u1} M₁ (CommGroup.toDivisionCommMonoid.{u1} M₁ _inst_7))))) x)) (Inv.inv.{u2} M₂ _inst_4 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HDiv.hDiv.{u1, u1, u1} M₁ M₁ M₁ (instHDiv.{u1} M₁ (DivInvMonoid.toDiv.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7)))) x y)) (HDiv.hDiv.{u2, u2, u2} M₂ M₂ M₂ (instHDiv.{u2} M₂ _inst_5) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Nat M₁ (instHPow.{u1, 0} M₁ Nat (Monoid.Pow.{u1} M₁ (DivInvMonoid.toMonoid.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7))))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Nat M₂ (instHPow.{u2, 0} M₂ Nat _inst_3) (f x) n)) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HPow.hPow.{u1, 0, u1} M₁ Int M₁ (instHPow.{u1, 0} M₁ Int (DivInvMonoid.Pow.{u1} M₁ (Group.toDivInvMonoid.{u1} M₁ (CommGroup.toGroup.{u1} M₁ _inst_7)))) x n)) (HPow.hPow.{u2, 0, u2} M₂ Int M₂ (instHPow.{u2, 0} M₂ Int _inst_6) (f x) n)) -> (CommGroup.{u2} M₂)
-Case conversion may be inaccurate. Consider using '#align function.surjective.comm_group Function.Surjective.commGroupₓ'. -/
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a commutative group,
 if it admits a surjective map that preserves `1`, `*`, `⁻¹`, and `/` from a commutative group.
 See note [reducible non-instances]. -/
@@ -740,9 +551,6 @@ protected def commGroup [CommGroup M₁] (f : M₁ → M₂) (hf : Surjective f)
 #align function.surjective.comm_group Function.Surjective.commGroup
 #align function.surjective.add_comm_group Function.Surjective.addCommGroup
 
-/- warning: function.surjective.add_comm_group_with_one -> Function.Surjective.addCommGroupWithOne is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align function.surjective.add_comm_group_with_one Function.Surjective.addCommGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1`, `+` is an additive commutative group with one, if it admits a
 surjective map that preserves `0`, `1`, and `+` to an additive commutative group with one.
 See note [reducible non-instances]. -/
Diff
@@ -586,13 +586,8 @@ protected def addMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul 
     (nat_cast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₂ :=
   { hf.AddMonoid f zero add nsmul with
     natCast := coe
-    natCast_zero := by
-      rw [← nat_cast, Nat.cast_zero, zero]
-      rfl
-    natCast_succ := fun n =>
-      by
-      rw [← nat_cast, Nat.cast_succ, add, one, nat_cast]
-      rfl
+    natCast_zero := by rw [← nat_cast, Nat.cast_zero, zero]; rfl
+    natCast_succ := fun n => by rw [← nat_cast, Nat.cast_succ, add, one, nat_cast]; rfl
     one := 1 }
 #align function.surjective.add_monoid_with_one Function.Surjective.addMonoidWithOne
 
@@ -721,9 +716,7 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
       zsmul with
     intCast := coe
     intCast_ofNat := fun n => by rw [← int_cast, Int.cast_ofNat, nat_cast]
-    intCast_negSucc := fun n =>
-      by
-      rw [← int_cast, Int.cast_neg, Int.cast_ofNat, neg, nat_cast]
+    intCast_negSucc := fun n => by rw [← int_cast, Int.cast_neg, Int.cast_ofNat, neg, nat_cast];
       rfl }
 #align function.surjective.add_group_with_one Function.Surjective.addGroupWithOne
 
Diff
@@ -418,10 +418,7 @@ protected def group [Group M₂] (f : M₁ → M₂) (hf : Injective f) (one : f
 #align function.injective.add_group Function.Injective.addGroup
 
 /- warning: function.injective.add_group_with_one -> Function.Injective.addGroupWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_7 : Zero.{u2} M₁] [_inst_8 : One.{u2} M₁] [_inst_9 : Add.{u2} M₁] [_inst_10 : SMul.{0, u2} Nat M₁] [_inst_11 : Neg.{u2} M₁] [_inst_12 : Sub.{u2} M₁] [_inst_13 : SMul.{0, u2} Int M₁] [_inst_14 : NatCast.{u2} M₁] [_inst_15 : IntCast.{u2} M₁] [_inst_16 : AddGroupWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (OfNat.mk.{u2} M₁ 0 (Zero.zero.{u2} M₁ _inst_7)))) (OfNat.ofNat.{u1} M₂ 0 (OfNat.mk.{u1} M₂ 0 (Zero.zero.{u1} M₂ (AddZeroClass.toHasZero.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16)))))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (OfNat.mk.{u2} M₁ 1 (One.one.{u2} M₁ _inst_8)))) (OfNat.ofNat.{u1} M₂ 1 (OfNat.mk.{u1} M₂ 1 (One.one.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16)))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_9) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toHasAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u1} M₂ (f (Neg.neg.{u2} M₁ _inst_11 x)) (Neg.neg.{u1} M₂ (SubNegMonoid.toHasNeg.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ _inst_16))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HSub.hSub.{u2, u2, u2} M₁ M₁ M₁ (instHSub.{u2} M₁ _inst_12) x y)) (HSub.hSub.{u1, u1, u1} M₂ M₂ M₂ (instHSub.{u1} M₂ (SubNegMonoid.toHasSub.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ _inst_16)))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (SMul.smul.{0, u2} Nat M₁ _inst_10 n x)) (SMul.smul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16))) n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u1} M₂ (f (SMul.smul.{0, u2} Int M₁ _inst_13 n x)) (SMul.smul.{0, u1} Int M₂ (SubNegMonoid.SMulInt.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ _inst_16))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u2} Nat M₁ (CoeTCₓ.coe.{1, succ u2} Nat M₁ (Nat.castCoe.{u2} M₁ _inst_14))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u1} Nat M₂ (CoeTCₓ.coe.{1, succ u1} Nat M₂ (Nat.castCoe.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16))))) n)) -> (forall (n : Int), Eq.{succ u1} M₂ (f ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int M₁ (HasLiftT.mk.{1, succ u2} Int M₁ (CoeTCₓ.coe.{1, succ u2} Int M₁ (Int.castCoe.{u2} M₁ _inst_15))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int M₂ (HasLiftT.mk.{1, succ u1} Int M₂ (CoeTCₓ.coe.{1, succ u1} Int M₂ (Int.castCoe.{u1} M₂ (AddGroupWithOne.toHasIntCast.{u1} M₂ _inst_16)))) n)) -> (AddGroupWithOne.{u2} M₁)
-but is expected to have type
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_7 : Zero.{u2} M₁] [_inst_8 : One.{u2} M₁] [_inst_9 : Add.{u2} M₁] [_inst_10 : SMul.{0, u2} Nat M₁] [_inst_11 : Neg.{u2} M₁] [_inst_12 : Sub.{u2} M₁] [_inst_13 : SMul.{0, u2} Int M₁] [_inst_14 : NatCast.{u2} M₁] [_inst_15 : IntCast.{u2} M₁] [_inst_16 : AddGroupWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (Zero.toOfNat0.{u2} M₁ _inst_7))) (OfNat.ofNat.{u1} M₂ 0 (Zero.toOfNat0.{u1} M₂ (NegZeroClass.toZero.{u1} M₂ (SubNegZeroMonoid.toNegZeroClass.{u1} M₂ (SubtractionMonoid.toSubNegZeroMonoid.{u1} M₂ (AddGroup.toSubtractionMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ _inst_16)))))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (One.toOfNat1.{u2} M₁ _inst_8))) (OfNat.ofNat.{u1} M₂ 1 (One.toOfNat1.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_9) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u1} M₂ (f (Neg.neg.{u2} M₁ _inst_11 x)) (Neg.neg.{u1} M₂ (AddGroupWithOne.toNeg.{u1} M₂ _inst_16) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HSub.hSub.{u2, u2, u2} M₁ M₁ M₁ (instHSub.{u2} M₁ _inst_12) x y)) (HSub.hSub.{u1, u1, u1} M₂ M₂ M₂ (instHSub.{u1} M₂ (AddGroupWithOne.toSub.{u1} M₂ _inst_16)) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (HSMul.hSMul.{0, u2, u2} Nat M₁ M₁ (instHSMul.{0, u2} Nat M₁ _inst_10) n x)) (HSMul.hSMul.{0, u1, u1} Nat M₂ M₂ (instHSMul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16)))) n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u1} M₂ (f (HSMul.hSMul.{0, u2, u2} Int M₁ M₁ (instHSMul.{0, u2} Int M₁ _inst_13) n x)) (HSMul.hSMul.{0, u1, u1} Int M₂ M₂ (instHSMul.{0, u1} Int M₂ (SubNegMonoid.SMulInt.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ _inst_16)))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f (Nat.cast.{u2} M₁ _inst_14 n)) (Nat.cast.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ _inst_16)) n)) -> (forall (n : Int), Eq.{succ u1} M₂ (f (Int.cast.{u2} M₁ _inst_15 n)) (Int.cast.{u1} M₂ (AddGroupWithOne.toIntCast.{u1} M₂ _inst_16) n)) -> (AddGroupWithOne.{u2} M₁)
+<too large>
 Case conversion may be inaccurate. Consider using '#align function.injective.add_group_with_one Function.Injective.addGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive group with one,
 if it admits an injective map that preserves `0`, `1` and `+` to an additive group with one.
@@ -463,10 +460,7 @@ protected def commGroup [CommGroup M₂] (f : M₁ → M₂) (hf : Injective f)
 #align function.injective.add_comm_group Function.Injective.addCommGroup
 
 /- warning: function.injective.add_comm_group_with_one -> Function.Injective.addCommGroupWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_7 : Zero.{u2} M₁] [_inst_8 : One.{u2} M₁] [_inst_9 : Add.{u2} M₁] [_inst_10 : SMul.{0, u2} Nat M₁] [_inst_11 : Neg.{u2} M₁] [_inst_12 : Sub.{u2} M₁] [_inst_13 : SMul.{0, u2} Int M₁] [_inst_14 : NatCast.{u2} M₁] [_inst_15 : IntCast.{u2} M₁] [_inst_16 : AddCommGroupWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (OfNat.mk.{u2} M₁ 0 (Zero.zero.{u2} M₁ _inst_7)))) (OfNat.ofNat.{u1} M₂ 0 (OfNat.mk.{u1} M₂ 0 (Zero.zero.{u1} M₂ (AddZeroClass.toHasZero.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))))))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (OfNat.mk.{u2} M₁ 1 (One.one.{u2} M₁ _inst_8)))) (OfNat.ofNat.{u1} M₂ 1 (OfNat.mk.{u1} M₂ 1 (One.one.{u1} M₂ (AddMonoidWithOne.toOne.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))))))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_9) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toHasAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u1} M₂ (f (Neg.neg.{u2} M₁ _inst_11 x)) (Neg.neg.{u1} M₂ (SubNegMonoid.toHasNeg.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)))) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HSub.hSub.{u2, u2, u2} M₁ M₁ M₁ (instHSub.{u2} M₁ _inst_12) x y)) (HSub.hSub.{u1, u1, u1} M₂ M₂ M₂ (instHSub.{u1} M₂ (SubNegMonoid.toHasSub.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (SMul.smul.{0, u2} Nat M₁ _inst_10 n x)) (SMul.smul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)))) n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u1} M₂ (f (SMul.smul.{0, u2} Int M₁ _inst_13 n x)) (SMul.smul.{0, u1} Int M₂ (SubNegMonoid.SMulInt.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u2} Nat M₁ (CoeTCₓ.coe.{1, succ u2} Nat M₁ (Nat.castCoe.{u2} M₁ _inst_14))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u1} Nat M₂ (CoeTCₓ.coe.{1, succ u1} Nat M₂ (Nat.castCoe.{u1} M₂ (AddMonoidWithOne.toNatCast.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)))))) n)) -> (forall (n : Int), Eq.{succ u1} M₂ (f ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int M₁ (HasLiftT.mk.{1, succ u2} Int M₁ (CoeTCₓ.coe.{1, succ u2} Int M₁ (Int.castCoe.{u2} M₁ _inst_15))) n)) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int M₂ (HasLiftT.mk.{1, succ u1} Int M₂ (CoeTCₓ.coe.{1, succ u1} Int M₂ (Int.castCoe.{u1} M₂ (AddGroupWithOne.toHasIntCast.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))))) n)) -> (AddCommGroupWithOne.{u2} M₁)
-but is expected to have type
-  forall {M₂ : Type.{u1}} {M₁ : Type.{u2}} [_inst_7 : Zero.{u2} M₁] [_inst_8 : One.{u2} M₁] [_inst_9 : Add.{u2} M₁] [_inst_10 : SMul.{0, u2} Nat M₁] [_inst_11 : Neg.{u2} M₁] [_inst_12 : Sub.{u2} M₁] [_inst_13 : SMul.{0, u2} Int M₁] [_inst_14 : NatCast.{u2} M₁] [_inst_15 : IntCast.{u2} M₁] [_inst_16 : AddCommGroupWithOne.{u1} M₂] (f : M₁ -> M₂), (Function.Injective.{succ u2, succ u1} M₁ M₂ f) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 0 (Zero.toOfNat0.{u2} M₁ _inst_7))) (OfNat.ofNat.{u1} M₂ 0 (Zero.toOfNat0.{u1} M₂ (NegZeroClass.toZero.{u1} M₂ (SubNegZeroMonoid.toNegZeroClass.{u1} M₂ (SubtractionMonoid.toSubNegZeroMonoid.{u1} M₂ (SubtractionCommMonoid.toSubtractionMonoid.{u1} M₂ (AddCommGroup.toDivisionAddCommMonoid.{u1} M₂ (AddCommGroupWithOne.toAddCommGroup.{u1} M₂ _inst_16))))))))) -> (Eq.{succ u1} M₂ (f (OfNat.ofNat.{u2} M₁ 1 (One.toOfNat1.{u2} M₁ _inst_8))) (OfNat.ofNat.{u1} M₂ 1 (One.toOfNat1.{u1} M₂ (AddCommGroupWithOne.toOne.{u1} M₂ _inst_16)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HAdd.hAdd.{u2, u2, u2} M₁ M₁ M₁ (instHAdd.{u2} M₁ _inst_9) x y)) (HAdd.hAdd.{u1, u1, u1} M₂ M₂ M₂ (instHAdd.{u1} M₂ (AddZeroClass.toAdd.{u1} M₂ (AddMonoid.toAddZeroClass.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)))))) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u1} M₂ (f (Neg.neg.{u2} M₁ _inst_11 x)) (Neg.neg.{u1} M₂ (AddGroupWithOne.toNeg.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16)) (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u1} M₂ (f (HSub.hSub.{u2, u2, u2} M₁ M₁ M₁ (instHSub.{u2} M₁ _inst_12) x y)) (HSub.hSub.{u1, u1, u1} M₂ M₂ M₂ (instHSub.{u1} M₂ (AddGroupWithOne.toSub.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u1} M₂ (f (HSMul.hSMul.{0, u2, u2} Nat M₁ M₁ (instHSMul.{0, u2} Nat M₁ _inst_10) n x)) (HSMul.hSMul.{0, u1, u1} Nat M₂ M₂ (instHSMul.{0, u1} Nat M₂ (AddMonoid.SMul.{u1} M₂ (AddMonoidWithOne.toAddMonoid.{u1} M₂ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))))) n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u1} M₂ (f (HSMul.hSMul.{0, u2, u2} Int M₁ M₁ (instHSMul.{0, u2} Int M₁ _inst_13) n x)) (HSMul.hSMul.{0, u1, u1} Int M₂ M₂ (instHSMul.{0, u1} Int M₂ (SubNegMonoid.SMulInt.{u1} M₂ (AddGroup.toSubNegMonoid.{u1} M₂ (AddGroupWithOne.toAddGroup.{u1} M₂ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₂ _inst_16))))) n (f x))) -> (forall (n : Nat), Eq.{succ u1} M₂ (f (Nat.cast.{u2} M₁ _inst_14 n)) (Nat.cast.{u1} M₂ (AddCommGroupWithOne.toNatCast.{u1} M₂ _inst_16) n)) -> (forall (n : Int), Eq.{succ u1} M₂ (f (Int.cast.{u2} M₁ _inst_15 n)) (Int.cast.{u1} M₂ (AddCommGroupWithOne.toIntCast.{u1} M₂ _inst_16) n)) -> (AddCommGroupWithOne.{u2} M₁)
+<too large>
 Case conversion may be inaccurate. Consider using '#align function.injective.add_comm_group_with_one Function.Injective.addCommGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1` and `+` is an additive commutative group with one, if it admits an
 injective map that preserves `0`, `1` and `+` to an additive commutative group with one.
@@ -710,10 +704,7 @@ protected def group [Group M₁] (f : M₁ → M₂) (hf : Surjective f) (one :
 #align function.surjective.add_group Function.Surjective.addGroup
 
 /- warning: function.surjective.add_group_with_one -> Function.Surjective.addGroupWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_7 : Zero.{u2} M₂] [_inst_8 : One.{u2} M₂] [_inst_9 : Add.{u2} M₂] [_inst_10 : Neg.{u2} M₂] [_inst_11 : Sub.{u2} M₂] [_inst_12 : SMul.{0, u2} Nat M₂] [_inst_13 : SMul.{0, u2} Int M₂] [_inst_14 : NatCast.{u2} M₂] [_inst_15 : IntCast.{u2} M₂] [_inst_16 : AddGroupWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (OfNat.mk.{u1} M₁ 0 (Zero.zero.{u1} M₁ (AddZeroClass.toHasZero.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16)))))))) (OfNat.ofNat.{u2} M₂ 0 (OfNat.mk.{u2} M₂ 0 (Zero.zero.{u2} M₂ _inst_7)))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16)))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_8)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toHasAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16))))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_9) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Neg.neg.{u1} M₁ (SubNegMonoid.toHasNeg.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ _inst_16))) x)) (Neg.neg.{u2} M₂ _inst_10 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HSub.hSub.{u1, u1, u1} M₁ M₁ M₁ (instHSub.{u1} M₁ (SubNegMonoid.toHasSub.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ _inst_16)))) x y)) (HSub.hSub.{u2, u2, u2} M₂ M₂ M₂ (instHSub.{u2} M₂ _inst_11) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (SMul.smul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16))) n x)) (SMul.smul.{0, u2} Nat M₂ _inst_12 n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (SMul.smul.{0, u1} Int M₁ (SubNegMonoid.SMulInt.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ _inst_16))) n x)) (SMul.smul.{0, u2} Int M₂ _inst_13 n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u1} Nat M₁ (CoeTCₓ.coe.{1, succ u1} Nat M₁ (Nat.castCoe.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16))))) n)) ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u2} Nat M₂ (CoeTCₓ.coe.{1, succ u2} Nat M₂ (Nat.castCoe.{u2} M₂ _inst_14))) n)) -> (forall (n : Int), Eq.{succ u2} M₂ (f ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int M₁ (HasLiftT.mk.{1, succ u1} Int M₁ (CoeTCₓ.coe.{1, succ u1} Int M₁ (Int.castCoe.{u1} M₁ (AddGroupWithOne.toHasIntCast.{u1} M₁ _inst_16)))) n)) ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int M₂ (HasLiftT.mk.{1, succ u2} Int M₂ (CoeTCₓ.coe.{1, succ u2} Int M₂ (Int.castCoe.{u2} M₂ _inst_15))) n)) -> (AddGroupWithOne.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_7 : Zero.{u2} M₂] [_inst_8 : One.{u2} M₂] [_inst_9 : Add.{u2} M₂] [_inst_10 : Neg.{u2} M₂] [_inst_11 : Sub.{u2} M₂] [_inst_12 : SMul.{0, u2} Nat M₂] [_inst_13 : SMul.{0, u2} Int M₂] [_inst_14 : NatCast.{u2} M₂] [_inst_15 : IntCast.{u2} M₂] [_inst_16 : AddGroupWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (Zero.toOfNat0.{u1} M₁ (NegZeroClass.toZero.{u1} M₁ (SubNegZeroMonoid.toNegZeroClass.{u1} M₁ (SubtractionMonoid.toSubNegZeroMonoid.{u1} M₁ (AddGroup.toSubtractionMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ _inst_16)))))))) (OfNat.ofNat.{u2} M₂ 0 (Zero.toOfNat0.{u2} M₂ _inst_7))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16))))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_8))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16))))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_9) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Neg.neg.{u1} M₁ (AddGroupWithOne.toNeg.{u1} M₁ _inst_16) x)) (Neg.neg.{u2} M₂ _inst_10 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HSub.hSub.{u1, u1, u1} M₁ M₁ M₁ (instHSub.{u1} M₁ (AddGroupWithOne.toSub.{u1} M₁ _inst_16)) x y)) (HSub.hSub.{u2, u2, u2} M₂ M₂ M₂ (instHSub.{u2} M₂ _inst_11) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HSMul.hSMul.{0, u1, u1} Nat M₁ M₁ (instHSMul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16)))) n x)) (HSMul.hSMul.{0, u2, u2} Nat M₂ M₂ (instHSMul.{0, u2} Nat M₂ _inst_12) n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HSMul.hSMul.{0, u1, u1} Int M₁ M₁ (instHSMul.{0, u1} Int M₁ (SubNegMonoid.SMulInt.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ _inst_16)))) n x)) (HSMul.hSMul.{0, u2, u2} Int M₂ M₂ (instHSMul.{0, u2} Int M₂ _inst_13) n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f (Nat.cast.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ _inst_16)) n)) (Nat.cast.{u2} M₂ _inst_14 n)) -> (forall (n : Int), Eq.{succ u2} M₂ (f (Int.cast.{u1} M₁ (AddGroupWithOne.toIntCast.{u1} M₁ _inst_16) n)) (Int.cast.{u2} M₂ _inst_15 n)) -> (AddGroupWithOne.{u2} M₂)
+<too large>
 Case conversion may be inaccurate. Consider using '#align function.surjective.add_group_with_one Function.Surjective.addGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1`, `+` is an additive group with one,
 if it admits a surjective map that preserves `0`, `1`, and `+` to an additive group with one.
@@ -757,10 +748,7 @@ protected def commGroup [CommGroup M₁] (f : M₁ → M₂) (hf : Surjective f)
 #align function.surjective.add_comm_group Function.Surjective.addCommGroup
 
 /- warning: function.surjective.add_comm_group_with_one -> Function.Surjective.addCommGroupWithOne is a dubious translation:
-lean 3 declaration is
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_7 : Zero.{u2} M₂] [_inst_8 : One.{u2} M₂] [_inst_9 : Add.{u2} M₂] [_inst_10 : Neg.{u2} M₂] [_inst_11 : Sub.{u2} M₂] [_inst_12 : SMul.{0, u2} Nat M₂] [_inst_13 : SMul.{0, u2} Int M₂] [_inst_14 : NatCast.{u2} M₂] [_inst_15 : IntCast.{u2} M₂] [_inst_16 : AddCommGroupWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (OfNat.mk.{u1} M₁ 0 (Zero.zero.{u1} M₁ (AddZeroClass.toHasZero.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))))))))) (OfNat.ofNat.{u2} M₂ 0 (OfNat.mk.{u2} M₂ 0 (Zero.zero.{u2} M₂ _inst_7)))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (OfNat.mk.{u1} M₁ 1 (One.one.{u1} M₁ (AddMonoidWithOne.toOne.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))))))) (OfNat.ofNat.{u2} M₂ 1 (OfNat.mk.{u2} M₂ 1 (One.one.{u2} M₂ _inst_8)))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toHasAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)))))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_9) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Neg.neg.{u1} M₁ (SubNegMonoid.toHasNeg.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)))) x)) (Neg.neg.{u2} M₂ _inst_10 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HSub.hSub.{u1, u1, u1} M₁ M₁ M₁ (instHSub.{u1} M₁ (SubNegMonoid.toHasSub.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))))) x y)) (HSub.hSub.{u2, u2, u2} M₂ M₂ M₂ (instHSub.{u2} M₂ _inst_11) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (SMul.smul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)))) n x)) (SMul.smul.{0, u2} Nat M₂ _inst_12 n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (SMul.smul.{0, u1} Int M₁ (SubNegMonoid.SMulInt.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)))) n x)) (SMul.smul.{0, u2} Int M₂ _inst_13 n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat M₁ (HasLiftT.mk.{1, succ u1} Nat M₁ (CoeTCₓ.coe.{1, succ u1} Nat M₁ (Nat.castCoe.{u1} M₁ (AddMonoidWithOne.toNatCast.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)))))) n)) ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Nat M₂ (HasLiftT.mk.{1, succ u2} Nat M₂ (CoeTCₓ.coe.{1, succ u2} Nat M₂ (Nat.castCoe.{u2} M₂ _inst_14))) n)) -> (forall (n : Int), Eq.{succ u2} M₂ (f ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int M₁ (HasLiftT.mk.{1, succ u1} Int M₁ (CoeTCₓ.coe.{1, succ u1} Int M₁ (Int.castCoe.{u1} M₁ (AddGroupWithOne.toHasIntCast.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))))) n)) ((fun (a : Type) (b : Type.{u2}) [self : HasLiftT.{1, succ u2} a b] => self.0) Int M₂ (HasLiftT.mk.{1, succ u2} Int M₂ (CoeTCₓ.coe.{1, succ u2} Int M₂ (Int.castCoe.{u2} M₂ _inst_15))) n)) -> (AddCommGroupWithOne.{u2} M₂)
-but is expected to have type
-  forall {M₁ : Type.{u1}} {M₂ : Type.{u2}} [_inst_7 : Zero.{u2} M₂] [_inst_8 : One.{u2} M₂] [_inst_9 : Add.{u2} M₂] [_inst_10 : Neg.{u2} M₂] [_inst_11 : Sub.{u2} M₂] [_inst_12 : SMul.{0, u2} Nat M₂] [_inst_13 : SMul.{0, u2} Int M₂] [_inst_14 : NatCast.{u2} M₂] [_inst_15 : IntCast.{u2} M₂] [_inst_16 : AddCommGroupWithOne.{u1} M₁] (f : M₁ -> M₂), (Function.Surjective.{succ u1, succ u2} M₁ M₂ f) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 0 (Zero.toOfNat0.{u1} M₁ (NegZeroClass.toZero.{u1} M₁ (SubNegZeroMonoid.toNegZeroClass.{u1} M₁ (SubtractionMonoid.toSubNegZeroMonoid.{u1} M₁ (SubtractionCommMonoid.toSubtractionMonoid.{u1} M₁ (AddCommGroup.toDivisionAddCommMonoid.{u1} M₁ (AddCommGroupWithOne.toAddCommGroup.{u1} M₁ _inst_16))))))))) (OfNat.ofNat.{u2} M₂ 0 (Zero.toOfNat0.{u2} M₂ _inst_7))) -> (Eq.{succ u2} M₂ (f (OfNat.ofNat.{u1} M₁ 1 (One.toOfNat1.{u1} M₁ (AddCommGroupWithOne.toOne.{u1} M₁ _inst_16)))) (OfNat.ofNat.{u2} M₂ 1 (One.toOfNat1.{u2} M₂ _inst_8))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HAdd.hAdd.{u1, u1, u1} M₁ M₁ M₁ (instHAdd.{u1} M₁ (AddZeroClass.toAdd.{u1} M₁ (AddMonoid.toAddZeroClass.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)))))) x y)) (HAdd.hAdd.{u2, u2, u2} M₂ M₂ M₂ (instHAdd.{u2} M₂ _inst_9) (f x) (f y))) -> (forall (x : M₁), Eq.{succ u2} M₂ (f (Neg.neg.{u1} M₁ (AddGroupWithOne.toNeg.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16)) x)) (Neg.neg.{u2} M₂ _inst_10 (f x))) -> (forall (x : M₁) (y : M₁), Eq.{succ u2} M₂ (f (HSub.hSub.{u1, u1, u1} M₁ M₁ M₁ (instHSub.{u1} M₁ (AddGroupWithOne.toSub.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))) x y)) (HSub.hSub.{u2, u2, u2} M₂ M₂ M₂ (instHSub.{u2} M₂ _inst_11) (f x) (f y))) -> (forall (x : M₁) (n : Nat), Eq.{succ u2} M₂ (f (HSMul.hSMul.{0, u1, u1} Nat M₁ M₁ (instHSMul.{0, u1} Nat M₁ (AddMonoid.SMul.{u1} M₁ (AddMonoidWithOne.toAddMonoid.{u1} M₁ (AddGroupWithOne.toAddMonoidWithOne.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))))) n x)) (HSMul.hSMul.{0, u2, u2} Nat M₂ M₂ (instHSMul.{0, u2} Nat M₂ _inst_12) n (f x))) -> (forall (x : M₁) (n : Int), Eq.{succ u2} M₂ (f (HSMul.hSMul.{0, u1, u1} Int M₁ M₁ (instHSMul.{0, u1} Int M₁ (SubNegMonoid.SMulInt.{u1} M₁ (AddGroup.toSubNegMonoid.{u1} M₁ (AddGroupWithOne.toAddGroup.{u1} M₁ (AddCommGroupWithOne.toAddGroupWithOne.{u1} M₁ _inst_16))))) n x)) (HSMul.hSMul.{0, u2, u2} Int M₂ M₂ (instHSMul.{0, u2} Int M₂ _inst_13) n (f x))) -> (forall (n : Nat), Eq.{succ u2} M₂ (f (Nat.cast.{u1} M₁ (AddCommGroupWithOne.toNatCast.{u1} M₁ _inst_16) n)) (Nat.cast.{u2} M₂ _inst_14 n)) -> (forall (n : Int), Eq.{succ u2} M₂ (f (Int.cast.{u1} M₁ (AddCommGroupWithOne.toIntCast.{u1} M₁ _inst_16) n)) (Int.cast.{u2} M₂ _inst_15 n)) -> (AddCommGroupWithOne.{u2} M₂)
+<too large>
 Case conversion may be inaccurate. Consider using '#align function.surjective.add_comm_group_with_one Function.Surjective.addCommGroupWithOneₓ'. -/
 /-- A type endowed with `0`, `1`, `+` is an additive commutative group with one, if it admits a
 surjective map that preserves `0`, `1`, and `+` to an additive commutative group with one.

Changes in mathlib4

mathlib3
mathlib4
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -142,11 +142,11 @@ See note [reducible non-instances]. -/
 protected def addMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [NatCast M₁]
     [AddMonoidWithOne M₂] (f : M₁ → M₂) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
     (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (nat_cast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₁ :=
+    (natCast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₁ :=
   { hf.addMonoid f zero add (swap nsmul) with
     natCast := Nat.cast,
-    natCast_zero := hf (by erw [nat_cast, Nat.cast_zero, zero]),
-    natCast_succ := fun n => hf (by erw [nat_cast, Nat.cast_succ, add, one, nat_cast]), one := 1 }
+    natCast_zero := hf (by erw [natCast, Nat.cast_zero, zero]),
+    natCast_succ := fun n => hf (by erw [natCast, Nat.cast_succ, add, one, natCast]), one := 1 }
 #align function.injective.add_monoid_with_one Function.Injective.addMonoidWithOne
 
 /-- A type endowed with `1` and `*` is a left cancel monoid, if it admits an injective map that
@@ -204,8 +204,8 @@ See note [reducible non-instances]. -/
 protected def addCommMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [NatCast M₁]
     [AddCommMonoidWithOne M₂] (f : M₁ → M₂) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
     (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₁ where
-  __ := hf.addMonoidWithOne f zero one add nsmul nat_cast
+    (natCast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₁ where
+  __ := hf.addMonoidWithOne f zero one add nsmul natCast
   __ := hf.addCommMonoid _ zero add (swap nsmul)
 #align function.injective.add_comm_monoid_with_one Function.Injective.addCommMonoidWithOne
 
@@ -337,13 +337,13 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
     [SMul ℤ M₁] [NatCast M₁] [IntCast M₁] [AddGroupWithOne M₂] (f : M₁ → M₂) (hf : Injective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
     (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
-    (int_cast : ∀ n : ℤ, f n = n) : AddGroupWithOne M₁ :=
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (natCast : ∀ n : ℕ, f n = n)
+    (intCast : ∀ n : ℤ, f n = n) : AddGroupWithOne M₁ :=
   { hf.addGroup f zero add neg sub (swap nsmul) (swap zsmul),
-    hf.addMonoidWithOne f zero one add nsmul nat_cast with
+    hf.addMonoidWithOne f zero one add nsmul natCast with
     intCast := Int.cast,
-    intCast_ofNat := fun n => hf (by rw [nat_cast, ← Int.cast, int_cast, Int.cast_natCast]),
-    intCast_negSucc := fun n => hf (by erw [int_cast, neg, nat_cast, Int.cast_negSucc] ) }
+    intCast_ofNat := fun n => hf (by rw [natCast, ← Int.cast, intCast, Int.cast_natCast]),
+    intCast_negSucc := fun n => hf (by erw [intCast, neg, natCast, Int.cast_negSucc] ) }
 #align function.injective.add_group_with_one Function.Injective.addGroupWithOne
 
 /-- A type endowed with `1`, `*` and `⁻¹` is a commutative group, if it admits an injective map that
@@ -367,9 +367,9 @@ protected def addCommGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul
     [SMul ℤ M₁] [NatCast M₁] [IntCast M₁] [AddCommGroupWithOne M₂] (f : M₁ → M₂) (hf : Injective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
     (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
-    (int_cast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₁ :=
-  { hf.addGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (natCast : ∀ n : ℕ, f n = n)
+    (intCast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₁ :=
+  { hf.addGroupWithOne f zero one add neg sub nsmul zsmul natCast intCast,
     hf.addCommMonoid _ zero add (swap nsmul) with }
 #align function.injective.add_comm_group_with_one Function.Injective.addCommGroupWithOne
 
@@ -457,11 +457,11 @@ map that preserves `0`, `1` and `*` from an additive monoid with one. See note
 protected def addMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul ℕ M₂] [NatCast M₂]
     [AddMonoidWithOne M₁] (f : M₁ → M₂) (hf : Surjective f) (zero : f 0 = 0) (one : f 1 = 1)
     (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (nat_cast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₂ :=
+    (natCast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₂ :=
   { hf.addMonoid f zero add (swap nsmul) with
     natCast := Nat.cast,
-    natCast_zero := by rw [← Nat.cast, ← nat_cast, Nat.cast_zero, zero]
-    natCast_succ := fun n => by rw [← Nat.cast, ← nat_cast, Nat.cast_succ, add, one, nat_cast]
+    natCast_zero := by rw [← Nat.cast, ← natCast, Nat.cast_zero, zero]
+    natCast_succ := fun n => by rw [← Nat.cast, ← natCast, Nat.cast_succ, add, one, natCast]
     one := 1 }
 #align function.surjective.add_monoid_with_one Function.Surjective.addMonoidWithOne
 
@@ -484,8 +484,8 @@ See note [reducible non-instances]. -/
 protected def addCommMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul ℕ M₂] [NatCast M₂]
     [AddCommMonoidWithOne M₁] (f : M₁ → M₂) (hf : Surjective f) (zero : f 0 = 0) (one : f 1 = 1)
     (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₂ where
-  __ := hf.addMonoidWithOne f zero one add nsmul nat_cast
+    (natCast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₂ where
+  __ := hf.addMonoidWithOne f zero one add nsmul natCast
   __ := hf.addCommMonoid _ zero add (swap nsmul)
 #align function.surjective.add_comm_monoid_with_one Function.Surjective.addCommMonoidWithOne
 
@@ -548,14 +548,14 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
     [SMul ℤ M₂] [NatCast M₂] [IntCast M₂] [AddGroupWithOne M₁] (f : M₁ → M₂) (hf : Surjective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
     (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
-    (int_cast : ∀ n : ℤ, f n = n) : AddGroupWithOne M₂ :=
-  { hf.addMonoidWithOne f zero one add nsmul nat_cast,
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (natCast : ∀ n : ℕ, f n = n)
+    (intCast : ∀ n : ℤ, f n = n) : AddGroupWithOne M₂ :=
+  { hf.addMonoidWithOne f zero one add nsmul natCast,
     hf.addGroup f zero add neg sub (swap nsmul) (swap zsmul) with
     intCast := Int.cast,
-    intCast_ofNat := fun n => by rw [← Int.cast, ← int_cast, Int.cast_natCast, nat_cast],
+    intCast_ofNat := fun n => by rw [← Int.cast, ← intCast, Int.cast_natCast, natCast],
     intCast_negSucc := fun n => by
-      rw [← Int.cast, ← int_cast, Int.cast_negSucc, neg, nat_cast] }
+      rw [← Int.cast, ← intCast, Int.cast_negSucc, neg, natCast] }
 #align function.surjective.add_group_with_one Function.Surjective.addGroupWithOne
 
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a commutative group, if it admits a surjective
@@ -580,9 +580,9 @@ protected def addCommGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg
     [SMul ℤ M₂] [NatCast M₂] [IntCast M₂] [AddCommGroupWithOne M₁] (f : M₁ → M₂) (hf : Surjective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
     (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
-    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
-    (int_cast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₂ :=
-  { hf.addGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (natCast : ∀ n : ℕ, f n = n)
+    (intCast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₂ :=
+  { hf.addGroupWithOne f zero one add neg sub nsmul zsmul natCast intCast,
     hf.addCommMonoid _ zero add (swap nsmul) with }
 #align function.surjective.add_comm_group_with_one Function.Surjective.addCommGroupWithOne
 
chore(Data/Int/Cast): fix confusion between OfNat and Nat.cast lemmas (#11861)

This renames

  • Int.cast_ofNat to Int.cast_natCast
  • Int.int_cast_ofNat to Int.cast_ofNat

I think the history here is that this lemma was previously about Int.ofNat, before we globally fixed the simp-normal form to be Nat.cast.

Since the Int.cast_ofNat name is repurposed, it can't be deprecated. Int.int_cast_ofNat is such a wonky name that it was probably never used.

Diff
@@ -342,7 +342,7 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
   { hf.addGroup f zero add neg sub (swap nsmul) (swap zsmul),
     hf.addMonoidWithOne f zero one add nsmul nat_cast with
     intCast := Int.cast,
-    intCast_ofNat := fun n => hf (by rw [nat_cast, ← Int.cast, int_cast, Int.cast_ofNat]),
+    intCast_ofNat := fun n => hf (by rw [nat_cast, ← Int.cast, int_cast, Int.cast_natCast]),
     intCast_negSucc := fun n => hf (by erw [int_cast, neg, nat_cast, Int.cast_negSucc] ) }
 #align function.injective.add_group_with_one Function.Injective.addGroupWithOne
 
@@ -553,7 +553,7 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
   { hf.addMonoidWithOne f zero one add nsmul nat_cast,
     hf.addGroup f zero add neg sub (swap nsmul) (swap zsmul) with
     intCast := Int.cast,
-    intCast_ofNat := fun n => by rw [← Int.cast, ← int_cast, Int.cast_ofNat, nat_cast],
+    intCast_ofNat := fun n => by rw [← Int.cast, ← int_cast, Int.cast_natCast, nat_cast],
     intCast_negSucc := fun n => by
       rw [← Int.cast, ← int_cast, Int.cast_negSucc, neg, nat_cast] }
 #align function.surjective.add_group_with_one Function.Surjective.addGroupWithOne
chore(Field/InjSurj): Tidy (#11480)

Among other things, change the nsmul, zsmul, qsmul fields to have n/q come before x, because this matches the lemmas we want to write about them. It would be preferrable to perform the same changes to the AddMonoid/AddGroup-like typeclasses, but this is impossible with the current to_additive framework, so instead I have inserted some Function.swap at the interface between AddMonoid/AddGroup and Ring/Field.

Reduce the diff of #11203

Diff
@@ -25,6 +25,16 @@ Then `H` satisfies the group axioms.
 The relevant definition in this case is `Function.Surjective.group`.
 Dually, there is also `Function.Injective.group`.
 And there are versions for (additive) (commutative) semigroups/monoids.
+
+## Implementation note
+
+The `nsmul` and `zsmul` assumptions on any tranfer definition for an algebraic structure involving
+both addition and multiplication (eg `AddMonoidWithOne`) is `∀ n x, f (n • x) = n • f x`, which is
+what we would expect.
+However, we cannot do the same for transfer definitions built using `to_additive` (eg `AddMonoid`)
+as we want the multiplicative versions to be `∀ x n, f (x ^ n) = f x ^ n`.
+As a result, we must use `Function.swap` when using additivised transfer definitions in
+non-additivised ones.
 -/
 
 
@@ -131,9 +141,9 @@ See note [reducible non-instances]. -/
 @[reducible]
 protected def addMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [NatCast M₁]
     [AddMonoidWithOne M₂] (f : M₁ → M₂) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
-    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
+    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
     (nat_cast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₁ :=
-  { hf.addMonoid f zero add nsmul with
+  { hf.addMonoid f zero add (swap nsmul) with
     natCast := Nat.cast,
     natCast_zero := hf (by erw [nat_cast, Nat.cast_zero, zero]),
     natCast_succ := fun n => hf (by erw [nat_cast, Nat.cast_succ, add, one, nat_cast]), one := 1 }
@@ -193,9 +203,10 @@ See note [reducible non-instances]. -/
 @[reducible]
 protected def addCommMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [NatCast M₁]
     [AddCommMonoidWithOne M₂] (f : M₁ → M₂) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
-    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
-    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₁ :=
-  { hf.addMonoidWithOne f zero one add nsmul nat_cast, hf.addCommMonoid f zero add nsmul with }
+    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
+    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₁ where
+  __ := hf.addMonoidWithOne f zero one add nsmul nat_cast
+  __ := hf.addCommMonoid _ zero add (swap nsmul)
 #align function.injective.add_comm_monoid_with_one Function.Injective.addCommMonoidWithOne
 
 /-- A type endowed with `1` and `*` is a cancel commutative monoid, if it admits an injective map
@@ -325,10 +336,10 @@ map that preserves `0`, `1` and `+` to an additive group with one.  See note
 protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [Neg M₁] [Sub M₁]
     [SMul ℤ M₁] [NatCast M₁] [IntCast M₁] [AddGroupWithOne M₂] (f : M₁ → M₂) (hf : Injective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
-    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
-    (zsmul : ∀ (x) (n : ℤ), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
+    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
     (int_cast : ∀ n : ℤ, f n = n) : AddGroupWithOne M₁ :=
-  { hf.addGroup f zero add neg sub nsmul zsmul,
+  { hf.addGroup f zero add neg sub (swap nsmul) (swap zsmul),
     hf.addMonoidWithOne f zero one add nsmul nat_cast with
     intCast := Int.cast,
     intCast_ofNat := fun n => hf (by rw [nat_cast, ← Int.cast, int_cast, Int.cast_ofNat]),
@@ -355,11 +366,11 @@ See note [reducible non-instances]. -/
 protected def addCommGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [Neg M₁] [Sub M₁]
     [SMul ℤ M₁] [NatCast M₁] [IntCast M₁] [AddCommGroupWithOne M₂] (f : M₁ → M₂) (hf : Injective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
-    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
-    (zsmul : ∀ (x) (n : ℤ), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
+    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
     (int_cast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₁ :=
   { hf.addGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
-    hf.addCommMonoid f zero add nsmul with }
+    hf.addCommMonoid _ zero add (swap nsmul) with }
 #align function.injective.add_comm_group_with_one Function.Injective.addCommGroupWithOne
 
 end Injective
@@ -445,9 +456,9 @@ map that preserves `0`, `1` and `*` from an additive monoid with one. See note
 @[reducible]
 protected def addMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul ℕ M₂] [NatCast M₂]
     [AddMonoidWithOne M₁] (f : M₁ → M₂) (hf : Surjective f) (zero : f 0 = 0) (one : f 1 = 1)
-    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
+    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
     (nat_cast : ∀ n : ℕ, f n = n) : AddMonoidWithOne M₂ :=
-  { hf.addMonoid f zero add nsmul with
+  { hf.addMonoid f zero add (swap nsmul) with
     natCast := Nat.cast,
     natCast_zero := by rw [← Nat.cast, ← nat_cast, Nat.cast_zero, zero]
     natCast_succ := fun n => by rw [← Nat.cast, ← nat_cast, Nat.cast_succ, add, one, nat_cast]
@@ -472,9 +483,10 @@ See note [reducible non-instances]. -/
 @[reducible]
 protected def addCommMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul ℕ M₂] [NatCast M₂]
     [AddCommMonoidWithOne M₁] (f : M₁ → M₂) (hf : Surjective f) (zero : f 0 = 0) (one : f 1 = 1)
-    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
-    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₂ :=
-  { hf.addMonoidWithOne f zero one add nsmul nat_cast, hf.addCommMonoid _ zero add nsmul with }
+    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
+    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₂ where
+  __ := hf.addMonoidWithOne f zero one add nsmul nat_cast
+  __ := hf.addCommMonoid _ zero add (swap nsmul)
 #align function.surjective.add_comm_monoid_with_one Function.Surjective.addCommMonoidWithOne
 
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
@@ -535,11 +547,11 @@ See note [reducible non-instances]. -/
 protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂] [Sub M₂] [SMul ℕ M₂]
     [SMul ℤ M₂] [NatCast M₂] [IntCast M₂] [AddGroupWithOne M₁] (f : M₁ → M₂) (hf : Surjective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
-    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
-    (zsmul : ∀ (x) (n : ℤ), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
+    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
     (int_cast : ∀ n : ℤ, f n = n) : AddGroupWithOne M₂ :=
   { hf.addMonoidWithOne f zero one add nsmul nat_cast,
-    hf.addGroup f zero add neg sub nsmul zsmul with
+    hf.addGroup f zero add neg sub (swap nsmul) (swap zsmul) with
     intCast := Int.cast,
     intCast_ofNat := fun n => by rw [← Int.cast, ← int_cast, Int.cast_ofNat, nat_cast],
     intCast_negSucc := fun n => by
@@ -567,11 +579,11 @@ See note [reducible non-instances]. -/
 protected def addCommGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂] [Sub M₂] [SMul ℕ M₂]
     [SMul ℤ M₂] [NatCast M₂] [IntCast M₂] [AddCommGroupWithOne M₁] (f : M₁ → M₂) (hf : Surjective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
-    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
-    (zsmul : ∀ (x) (n : ℤ), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
+    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
+    (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
     (int_cast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₂ :=
   { hf.addGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
-    hf.addCommMonoid _ zero add nsmul with }
+    hf.addCommMonoid _ zero add (swap nsmul) with }
 #align function.surjective.add_comm_group_with_one Function.Surjective.addCommGroupWithOne
 
 end Surjective
chore: Rename zpow_coe_nat to zpow_natCast (#11528)

... and add a deprecated alias for the old name. This is mostly just me discovering the power of F2

Diff
@@ -250,8 +250,8 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
   { hf.monoid f one mul npow, ‹Inv M₁›, ‹Div M₁› with
     zpow := fun n x => x ^ n,
     zpow_zero' := fun x => hf <| by erw [zpow, zpow_zero, one],
-    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_coe_nat, pow_succ, zpow, zpow_coe_nat],
-    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_coe_nat],
+    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_natCast, pow_succ, zpow, zpow_natCast],
+    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_natCast],
     div_eq_mul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
@@ -506,10 +506,10 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
     zpow_zero' := hf.forall.2 fun x => by dsimp only; erw [← zpow, zpow_zero, ← one],
     zpow_succ' := fun n => hf.forall.2 fun x => by
       dsimp only
-      erw [← zpow, ← zpow, zpow_coe_nat, zpow_coe_nat, pow_succ, ← mul],
+      erw [← zpow, ← zpow, zpow_natCast, zpow_natCast, pow_succ, ← mul],
     zpow_neg' := fun n => hf.forall.2 fun x => by
       dsimp only
-      erw [← zpow, ← zpow, zpow_negSucc, zpow_coe_nat, inv],
+      erw [← zpow, ← zpow, zpow_negSucc, zpow_natCast, inv],
     div_eq_mul_inv := hf.forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
perf: small speedup in InjSurj (#11413)

This new order matches the order in the extends clause, and so results in less eta expansion.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -183,7 +183,7 @@ admits an injective map that preserves `0` and `+` to an additive commutative mo
 protected def commMonoid [CommMonoid M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) :
     CommMonoid M₁ :=
-  { hf.commSemigroup f mul, hf.monoid f one mul npow with }
+  { hf.monoid f one mul npow, hf.commSemigroup f mul with }
 #align function.injective.comm_monoid Function.Injective.commMonoid
 #align function.injective.add_comm_monoid Function.Injective.addCommMonoid
 
fix: correct statement of zpow_ofNat and ofNat_zsmul (#10969)

Previously these were syntactically identical to the corresponding zpow_coe_nat and coe_nat_zsmul lemmas, now they are about OfNat.ofNat.

Unfortunately, almost every call site uses the ofNat name to refer to Nat.cast, so the downstream proofs had to be adjusted too.

Diff
@@ -250,8 +250,8 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
   { hf.monoid f one mul npow, ‹Inv M₁›, ‹Div M₁› with
     zpow := fun n x => x ^ n,
     zpow_zero' := fun x => hf <| by erw [zpow, zpow_zero, one],
-    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_ofNat, pow_succ, zpow, zpow_ofNat],
-    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_ofNat],
+    zpow_succ' := fun n x => hf <| by erw [zpow, mul, zpow_coe_nat, pow_succ, zpow, zpow_coe_nat],
+    zpow_neg' := fun n x => hf <| by erw [zpow, zpow_negSucc, inv, zpow, zpow_coe_nat],
     div_eq_mul_inv := fun x y => hf <| by erw [div, mul, inv, div_eq_mul_inv] }
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
@@ -506,10 +506,10 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
     zpow_zero' := hf.forall.2 fun x => by dsimp only; erw [← zpow, zpow_zero, ← one],
     zpow_succ' := fun n => hf.forall.2 fun x => by
       dsimp only
-      erw [← zpow, ← zpow, zpow_ofNat, zpow_ofNat, pow_succ, ← mul],
+      erw [← zpow, ← zpow, zpow_coe_nat, zpow_coe_nat, pow_succ, ← mul],
     zpow_neg' := fun n => hf.forall.2 fun x => by
       dsimp only
-      erw [← zpow, ← zpow, zpow_negSucc, zpow_ofNat, inv],
+      erw [← zpow, ← zpow, zpow_negSucc, zpow_coe_nat, inv],
     div_eq_mul_inv := hf.forall₂.2 fun x y => by erw [← inv, ← mul, ← div, div_eq_mul_inv] }
 #align function.surjective.div_inv_monoid Function.Surjective.divInvMonoid
 #align function.surjective.sub_neg_monoid Function.Surjective.subNegMonoid
perf: Use spread notation in ring transfer definitions (#10131)

Make sure that Function.Injective.somethingRing looks like

def ... : SomethingRing β where
  toA := hf.a f ...
  __ := hf.b f ...
  __ := hf.c f ...

if SomethingRing α extends A α, B α, C α.

This should hopefully give a performance boost in applications.

Incidentally, there were a few missing transfer definitions, so I added them as I needed them.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Johan Commelin <johan@commelin.net>

Diff
@@ -6,6 +6,7 @@ Authors: Johan Commelin
 import Mathlib.Algebra.Group.Defs
 import Mathlib.Logic.Function.Basic
 import Mathlib.Data.Int.Cast.Basic
+import Mathlib.Tactic.Spread
 
 #align_import algebra.group.inj_surj from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
 
@@ -48,14 +49,24 @@ protected def semigroup [Semigroup M₂] (f : M₁ → M₂) (hf : Injective f)
 #align function.injective.semigroup Function.Injective.semigroup
 #align function.injective.add_semigroup Function.Injective.addSemigroup
 
+/-- A type endowed with `*` is a commutative magma, if it admits a surjective map that preserves
+`*` from a commutative magma. -/
+@[to_additive (attr := reducible) -- See note [reducible non-instances]
+"A type endowed with `+` is an additive commutative semigroup, if it admits
+a surjective map that preserves `+` from an additive commutative semigroup."]
+protected def commMagma [CommMagma M₂] (f : M₁ → M₂) (hf : Injective f)
+    (mul : ∀ x y, f (x * y) = f x * f y) : CommMagma M₁ where
+  mul_comm x y := hf <| by rw [mul, mul, mul_comm]
+
 /-- A type endowed with `*` is a commutative semigroup, if it admits an injective map that
 preserves `*` to a commutative semigroup.  See note [reducible non-instances]. -/
 @[to_additive (attr := reducible)
 "A type endowed with `+` is an additive commutative semigroup,if it admits
 an injective map that preserves `+` to an additive commutative semigroup."]
 protected def commSemigroup [CommSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
-    (mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₁ :=
-  { hf.semigroup f mul with mul_comm := fun x y => hf <| by erw [mul, mul, mul_comm] }
+    (mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₁ where
+  toSemigroup := hf.semigroup f mul
+  __ := hf.commMagma f mul
 #align function.injective.comm_semigroup Function.Injective.commSemigroup
 #align function.injective.add_comm_semigroup Function.Injective.addCommSemigroup
 
@@ -373,15 +384,24 @@ protected def semigroup [Semigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
 #align function.surjective.semigroup Function.Surjective.semigroup
 #align function.surjective.add_semigroup Function.Surjective.addSemigroup
 
+/-- A type endowed with `*` is a commutative semigroup, if it admits a surjective map that preserves
+`*` from a commutative semigroup. See note [reducible non-instances]. -/
+@[to_additive (attr := reducible)
+"A type endowed with `+` is an additive commutative semigroup, if it admits
+a surjective map that preserves `+` from an additive commutative semigroup."]
+protected def commMagma [CommMagma M₁] (f : M₁ → M₂) (hf : Surjective f)
+    (mul : ∀ x y, f (x * y) = f x * f y) : CommMagma M₂ where
+  mul_comm := hf.forall₂.2 fun x y => by erw [← mul, ← mul, mul_comm]
+
 /-- A type endowed with `*` is a commutative semigroup, if it admits a surjective map that preserves
 `*` from a commutative semigroup. See note [reducible non-instances]. -/
 @[to_additive (attr := reducible)
 "A type endowed with `+` is an additive commutative semigroup, if it admits
 a surjective map that preserves `+` from an additive commutative semigroup."]
 protected def commSemigroup [CommSemigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
-    (mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₂ :=
-  { hf.semigroup f mul with
-    mul_comm := hf.forall₂.2 fun x y => by erw [← mul, ← mul, mul_comm] }
+    (mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₂ where
+  toSemigroup := hf.semigroup f mul
+  __ := hf.commMagma f mul
 #align function.surjective.comm_semigroup Function.Surjective.commSemigroup
 #align function.surjective.add_comm_semigroup Function.Surjective.addCommSemigroup
 
chore: space after (#8178)

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

Diff
@@ -320,7 +320,7 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
   { hf.addGroup f zero add neg sub nsmul zsmul,
     hf.addMonoidWithOne f zero one add nsmul nat_cast with
     intCast := Int.cast,
-    intCast_ofNat := fun n => hf (by rw [nat_cast, ←Int.cast, int_cast, Int.cast_ofNat]),
+    intCast_ofNat := fun n => hf (by rw [nat_cast, ← Int.cast, int_cast, Int.cast_ofNat]),
     intCast_negSucc := fun n => hf (by erw [int_cast, neg, nat_cast, Int.cast_negSucc] ) }
 #align function.injective.add_group_with_one Function.Injective.addGroupWithOne
 
@@ -412,8 +412,10 @@ protected def monoid [Monoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one
     (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) : Monoid M₂ :=
   { hf.semigroup f mul, hf.mulOneClass f one mul with
     npow := fun n x => x ^ n,
-    npow_zero := hf.forall.2 fun x => by dsimp only; erw [←npow, pow_zero, ←one],
-    npow_succ := fun n => hf.forall.2 fun x => by dsimp only; erw [←npow, pow_succ, ←npow, ←mul] }
+    npow_zero := hf.forall.2 fun x => by dsimp only; erw [← npow, pow_zero, ← one],
+    npow_succ := fun n => hf.forall.2 fun x => by
+      dsimp only
+      erw [← npow, pow_succ, ← npow, ← mul] }
 #align function.surjective.monoid Function.Surjective.monoid
 #align function.surjective.add_monoid Function.Surjective.addMonoid
 
perf: remove overspecified fields (#6965)

This removes redundant field values of the form add := add for smaller terms and less unfolding during unification.

A list of all files containing a structure instance of the form { a1, ... with x1 := val, ... } where some xi is a field of some aj was generated by modifying the structure instance elaboration algorithm to print such overlaps to stdout in a custom toolchain.

Using that toolchain, I went through each file on the list and attempted to remove algebraic fields that overlapped and were redundant, eg add := add and not toFun (though some other ones did creep in). If things broke (which was the case in a couple of cases), I did not push further and reverted.

It is possible that pushing harder and trying to remove all redundant overlaps will yield further improvements.

Diff
@@ -66,7 +66,6 @@ semigroup, if it admits an injective map that preserves `+` to an additive left
 protected def leftCancelSemigroup [LeftCancelSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : LeftCancelSemigroup M₁ :=
   { hf.semigroup f mul with
-    mul := (· * ·),
     mul_left_cancel := fun x y z H => hf <| (mul_right_inj (f x)).1 <| by erw [← mul, ← mul, H] }
 #align function.injective.left_cancel_semigroup Function.Injective.leftCancelSemigroup
 #align function.injective.add_left_cancel_semigroup Function.Injective.addLeftCancelSemigroup
@@ -79,7 +78,6 @@ semigroup."]
 protected def rightCancelSemigroup [RightCancelSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : RightCancelSemigroup M₁ :=
   { hf.semigroup f mul with
-    mul := (· * ·),
     mul_right_cancel := fun x y z H => hf <| (mul_left_inj (f y)).1 <| by erw [← mul, ← mul, H] }
 #align function.injective.right_cancel_semigroup Function.Injective.rightCancelSemigroup
 #align function.injective.add_right_cancel_semigroup Function.Injective.addRightCancelSemigroup
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
@@ -36,7 +36,7 @@ namespace Function
 
 namespace Injective
 
-variable {M₁ : Type _} {M₂ : Type _} [Mul M₁]
+variable {M₁ : Type*} {M₂ : Type*} [Mul M₁]
 
 /-- A type endowed with `*` is a semigroup, if it admits an injective map that preserves `*` to
 a semigroup. See note [reducible non-instances]. -/
@@ -206,7 +206,7 @@ which has an involutive inversion. See note [reducible non-instances] -/
 @[to_additive (attr := reducible)
 "A type has an involutive negation if it admits a surjective map that
 preserves `-` to a type which has an involutive negation."]
-protected def involutiveInv {M₁ : Type _} [Inv M₁] [InvolutiveInv M₂] (f : M₁ → M₂)
+protected def involutiveInv {M₁ : Type*} [Inv M₁] [InvolutiveInv M₂] (f : M₁ → M₂)
     (hf : Injective f) (inv : ∀ x, f x⁻¹ = (f x)⁻¹) : InvolutiveInv M₁ where
   inv := Inv.inv
   inv_inv x := hf <| by rw [inv, inv, inv_inv]
@@ -362,7 +362,7 @@ end Injective
 
 namespace Surjective
 
-variable {M₁ : Type _} {M₂ : Type _} [Mul M₂]
+variable {M₁ : Type*} {M₂ : Type*} [Mul M₂]
 
 /-- A type endowed with `*` is a semigroup, if it admits a surjective map that preserves `*` from a
 semigroup. See note [reducible non-instances]. -/
@@ -462,7 +462,7 @@ which has an involutive inversion. See note [reducible non-instances] -/
 @[to_additive (attr := reducible)
 "A type has an involutive negation if it admits a surjective map that
 preserves `-` to a type which has an involutive negation."]
-protected def involutiveInv {M₂ : Type _} [Inv M₂] [InvolutiveInv M₁] (f : M₁ → M₂)
+protected def involutiveInv {M₂ : Type*} [Inv M₂] [InvolutiveInv M₁] (f : M₁ → M₂)
     (hf : Surjective f) (inv : ∀ x, f x⁻¹ = (f x)⁻¹) : InvolutiveInv M₂ where
   inv := Inv.inv
   inv_inv := hf.forall.2 fun x => by erw [← inv, ← inv, inv_inv]
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,16 +2,13 @@
 Copyright (c) 2020 Johan Commelin. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin
-
-! This file was ported from Lean 3 source module algebra.group.inj_surj
-! leanprover-community/mathlib commit d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Group.Defs
 import Mathlib.Logic.Function.Basic
 import Mathlib.Data.Int.Cast.Basic
 
+#align_import algebra.group.inj_surj from "leanprover-community/mathlib"@"d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce"
+
 /-!
 # Lifting algebraic data classes along injective/surjective maps
 
feat(Algebra/Group/[Pi, InjSurj]): add missing boilerplate for InvOneClass and DivInvOneMonoid (#5904)
Diff
@@ -216,7 +216,19 @@ protected def involutiveInv {M₁ : Type _} [Inv M₁] [InvolutiveInv M₂] (f :
 #align function.injective.has_involutive_inv Function.Injective.involutiveInv
 #align function.injective.has_involutive_neg Function.Injective.involutiveNeg
 
-variable [Inv M₁] [Div M₁] [Pow M₁ ℤ]
+variable [Inv M₁]
+
+/-- A type endowed with `1` and `⁻¹` is a `InvOneClass`, if it admits an injective map that
+preserves `1` and `⁻¹` to a `InvOneClass`.  See note [reducible non-instances]. -/
+@[to_additive (attr := reducible)
+"A type endowed with `0` and unary `-` is an `NegZeroClass`, if it admits an
+injective map that preserves `0` and unary `-` to an `NegZeroClass`."]
+protected def invOneClass [InvOneClass M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
+    (inv : ∀ x, f (x⁻¹) = (f x)⁻¹) : InvOneClass M₁ :=
+  { ‹One M₁›, ‹Inv M₁› with
+    inv_one := hf <| by erw [inv, one, inv_one] }
+
+variable [Div M₁] [Pow M₁ ℤ]
 
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivInvMonoid` if it admits an injective map
 that preserves `1`, `*`, `⁻¹`, and `/` to a `DivInvMonoid`. See note [reducible non-instances]. -/
@@ -238,6 +250,20 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
 #align function.injective.div_inv_monoid Function.Injective.divInvMonoid
 #align function.injective.sub_neg_monoid Function.Injective.subNegMonoid
 
+/-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivInvOneMonoid` if it admits an injective
+map that preserves `1`, `*`, `⁻¹`, and `/` to a `DivInvOneMonoid`. See note
+[reducible non-instances]. -/
+@[to_additive (attr := reducible) subNegZeroMonoid
+"A type endowed with `0`, `+`, unary `-`, and binary `-` is a
+`SubNegZeroMonoid` if it admits an injective map that preserves `0`, `+`, unary `-`, and binary
+`-` to a `SubNegZeroMonoid`. This version takes custom `nsmul` and `zsmul` as `[SMul ℕ M₁]` and
+`[SMul ℤ M₁]` arguments."]
+protected def divInvOneMonoid [DivInvOneMonoid M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
+    (mul : ∀ x y, f (x * y) = f x * f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
+    (div : ∀ x y, f (x / y) = f x / f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n)
+    (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n) : DivInvOneMonoid M₁ :=
+  { hf.divInvMonoid f one mul inv div npow zpow, hf.invOneClass f one inv with }
+
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivisionMonoid` if it admits an injective map
 that preserves `1`, `*`, `⁻¹`, and `/` to a `DivisionMonoid`. See note [reducible non-instances] -/
 @[to_additive (attr := reducible) subtractionMonoid
feat: Missing transfer instances (#1725)

Match https://github.com/leanprover-community/mathlib/pull/18247

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin
 
 ! This file was ported from Lean 3 source module algebra.group.inj_surj
-! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! leanprover-community/mathlib commit d6fad0e5bf2d6f48da9175d25c3dc5706b3834ce
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -181,6 +181,17 @@ protected def commMonoid [CommMonoid M₂] (f : M₁ → M₂) (hf : Injective f
 #align function.injective.comm_monoid Function.Injective.commMonoid
 #align function.injective.add_comm_monoid Function.Injective.addCommMonoid
 
+/-- A type endowed with `0`, `1` and `+` is an additive commutative monoid with one, if it admits an
+injective map that preserves `0`, `1` and `+` to an additive commutative monoid with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def addCommMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [NatCast M₁]
+    [AddCommMonoidWithOne M₂] (f : M₁ → M₂) (hf : Injective f) (zero : f 0 = 0) (one : f 1 = 1)
+    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
+    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₁ :=
+  { hf.addMonoidWithOne f zero one add nsmul nat_cast, hf.addCommMonoid f zero add nsmul with }
+#align function.injective.add_comm_monoid_with_one Function.Injective.addCommMonoidWithOne
+
 /-- A type endowed with `1` and `*` is a cancel commutative monoid, if it admits an injective map
 that preserves `1` and `*` to a cancel commutative monoid.  See note [reducible non-instances]. -/
 @[to_additive (attr := reducible)
@@ -305,6 +316,20 @@ protected def commGroup [CommGroup M₂] (f : M₁ → M₂) (hf : Injective f)
 #align function.injective.comm_group Function.Injective.commGroup
 #align function.injective.add_comm_group Function.Injective.addCommGroup
 
+/-- A type endowed with `0`, `1` and `+` is an additive commutative group with one, if it admits an
+injective map that preserves `0`, `1` and `+` to an additive commutative group with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def addCommGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ M₁] [Neg M₁] [Sub M₁]
+    [SMul ℤ M₁] [NatCast M₁] [IntCast M₁] [AddCommGroupWithOne M₂] (f : M₁ → M₂) (hf : Injective f)
+    (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
+    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
+    (zsmul : ∀ (x) (n : ℤ), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
+    (int_cast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₁ :=
+  { hf.addGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
+    hf.addCommMonoid f zero add nsmul with }
+#align function.injective.add_comm_group_with_one Function.Injective.addCommGroupWithOne
+
 end Injective
 
 /-!
@@ -398,6 +423,17 @@ protected def commMonoid [CommMonoid M₁] (f : M₁ → M₂) (hf : Surjective
 #align function.surjective.comm_monoid Function.Surjective.commMonoid
 #align function.surjective.add_comm_monoid Function.Surjective.addCommMonoid
 
+/-- A type endowed with `0`, `1` and `+` is an additive monoid with one,
+if it admits a surjective map that preserves `0`, `1` and `*` from an additive monoid with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def addCommMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul ℕ M₂] [NatCast M₂]
+    [AddCommMonoidWithOne M₁] (f : M₁ → M₂) (hf : Surjective f) (zero : f 0 = 0) (one : f 1 = 1)
+    (add : ∀ x y, f (x + y) = f x + f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
+    (nat_cast : ∀ n : ℕ, f n = n) : AddCommMonoidWithOne M₂ :=
+  { hf.addMonoidWithOne f zero one add nsmul nat_cast, hf.addCommMonoid _ zero add nsmul with }
+#align function.surjective.add_comm_monoid_with_one Function.Surjective.addCommMonoidWithOne
+
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. See note [reducible non-instances] -/
 @[to_additive (attr := reducible)
@@ -452,6 +488,7 @@ protected def group [Group M₁] (f : M₁ → M₂) (hf : Surjective f) (one :
 /-- A type endowed with `0`, `1`, `+` is an additive group with one,
 if it admits a surjective map that preserves `0`, `1`, and `+` to an additive group with one.
 See note [reducible non-instances]. -/
+@[reducible]
 protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂] [Sub M₂] [SMul ℕ M₂]
     [SMul ℤ M₂] [NatCast M₂] [IntCast M₂] [AddGroupWithOne M₁] (f : M₁ → M₂) (hf : Surjective f)
     (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
@@ -480,6 +517,20 @@ protected def commGroup [CommGroup M₁] (f : M₁ → M₂) (hf : Surjective f)
 #align function.surjective.comm_group Function.Surjective.commGroup
 #align function.surjective.add_comm_group Function.Surjective.addCommGroup
 
+/-- A type endowed with `0`, `1`, `+` is an additive commutative group with one, if it admits a
+surjective map that preserves `0`, `1`, and `+` to an additive commutative group with one.
+See note [reducible non-instances]. -/
+@[reducible]
+protected def addCommGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂] [Sub M₂] [SMul ℕ M₂]
+    [SMul ℤ M₂] [NatCast M₂] [IntCast M₂] [AddCommGroupWithOne M₁] (f : M₁ → M₂) (hf : Surjective f)
+    (zero : f 0 = 0) (one : f 1 = 1) (add : ∀ x y, f (x + y) = f x + f y) (neg : ∀ x, f (-x) = -f x)
+    (sub : ∀ x y, f (x - y) = f x - f y) (nsmul : ∀ (x) (n : ℕ), f (n • x) = n • f x)
+    (zsmul : ∀ (x) (n : ℤ), f (n • x) = n • f x) (nat_cast : ∀ n : ℕ, f n = n)
+    (int_cast : ∀ n : ℤ, f n = n) : AddCommGroupWithOne M₂ :=
+  { hf.addGroupWithOne f zero one add neg sub nsmul zsmul nat_cast int_cast,
+    hf.addCommMonoid _ zero add nsmul with }
+#align function.surjective.add_comm_group_with_one Function.Surjective.addCommGroupWithOne
+
 end Surjective
 
 end Function
chore: add missing #align statements (#1902)

This PR is the result of a slight variant on the following "algorithm"

  • take all mathlib 3 names, remove _ and make all uppercase letters into lowercase
  • take all mathlib 4 names, remove _ and make all uppercase letters into lowercase
  • look for matches, and create pairs (original_lean3_name, OriginalLean4Name)
  • for pairs that do not have an align statement:
    • use Lean 4 to lookup the file + position of the Lean 4 name
    • add an #align statement just before the next empty line
  • manually fix some tiny mistakes (e.g., empty lines in proofs might cause the #align statement to have been inserted too early)
Diff
@@ -167,6 +167,7 @@ protected def cancelMonoid [CancelMonoid M₂] (f : M₁ → M₂) (hf : Injecti
     CancelMonoid M₁ :=
   { hf.leftCancelMonoid f one mul npow, hf.rightCancelMonoid f one mul npow with }
 #align function.injective.add_cancel_monoid Function.Injective.addCancelMonoid
+#align function.injective.cancel_monoid Function.Injective.cancelMonoid
 
 /-- A type endowed with `1` and `*` is a commutative monoid, if it admits an injective map that
 preserves `1` and `*` to a commutative monoid.  See note [reducible non-instances]. -/
feat: improve the way to_additive deals with attributes (#1314)
  • The new syntax for any attributes that need to be copied by to_additive is @[to_additive (attrs := simp, ext, simps)]
  • Adds the auxiliary declarations generated by the simp and simps attributes to the to_additive-dictionary.
  • Future issue: Does not yet translate auxiliary declarations for other attributes (including custom simp-attributes). In particular it's possible that norm_cast might generate some auxiliary declarations.
  • Fixes #950
  • Fixes #953
  • Fixes #1149
  • This moves the interaction between to_additive and simps from the Simps file to the toAdditive file for uniformity.
  • Make the same changes to @[reassoc]

Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -43,7 +43,7 @@ variable {M₁ : Type _} {M₂ : Type _} [Mul M₁]
 
 /-- A type endowed with `*` is a semigroup, if it admits an injective map that preserves `*` to
 a semigroup. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `+` is an additive semigroup, if it admits an
+@[to_additive (attr := reducible) "A type endowed with `+` is an additive semigroup, if it admits an
 injective map that preserves `+` to an additive semigroup."]
 protected def semigroup [Semigroup M₂] (f : M₁ → M₂) (hf : Injective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : Semigroup M₁ :=
@@ -53,7 +53,8 @@ protected def semigroup [Semigroup M₂] (f : M₁ → M₂) (hf : Injective f)
 
 /-- A type endowed with `*` is a commutative semigroup, if it admits an injective map that
 preserves `*` to a commutative semigroup.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `+` is an additive commutative semigroup,if it admits
+@[to_additive (attr := reducible)
+"A type endowed with `+` is an additive commutative semigroup,if it admits
 an injective map that preserves `+` to an additive commutative semigroup."]
 protected def commSemigroup [CommSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₁ :=
@@ -63,7 +64,7 @@ protected def commSemigroup [CommSemigroup M₂] (f : M₁ → M₂) (hf : Injec
 
 /-- A type endowed with `*` is a left cancel semigroup, if it admits an injective map that
 preserves `*` to a left cancel semigroup.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `+` is an additive left cancel
+@[to_additive (attr := reducible) "A type endowed with `+` is an additive left cancel
 semigroup, if it admits an injective map that preserves `+` to an additive left cancel semigroup."]
 protected def leftCancelSemigroup [LeftCancelSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : LeftCancelSemigroup M₁ :=
@@ -75,7 +76,7 @@ protected def leftCancelSemigroup [LeftCancelSemigroup M₂] (f : M₁ → M₂)
 
 /-- A type endowed with `*` is a right cancel semigroup, if it admits an injective map that
 preserves `*` to a right cancel semigroup.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `+` is an additive right
+@[to_additive (attr := reducible) "A type endowed with `+` is an additive right
 cancel semigroup, if it admits an injective map that preserves `+` to an additive right cancel
 semigroup."]
 protected def rightCancelSemigroup [RightCancelSemigroup M₂] (f : M₁ → M₂) (hf : Injective f)
@@ -90,7 +91,8 @@ variable [One M₁]
 
 /-- A type endowed with `1` and `*` is a `MulOneClass`, if it admits an injective map that
 preserves `1` and `*` to a `MulOneClass`.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an `AddZeroClass`, if it admits an
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an `AddZeroClass`, if it admits an
 injective map that preserves `0` and `+` to an `AddZeroClass`."]
 protected def mulOneClass [MulOneClass M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) : MulOneClass M₁ :=
@@ -104,7 +106,8 @@ variable [Pow M₁ ℕ]
 
 /-- A type endowed with `1` and `*` is a monoid, if it admits an injective map that preserves `1`
 and `*` to a monoid.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive monoid, if it admits an
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive monoid, if it admits an
 injective map that preserves `0` and `+` to an additive monoid. See note
 [reducible non-instances]."]
 protected def monoid [Monoid M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
@@ -132,7 +135,8 @@ protected def addMonoidWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul 
 
 /-- A type endowed with `1` and `*` is a left cancel monoid, if it admits an injective map that
 preserves `1` and `*` to a left cancel monoid. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive left cancel monoid, if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive left cancel monoid, if it
 admits an injective map that preserves `0` and `+` to an additive left cancel monoid."]
 protected def leftCancelMonoid [LeftCancelMonoid M₂] (f : M₁ → M₂) (hf : Injective f)
     (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y)
@@ -143,7 +147,8 @@ protected def leftCancelMonoid [LeftCancelMonoid M₂] (f : M₁ → M₂) (hf :
 
 /-- A type endowed with `1` and `*` is a right cancel monoid, if it admits an injective map that
 preserves `1` and `*` to a right cancel monoid. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive left cancel monoid,if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive left cancel monoid,if it
 admits an injective map that preserves `0` and `+` to an additive left cancel monoid."]
 protected def rightCancelMonoid [RightCancelMonoid M₂] (f : M₁ → M₂) (hf : Injective f)
     (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y)
@@ -154,7 +159,8 @@ protected def rightCancelMonoid [RightCancelMonoid M₂] (f : M₁ → M₂) (hf
 
 /-- A type endowed with `1` and `*` is a cancel monoid, if it admits an injective map that preserves
 `1` and `*` to a cancel monoid. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive left cancel monoid,if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive left cancel monoid,if it
 admits an injective map that preserves `0` and `+` to an additive left cancel monoid."]
 protected def cancelMonoid [CancelMonoid M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) :
@@ -164,7 +170,8 @@ protected def cancelMonoid [CancelMonoid M₂] (f : M₁ → M₂) (hf : Injecti
 
 /-- A type endowed with `1` and `*` is a commutative monoid, if it admits an injective map that
 preserves `1` and `*` to a commutative monoid.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive commutative monoid, if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive commutative monoid, if it
 admits an injective map that preserves `0` and `+` to an additive commutative monoid."]
 protected def commMonoid [CommMonoid M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) :
@@ -175,7 +182,8 @@ protected def commMonoid [CommMonoid M₂] (f : M₁ → M₂) (hf : Injective f
 
 /-- A type endowed with `1` and `*` is a cancel commutative monoid, if it admits an injective map
 that preserves `1` and `*` to a cancel commutative monoid.  See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive cancel commutative monoid,
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive cancel commutative monoid,
 if it admits an injective map that preserves `0` and `+` to an additive cancel commutative monoid."]
 protected def cancelCommMonoid [CancelCommMonoid M₂] (f : M₁ → M₂) (hf : Injective f)
     (one : f 1 = 1) (mul : ∀ x y, f (x * y) = f x * f y)
@@ -186,7 +194,8 @@ protected def cancelCommMonoid [CancelCommMonoid M₂] (f : M₁ → M₂) (hf :
 
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. See note [reducible non-instances] -/
-@[reducible, to_additive "A type has an involutive negation if it admits a surjective map that
+@[to_additive (attr := reducible)
+"A type has an involutive negation if it admits a surjective map that
 preserves `-` to a type which has an involutive negation."]
 protected def involutiveInv {M₁ : Type _} [Inv M₁] [InvolutiveInv M₂] (f : M₁ → M₂)
     (hf : Injective f) (inv : ∀ x, f x⁻¹ = (f x)⁻¹) : InvolutiveInv M₁ where
@@ -199,7 +208,8 @@ variable [Inv M₁] [Div M₁] [Pow M₁ ℤ]
 
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivInvMonoid` if it admits an injective map
 that preserves `1`, `*`, `⁻¹`, and `/` to a `DivInvMonoid`. See note [reducible non-instances]. -/
-@[reducible, to_additive subNegMonoid "A type endowed with `0`, `+`, unary `-`, and binary `-` is a
+@[to_additive (attr := reducible) subNegMonoid
+"A type endowed with `0`, `+`, unary `-`, and binary `-` is a
 `SubNegMonoid` if it admits an injective map that preserves `0`, `+`, unary `-`, and binary `-` to
 a `SubNegMonoid`. This version takes custom `nsmul` and `zsmul` as `[SMul ℕ M₁]` and `[SMul ℤ M₁]`
 arguments."]
@@ -218,7 +228,8 @@ protected def divInvMonoid [DivInvMonoid M₂] (f : M₁ → M₂) (hf : Injecti
 
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivisionMonoid` if it admits an injective map
 that preserves `1`, `*`, `⁻¹`, and `/` to a `DivisionMonoid`. See note [reducible non-instances] -/
-@[reducible, to_additive subtractionMonoid "A type endowed with `0`, `+`, unary `-`, and binary `-`
+@[to_additive (attr := reducible) subtractionMonoid
+"A type endowed with `0`, `+`, unary `-`, and binary `-`
 is a `SubtractionMonoid` if it admits an injective map that preserves `0`, `+`, unary `-`, and
 binary `-` to a `SubtractionMonoid`. This version takes custom `nsmul` and `zsmul` as `[SMul ℕ M₁]`
 and `[SMul ℤ M₁]` arguments."]
@@ -236,7 +247,8 @@ protected def divisionMonoid [DivisionMonoid M₂] (f : M₁ → M₂) (hf : Inj
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivisionCommMonoid` if it admits an
 injective map that preserves `1`, `*`, `⁻¹`, and `/` to a `DivisionCommMonoid`.
 See note [reducible non-instances]. -/
-@[reducible, to_additive subtractionCommMonoid "A type endowed with `0`, `+`, unary `-`, and binary
+@[to_additive (attr := reducible) subtractionCommMonoid
+"A type endowed with `0`, `+`, unary `-`, and binary
 `-` is a `SubtractionCommMonoid` if it admits an injective map that preserves `0`, `+`, unary `-`,
 and binary `-` to a `SubtractionCommMonoid`. This version takes custom `nsmul` and `zsmul` as
 `[SMul ℕ M₁]` and `[SMul ℤ M₁]` arguments."]
@@ -250,7 +262,8 @@ protected def divisionCommMonoid [DivisionCommMonoid M₂] (f : M₁ → M₂) (
 
 /-- A type endowed with `1`, `*` and `⁻¹` is a group, if it admits an injective map that preserves
 `1`, `*` and `⁻¹` to a group. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive group, if it admits an
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive group, if it admits an
 injective map that preserves `0` and `+` to an additive group."]
 protected def group [Group M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
@@ -280,7 +293,8 @@ protected def addGroupWithOne {M₁} [Zero M₁] [One M₁] [Add M₁] [SMul ℕ
 
 /-- A type endowed with `1`, `*` and `⁻¹` is a commutative group, if it admits an injective map that
 preserves `1`, `*` and `⁻¹` to a commutative group. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive commutative group, if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive commutative group, if it
 admits an injective map that preserves `0` and `+` to an additive commutative group."]
 protected def commGroup [CommGroup M₂] (f : M₁ → M₂) (hf : Injective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
@@ -303,7 +317,8 @@ variable {M₁ : Type _} {M₂ : Type _} [Mul M₂]
 
 /-- A type endowed with `*` is a semigroup, if it admits a surjective map that preserves `*` from a
 semigroup. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `+` is an additive semigroup, if it admits a
+@[to_additive (attr := reducible)
+"A type endowed with `+` is an additive semigroup, if it admits a
 surjective map that preserves `+` from an additive semigroup."]
 protected def semigroup [Semigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : Semigroup M₂ :=
@@ -313,7 +328,8 @@ protected def semigroup [Semigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
 
 /-- A type endowed with `*` is a commutative semigroup, if it admits a surjective map that preserves
 `*` from a commutative semigroup. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `+` is an additive commutative semigroup, if it admits
+@[to_additive (attr := reducible)
+"A type endowed with `+` is an additive commutative semigroup, if it admits
 a surjective map that preserves `+` from an additive commutative semigroup."]
 protected def commSemigroup [CommSemigroup M₁] (f : M₁ → M₂) (hf : Surjective f)
     (mul : ∀ x y, f (x * y) = f x * f y) : CommSemigroup M₂ :=
@@ -326,7 +342,8 @@ variable [One M₂]
 
 /-- A type endowed with `1` and `*` is a `MulOneClass`, if it admits a surjective map that preserves
 `1` and `*` from a `MulOneClass`. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an `AddZeroClass`, if it admits a
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an `AddZeroClass`, if it admits a
 surjective map that preserves `0` and `+` to an `AddZeroClass`."]
 protected def mulOneClass [MulOneClass M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) : MulOneClass M₂ :=
@@ -340,7 +357,8 @@ variable [Pow M₂ ℕ]
 
 /-- A type endowed with `1` and `*` is a monoid, if it admits a surjective map that preserves `1`
 and `*` to a monoid. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive monoid, if it admits a
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive monoid, if it admits a
 surjective map that preserves `0` and `+` to an additive monoid. This version takes a custom `nsmul`
 as a `[SMul ℕ M₂]` argument."]
 protected def monoid [Monoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
@@ -369,7 +387,8 @@ protected def addMonoidWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [SMul 
 
 /-- A type endowed with `1` and `*` is a commutative monoid, if it admits a surjective map that
 preserves `1` and `*` from a commutative monoid. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive commutative monoid, if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive commutative monoid, if it
 admits a surjective map that preserves `0` and `+` to an additive commutative monoid."]
 protected def commMonoid [CommMonoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) :
@@ -380,7 +399,8 @@ protected def commMonoid [CommMonoid M₁] (f : M₁ → M₂) (hf : Surjective
 
 /-- A type has an involutive inversion if it admits a surjective map that preserves `⁻¹` to a type
 which has an involutive inversion. See note [reducible non-instances] -/
-@[reducible, to_additive "A type has an involutive negation if it admits a surjective map that
+@[to_additive (attr := reducible)
+"A type has an involutive negation if it admits a surjective map that
 preserves `-` to a type which has an involutive negation."]
 protected def involutiveInv {M₂ : Type _} [Inv M₂] [InvolutiveInv M₁] (f : M₁ → M₂)
     (hf : Surjective f) (inv : ∀ x, f x⁻¹ = (f x)⁻¹) : InvolutiveInv M₂ where
@@ -393,7 +413,8 @@ variable [Inv M₂] [Div M₂] [Pow M₂ ℤ]
 
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a `DivInvMonoid` if it admits a surjective map
 that preserves `1`, `*`, `⁻¹`, and `/` to a `DivInvMonoid`. See note [reducible non-instances]. -/
-@[reducible, to_additive subNegMonoid "A type endowed with `0`, `+`, unary `-`, and binary `-` is a
+@[to_additive (attr := reducible) subNegMonoid
+"A type endowed with `0`, `+`, unary `-`, and binary `-` is a
 `SubNegMonoid` if it admits a surjective map that preserves `0`, `+`, unary `-`, and binary `-` to
 a `SubNegMonoid`."]
 protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
@@ -415,7 +436,8 @@ protected def divInvMonoid [DivInvMonoid M₁] (f : M₁ → M₂) (hf : Surject
 
 /-- A type endowed with `1`, `*` and `⁻¹` is a group, if it admits a surjective map that preserves
 `1`, `*` and `⁻¹` to a group. See note [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive group, if it admits a
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive group, if it admits a
 surjective map that preserves `0` and `+` to an additive group."]
 protected def group [Group M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
@@ -446,7 +468,8 @@ protected def addGroupWithOne {M₂} [Zero M₂] [One M₂] [Add M₂] [Neg M₂
 /-- A type endowed with `1`, `*`, `⁻¹`, and `/` is a commutative group, if it admits a surjective
 map that preserves `1`, `*`, `⁻¹`, and `/` from a commutative group. See note
 [reducible non-instances]. -/
-@[reducible, to_additive "A type endowed with `0` and `+` is an additive commutative group, if it
+@[to_additive (attr := reducible)
+"A type endowed with `0` and `+` is an additive commutative group, if it
 admits a surjective map that preserves `0` and `+` to an additive commutative group."]
 protected def commGroup [CommGroup M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
chore: fix casing per naming scheme (#1183)

Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2, add_monoid_hom --> AddMonoidHom

Remove \n from to_additive docstrings that were inserted by mathport.

Move files and directories with Gcd and Smul to GCD and SMul

Diff
@@ -342,7 +342,7 @@ variable [Pow M₂ ℕ]
 and `*` to a monoid. See note [reducible non-instances]. -/
 @[reducible, to_additive "A type endowed with `0` and `+` is an additive monoid, if it admits a
 surjective map that preserves `0` and `+` to an additive monoid. This version takes a custom `nsmul`
-as a `[has_smul ℕ M₂]` argument."]
+as a `[SMul ℕ M₂]` argument."]
 protected def monoid [Monoid M₁] (f : M₁ → M₂) (hf : Surjective f) (one : f 1 = 1)
     (mul : ∀ x y, f (x * y) = f x * f y) (npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) : Monoid M₂ :=
   { hf.semigroup f mul, hf.mulOneClass f one mul with
chore: add source headers to ported theory files (#1094)

The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md

Diff
@@ -2,6 +2,11 @@
 Copyright (c) 2020 Johan Commelin. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johan Commelin
+
+! This file was ported from Lean 3 source module algebra.group.inj_surj
+! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Group.Defs
 import Mathlib.Logic.Function.Basic

Dependencies 7

8 files ported (100.0%)
4240 lines ported (100.0%)

All dependencies are ported!