algebra.free_monoid.countMathlib.Algebra.FreeMonoid.Count

This file has been ported!

Changes since the initial port

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

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathbin.Algebra.FreeMonoid.Basic
-import Mathbin.Data.List.Count
+import Algebra.FreeMonoid.Basic
+import Data.List.Count
 
 #align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"f2f413b9d4be3a02840d0663dace76e8fe3da053"
 
Diff
@@ -26,29 +26,29 @@ variable {α : Type _} (p : α → Prop) [DecidablePred p]
 
 namespace FreeAddMonoid
 
-#print FreeAddMonoid.countp /-
+#print FreeAddMonoid.countP /-
 /-- `list.countp` as a bundled additive monoid homomorphism. -/
-def countp (p : α → Prop) [DecidablePred p] : FreeAddMonoid α →+ ℕ :=
-  ⟨List.countp p, List.countp_nil p, List.countp_append _⟩
-#align free_add_monoid.countp FreeAddMonoid.countp
+def countP (p : α → Prop) [DecidablePred p] : FreeAddMonoid α →+ ℕ :=
+  ⟨List.countP p, List.countP_nil p, List.countP_append _⟩
+#align free_add_monoid.countp FreeAddMonoid.countP
 -/
 
-#print FreeAddMonoid.countp_of /-
-theorem countp_of (x : α) : countp p (of x) = if p x then 1 else 0 :=
+#print FreeAddMonoid.countP_of /-
+theorem countP_of (x : α) : countP p (of x) = if p x then 1 else 0 :=
   rfl
-#align free_add_monoid.countp_of FreeAddMonoid.countp_of
+#align free_add_monoid.countp_of FreeAddMonoid.countP_of
 -/
 
-#print FreeAddMonoid.countp_apply /-
-theorem countp_apply (l : FreeAddMonoid α) : countp p l = List.countp p l :=
+#print FreeAddMonoid.countP_apply /-
+theorem countP_apply (l : FreeAddMonoid α) : countP p l = List.countP p l :=
   rfl
-#align free_add_monoid.countp_apply FreeAddMonoid.countp_apply
+#align free_add_monoid.countp_apply FreeAddMonoid.countP_apply
 -/
 
 #print FreeAddMonoid.count /-
 /-- `list.count` as a bundled additive monoid homomorphism. -/
 def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ :=
-  countp (Eq x)
+  countP (Eq x)
 #align free_add_monoid.count FreeAddMonoid.count
 -/
 
@@ -68,37 +68,37 @@ end FreeAddMonoid
 
 namespace FreeMonoid
 
-#print FreeMonoid.countp /-
+#print FreeMonoid.countP /-
 /-- `list.countp` as a bundled multiplicative monoid homomorphism. -/
-def countp (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicative ℕ :=
-  (FreeAddMonoid.countp p).toMultiplicative
-#align free_monoid.countp FreeMonoid.countp
+def countP (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicative ℕ :=
+  (FreeAddMonoid.countP p).toMultiplicative
+#align free_monoid.countp FreeMonoid.countP
 -/
 
-#print FreeMonoid.countp_of' /-
-theorem countp_of' (x : α) :
-    countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
+#print FreeMonoid.countP_of' /-
+theorem countP_of' (x : α) :
+    countP p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
   rfl
-#align free_monoid.countp_of' FreeMonoid.countp_of'
+#align free_monoid.countp_of' FreeMonoid.countP_of'
 -/
 
-#print FreeMonoid.countp_of /-
-theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
+#print FreeMonoid.countP_of /-
+theorem countP_of (x : α) : countP p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
-#align free_monoid.countp_of FreeMonoid.countp_of
+#align free_monoid.countp_of FreeMonoid.countP_of
 -/
 
-#print FreeMonoid.countp_apply /-
+#print FreeMonoid.countP_apply /-
 -- `rfl` is not transitive
-theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
+theorem countP_apply (l : FreeAddMonoid α) : countP p l = Multiplicative.ofAdd (List.countP p l) :=
   rfl
-#align free_monoid.countp_apply FreeMonoid.countp_apply
+#align free_monoid.countp_apply FreeMonoid.countP_apply
 -/
 
 #print FreeMonoid.count /-
 /-- `list.count` as a bundled additive monoid homomorphism. -/
 def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ :=
-  countp (Eq x)
+  countP (Eq x)
 #align free_monoid.count FreeMonoid.count
 -/
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module algebra.free_monoid.count
-! leanprover-community/mathlib commit f2f413b9d4be3a02840d0663dace76e8fe3da053
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.FreeMonoid.Basic
 import Mathbin.Data.List.Count
 
+#align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"f2f413b9d4be3a02840d0663dace76e8fe3da053"
+
 /-!
 # `list.count` as a bundled homomorphism
 
Diff
@@ -29,69 +29,95 @@ variable {α : Type _} (p : α → Prop) [DecidablePred p]
 
 namespace FreeAddMonoid
 
+#print FreeAddMonoid.countp /-
 /-- `list.countp` as a bundled additive monoid homomorphism. -/
 def countp (p : α → Prop) [DecidablePred p] : FreeAddMonoid α →+ ℕ :=
   ⟨List.countp p, List.countp_nil p, List.countp_append _⟩
 #align free_add_monoid.countp FreeAddMonoid.countp
+-/
 
+#print FreeAddMonoid.countp_of /-
 theorem countp_of (x : α) : countp p (of x) = if p x then 1 else 0 :=
   rfl
 #align free_add_monoid.countp_of FreeAddMonoid.countp_of
+-/
 
+#print FreeAddMonoid.countp_apply /-
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = List.countp p l :=
   rfl
 #align free_add_monoid.countp_apply FreeAddMonoid.countp_apply
+-/
 
+#print FreeAddMonoid.count /-
 /-- `list.count` as a bundled additive monoid homomorphism. -/
 def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ :=
   countp (Eq x)
 #align free_add_monoid.count FreeAddMonoid.count
+-/
 
+#print FreeAddMonoid.count_of /-
 theorem count_of [DecidableEq α] (x y : α) : count x (of y) = Pi.single x 1 y := by
   simp only [count, countp_of, Pi.single_apply, eq_comm]
 #align free_add_monoid.count_of FreeAddMonoid.count_of
+-/
 
+#print FreeAddMonoid.count_apply /-
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) : count x l = List.count x l :=
   rfl
 #align free_add_monoid.count_apply FreeAddMonoid.count_apply
+-/
 
 end FreeAddMonoid
 
 namespace FreeMonoid
 
+#print FreeMonoid.countp /-
 /-- `list.countp` as a bundled multiplicative monoid homomorphism. -/
 def countp (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicative ℕ :=
   (FreeAddMonoid.countp p).toMultiplicative
 #align free_monoid.countp FreeMonoid.countp
+-/
 
+#print FreeMonoid.countp_of' /-
 theorem countp_of' (x : α) :
     countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
   rfl
 #align free_monoid.countp_of' FreeMonoid.countp_of'
+-/
 
+#print FreeMonoid.countp_of /-
 theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
 #align free_monoid.countp_of FreeMonoid.countp_of
+-/
 
+#print FreeMonoid.countp_apply /-
 -- `rfl` is not transitive
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
   rfl
 #align free_monoid.countp_apply FreeMonoid.countp_apply
+-/
 
+#print FreeMonoid.count /-
 /-- `list.count` as a bundled additive monoid homomorphism. -/
 def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ :=
   countp (Eq x)
 #align free_monoid.count FreeMonoid.count
+-/
 
+#print FreeMonoid.count_apply /-
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
     count x l = Multiplicative.ofAdd (List.count x l) :=
   rfl
 #align free_monoid.count_apply FreeMonoid.count_apply
+-/
 
+#print FreeMonoid.count_of /-
 theorem count_of [DecidableEq α] (x y : α) :
     count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y :=
   by simp only [count, countp_of, Pi.mulSingle_apply, eq_comm]
 #align free_monoid.count_of FreeMonoid.count_of
+-/
 
 end FreeMonoid
 
Diff
@@ -29,64 +29,28 @@ variable {α : Type _} (p : α → Prop) [DecidablePred p]
 
 namespace FreeAddMonoid
 
-/- warning: free_add_monoid.countp -> FreeAddMonoid.countp is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_2 : DecidablePred.{succ u1} α p], AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_2 : DecidablePred.{succ u1} α p], AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)
-Case conversion may be inaccurate. Consider using '#align free_add_monoid.countp FreeAddMonoid.countpₓ'. -/
 /-- `list.countp` as a bundled additive monoid homomorphism. -/
 def countp (p : α → Prop) [DecidablePred p] : FreeAddMonoid α →+ ℕ :=
   ⟨List.countp p, List.countp_nil p, List.countp_append _⟩
 #align free_add_monoid.countp FreeAddMonoid.countp
 
-/- warning: free_add_monoid.countp_of -> FreeAddMonoid.countp_of is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeAddMonoid.of.{u1} α x)) (ite.{1} Nat (p x) (_inst_1 x) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeAddMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) (Eq.{1} Prop (p x) (Eq.{1} Bool Bool.true Bool.true)) (instDecidableEqProp (p x) (Eq.{1} Bool Bool.true Bool.true) (instDecidableIff (p x) (Eq.{1} Bool Bool.true Bool.true) (_inst_1 x) (instDecidableEqBool Bool.true Bool.true))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) 1 (instOfNatNat 1)) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) 0 (instOfNatNat 0)))
-Case conversion may be inaccurate. Consider using '#align free_add_monoid.countp_of FreeAddMonoid.countp_ofₓ'. -/
 theorem countp_of (x : α) : countp p (of x) = if p x then 1 else 0 :=
   rfl
 #align free_add_monoid.countp_of FreeAddMonoid.countp_of
 
-/- warning: free_add_monoid.countp_apply -> FreeAddMonoid.countp_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (List.countp.{u1} α p (fun (a : α) => _inst_1 a) l)
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l)
-Case conversion may be inaccurate. Consider using '#align free_add_monoid.countp_apply FreeAddMonoid.countp_applyₓ'. -/
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = List.countp p l :=
   rfl
 #align free_add_monoid.countp_apply FreeAddMonoid.countp_apply
 
-/- warning: free_add_monoid.count -> FreeAddMonoid.count is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α], α -> (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α], α -> (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))
-Case conversion may be inaccurate. Consider using '#align free_add_monoid.count FreeAddMonoid.countₓ'. -/
 /-- `list.count` as a bundled additive monoid homomorphism. -/
 def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ :=
   countp (Eq x)
 #align free_add_monoid.count FreeAddMonoid.count
 
-/- warning: free_add_monoid.count_of -> FreeAddMonoid.count_of is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeAddMonoid.of.{u1} α y)) (Pi.single.{u1, 0} α (fun (y : α) => Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Nat.hasZero) x (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) y)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeAddMonoid.of.{u1} α y)) (Pi.single.{u1, 0} α (fun (y : α) => Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) x (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) y)
-Case conversion may be inaccurate. Consider using '#align free_add_monoid.count_of FreeAddMonoid.count_ofₓ'. -/
 theorem count_of [DecidableEq α] (x y : α) : count x (of y) = Pi.single x 1 y := by
   simp only [count, countp_of, Pi.single_apply, eq_comm]
 #align free_add_monoid.count_of FreeAddMonoid.count_of
 
-/- warning: free_add_monoid.count_apply -> FreeAddMonoid.count_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x l)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l)
-Case conversion may be inaccurate. Consider using '#align free_add_monoid.count_apply FreeAddMonoid.count_applyₓ'. -/
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) : count x l = List.count x l :=
   rfl
 #align free_add_monoid.count_apply FreeAddMonoid.count_apply
@@ -95,77 +59,35 @@ end FreeAddMonoid
 
 namespace FreeMonoid
 
-/- warning: free_monoid.countp -> FreeMonoid.countp is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_2 : DecidablePred.{succ u1} α p], MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_2 : DecidablePred.{succ u1} α p], MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))
-Case conversion may be inaccurate. Consider using '#align free_monoid.countp FreeMonoid.countpₓ'. -/
 /-- `list.countp` as a bundled multiplicative monoid homomorphism. -/
 def countp (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicative ℕ :=
   (FreeAddMonoid.countp p).toMultiplicative
 #align free_monoid.countp FreeMonoid.countp
 
-/- warning: free_monoid.countp_of' -> FreeMonoid.countp_of' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
-Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of' FreeMonoid.countp_of'ₓ'. -/
 theorem countp_of' (x : α) :
     countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
   rfl
 #align free_monoid.countp_of' FreeMonoid.countp_of'
 
-/- warning: free_monoid.countp_of -> FreeMonoid.countp_of is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{0} (Multiplicative.{0} Nat) 1 (OfNat.mk.{0} (Multiplicative.{0} Nat) 1 (One.one.{0} (Multiplicative.{0} Nat) (Multiplicative.hasOne.{0} Nat Nat.hasZero)))))
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
-Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of FreeMonoid.countp_ofₓ'. -/
 theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
 #align free_monoid.countp_of FreeMonoid.countp_of
 
-/- warning: free_monoid.countp_apply -> FreeMonoid.countp_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α p (fun (a : α) => _inst_1 a) l))
-but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
-Case conversion may be inaccurate. Consider using '#align free_monoid.countp_apply FreeMonoid.countp_applyₓ'. -/
 -- `rfl` is not transitive
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
   rfl
 #align free_monoid.countp_apply FreeMonoid.countp_apply
 
-/- warning: free_monoid.count -> FreeMonoid.count is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α], α -> (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α], α -> (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))
-Case conversion may be inaccurate. Consider using '#align free_monoid.count FreeMonoid.countₓ'. -/
 /-- `list.count` as a bundled additive monoid homomorphism. -/
 def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ :=
   countp (Eq x)
 #align free_monoid.count FreeMonoid.count
 
-/- warning: free_monoid.count_apply -> FreeMonoid.count_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x l))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
-Case conversion may be inaccurate. Consider using '#align free_monoid.count_apply FreeMonoid.count_applyₓ'. -/
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
     count x l = Multiplicative.ofAdd (List.count x l) :=
   rfl
 #align free_monoid.count_apply FreeMonoid.count_apply
 
-/- warning: free_monoid.count_of -> FreeMonoid.count_of is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Multiplicative.hasOne.{0} Nat Nat.hasZero) x (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) y)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
-Case conversion may be inaccurate. Consider using '#align free_monoid.count_of FreeMonoid.count_ofₓ'. -/
 theorem count_of [DecidableEq α] (x y : α) :
     count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y :=
   by simp only [count, countp_of, Pi.mulSingle_apply, eq_comm]
Diff
@@ -110,7 +110,7 @@ def countp (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicati
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of' FreeMonoid.countp_of'ₓ'. -/
 theorem countp_of' (x : α) :
     countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
@@ -121,7 +121,7 @@ theorem countp_of' (x : α) :
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{0} (Multiplicative.{0} Nat) 1 (OfNat.mk.{0} (Multiplicative.{0} Nat) 1 (One.one.{0} (Multiplicative.{0} Nat) (Multiplicative.hasOne.{0} Nat Nat.hasZero)))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of FreeMonoid.countp_ofₓ'. -/
 theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
@@ -131,7 +131,7 @@ theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α p (fun (a : α) => _inst_1 a) l))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_apply FreeMonoid.countp_applyₓ'. -/
 -- `rfl` is not transitive
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
@@ -153,7 +153,7 @@ def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x l))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
 Case conversion may be inaccurate. Consider using '#align free_monoid.count_apply FreeMonoid.count_applyₓ'. -/
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
     count x l = Multiplicative.ofAdd (List.count x l) :=
@@ -164,7 +164,7 @@ theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Multiplicative.hasOne.{0} Nat Nat.hasZero) x (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) y)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
 Case conversion may be inaccurate. Consider using '#align free_monoid.count_of FreeMonoid.count_ofₓ'. -/
 theorem count_of [DecidableEq α] (x y : α) :
     count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y :=
Diff
@@ -44,7 +44,7 @@ def countp (p : α → Prop) [DecidablePred p] : FreeAddMonoid α →+ ℕ :=
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeAddMonoid.of.{u1} α x)) (ite.{1} Nat (p x) (_inst_1 x) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeAddMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) (Eq.{1} Prop (p x) (Eq.{1} Bool Bool.true Bool.true)) (instDecidableEqProp (p x) (Eq.{1} Bool Bool.true Bool.true) (instDecidableIff (p x) (Eq.{1} Bool Bool.true Bool.true) (_inst_1 x) (instDecidableEqBool Bool.true Bool.true))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) 1 (instOfNatNat 1)) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) 0 (instOfNatNat 0)))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeAddMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) (Eq.{1} Prop (p x) (Eq.{1} Bool Bool.true Bool.true)) (instDecidableEqProp (p x) (Eq.{1} Bool Bool.true Bool.true) (instDecidableIff (p x) (Eq.{1} Bool Bool.true Bool.true) (_inst_1 x) (instDecidableEqBool Bool.true Bool.true))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) 1 (instOfNatNat 1)) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α x)) 0 (instOfNatNat 0)))
 Case conversion may be inaccurate. Consider using '#align free_add_monoid.countp_of FreeAddMonoid.countp_ofₓ'. -/
 theorem countp_of (x : α) : countp p (of x) = if p x then 1 else 0 :=
   rfl
@@ -54,7 +54,7 @@ theorem countp_of (x : α) : countp p (of x) = if p x then 1 else 0 :=
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (List.countp.{u1} α p (fun (a : α) => _inst_1 a) l)
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l)
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l)
 Case conversion may be inaccurate. Consider using '#align free_add_monoid.countp_apply FreeAddMonoid.countp_applyₓ'. -/
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = List.countp p l :=
   rfl
@@ -75,7 +75,7 @@ def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeAddMonoid.of.{u1} α y)) (Pi.single.{u1, 0} α (fun (y : α) => Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Nat.hasZero) x (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) y)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeAddMonoid.of.{u1} α y)) (Pi.single.{u1, 0} α (fun (y : α) => Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) x (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) y)
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) (FreeAddMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeAddMonoid.of.{u1} α y)) (Pi.single.{u1, 0} α (fun (y : α) => Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) x (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) y)
 Case conversion may be inaccurate. Consider using '#align free_add_monoid.count_of FreeAddMonoid.count_ofₓ'. -/
 theorem count_of [DecidableEq α] (x y : α) : count x (of y) = Pi.single x 1 y := by
   simp only [count, countp_of, Pi.single_apply, eq_comm]
@@ -85,7 +85,7 @@ theorem count_of [DecidableEq α] (x y : α) : count x (of y) = Pi.single x 1 y
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (FreeAddMonoid.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.cancelAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x l)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.398 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l)
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) (fun (_x : FreeAddMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : FreeAddMonoid.{u1} α) => Nat) _x) (AddHomClass.toFunLike.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddZeroClass.toAdd.{u1} (FreeAddMonoid.{u1} α) (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α))))) (AddZeroClass.toAdd.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (AddMonoidHomClass.toAddHomClass.{u1, u1, 0} (AddMonoidHom.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid) (AddMonoidHom.addMonoidHomClass.{u1, 0} (FreeAddMonoid.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (FreeAddMonoid.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (FreeAddMonoid.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (FreeAddMonoid.{u1} α) (FreeAddMonoid.instAddCancelMonoidFreeAddMonoid.{u1} α)))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)))) (FreeAddMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l)
 Case conversion may be inaccurate. Consider using '#align free_add_monoid.count_apply FreeAddMonoid.count_applyₓ'. -/
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) : count x l = List.count x l :=
   rfl
@@ -110,7 +110,7 @@ def countp (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicati
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of' FreeMonoid.countp_of'ₓ'. -/
 theorem countp_of' (x : α) :
     countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
@@ -121,7 +121,7 @@ theorem countp_of' (x : α) :
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{0} (Multiplicative.{0} Nat) 1 (OfNat.mk.{0} (Multiplicative.{0} Nat) 1 (One.one.{0} (Multiplicative.{0} Nat) (Multiplicative.hasOne.{0} Nat Nat.hasZero)))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of FreeMonoid.countp_ofₓ'. -/
 theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
@@ -131,7 +131,7 @@ theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α p (fun (a : α) => _inst_1 a) l))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_apply FreeMonoid.countp_applyₓ'. -/
 -- `rfl` is not transitive
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
@@ -153,7 +153,7 @@ def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x l))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
 Case conversion may be inaccurate. Consider using '#align free_monoid.count_apply FreeMonoid.count_applyₓ'. -/
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
     count x l = Multiplicative.ofAdd (List.count x l) :=
@@ -164,7 +164,7 @@ theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Multiplicative.hasOne.{0} Nat Nat.hasZero) x (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) y)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
 Case conversion may be inaccurate. Consider using '#align free_monoid.count_of FreeMonoid.count_ofₓ'. -/
 theorem count_of [DecidableEq α] (x y : α) :
     count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y :=
Diff
@@ -110,7 +110,7 @@ def countp (p : α → Prop) [DecidablePred p] : FreeMonoid α →* Multiplicati
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of' FreeMonoid.countp_of'ₓ'. -/
 theorem countp_of' (x : α) :
     countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 :=
@@ -121,7 +121,7 @@ theorem countp_of' (x : α) :
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} (Multiplicative.{0} Nat) (p x) (_inst_1 x) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{0} (Multiplicative.{0} Nat) 1 (OfNat.mk.{0} (Multiplicative.{0} Nat) 1 (One.one.{0} (Multiplicative.{0} Nat) (Multiplicative.hasOne.{0} Nat Nat.hasZero)))))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (x : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α x)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) (FreeMonoid.of.{u1} α x)) (ite.{1} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (p x) (_inst_1 x) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (OfNat.ofNat.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) 1 (One.toOfNat1.{0} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) (instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)))))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_of FreeMonoid.countp_ofₓ'. -/
 theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
@@ -131,7 +131,7 @@ theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd
 lean 3 declaration is
   forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α p (fun (a : α) => _inst_1 a) l))
 but is expected to have type
-  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
+  forall {α : Type.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{succ u1} α p] (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.countp.{u1} α p (fun (a : α) => _inst_1 a)) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.countp.{u1} α (fun (a : α) => Decidable.decide (p a) ((fun (a : α) => _inst_1 a) a)) l))
 Case conversion may be inaccurate. Consider using '#align free_monoid.countp_apply FreeMonoid.countp_applyₓ'. -/
 -- `rfl` is not transitive
 theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
@@ -153,7 +153,7 @@ def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ :=
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x l))
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (l : FreeAddMonoid.{u1} α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) l) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) l) (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (List.count.{u1} α (instBEq.{u1} α (fun (a : α) (b : α) => _inst_2 a b)) x l))
 Case conversion may be inaccurate. Consider using '#align free_monoid.count_apply FreeMonoid.count_applyₓ'. -/
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
     count x l = Multiplicative.ofAdd (List.count x l) :=
@@ -164,7 +164,7 @@ theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
 lean 3 declaration is
   forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} (Multiplicative.{0} Nat) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (fun (_x : MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) => (FreeMonoid.{u1} α) -> (Multiplicative.{0} Nat)) (MonoidHom.hasCoeToFun.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => Multiplicative.hasOne.{0} Nat Nat.hasZero) x (coeFn.{1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) (fun (_x : Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) => Nat -> (Multiplicative.{0} Nat)) (Equiv.hasCoeToFun.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))) y)
 but is expected to have type
-  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2398 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
+  forall {α : Type.{u1}} [_inst_2 : DecidableEq.{succ u1} α] (x : α) (y : α), Eq.{1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) (FreeMonoid.of.{u1} α y)) (FunLike.coe.{succ u1, succ u1, 1} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2372 : FreeMonoid.{u1} α) => Multiplicative.{0} Nat) _x) (MulHomClass.toFunLike.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (MulOneClass.toMul.{0} (Multiplicative.{0} Nat) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (MonoidHomClass.toMulHomClass.{u1, u1, 0} (MonoidHom.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))) (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (MonoidHom.monoidHomClass.{u1, 0} (FreeMonoid.{u1} α) (Multiplicative.{0} Nat) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Multiplicative.mulOneClass.{0} Nat (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid))))) (FreeMonoid.count.{u1} α (fun (a : α) (b : α) => _inst_2 a b) x) (FreeMonoid.of.{u1} α y)) (Pi.mulSingle.{u1, 0} α (fun (_x : α) => Multiplicative.{0} Nat) (fun (a : α) (b : α) => _inst_2 a b) (fun (i : α) => instOneMultiplicative.{0} Nat (LinearOrderedCommMonoidWithZero.toZero.{0} Nat Nat.linearOrderedCommMonoidWithZero)) x (FunLike.coe.{1, 1, 1} (Equiv.{1, 1} Nat (Multiplicative.{0} Nat)) Nat (fun (_x : Nat) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : Nat) => Multiplicative.{0} Nat) _x) (Equiv.instFunLikeEquiv.{1, 1} Nat (Multiplicative.{0} Nat)) (Multiplicative.ofAdd.{0} Nat) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))) y)
 Case conversion may be inaccurate. Consider using '#align free_monoid.count_of FreeMonoid.count_ofₓ'. -/
 theorem count_of [DecidableEq α] (x y : α) :
     count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y :=

Changes in mathlib4

mathlib3
mathlib4
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
 import Mathlib.Algebra.FreeMonoid.Basic
-import Mathlib.Data.List.Count
 
 #align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"a2d2e18906e2b62627646b5d5be856e6a642062f"
 
chore: bump Std (#6721)

This incorporates changes from https://github.com/leanprover-community/mathlib4/pull/6575

I have also renamed Multiset.countp to Multiset.countP for consistency.

Co-authored-by: James Gallichio <jamesgallicchio@gmail.com>

Co-authored-by: James <jamesgallicchio@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -11,8 +11,8 @@ import Mathlib.Data.List.Count
 /-!
 # `List.count` as a bundled homomorphism
 
-In this file we define `FreeMonoid.countp`, `FreeMonoid.count`, `FreeAddMonoid.countp`, and
-`FreeAddMonoid.count`. These are `List.countp` and `List.count` bundled as multiplicative and
+In this file we define `FreeMonoid.countP`, `FreeMonoid.count`, `FreeAddMonoid.countP`, and
+`FreeAddMonoid.count`. These are `List.countP` and `List.count` bundled as multiplicative and
 additive homomorphisms from `FreeMonoid` and `FreeAddMonoid`.
 
 We do not use `to_additive` because it can't map `Multiplicative ℕ` to `ℕ`.
@@ -22,27 +22,27 @@ variable {α : Type*} (p : α → Prop) [DecidablePred p]
 
 namespace FreeAddMonoid
 
-/-- `List.countp` as a bundled additive monoid homomorphism. -/
-def countp : FreeAddMonoid α →+ ℕ where
-  toFun := List.countp p
-  map_zero' := List.countp_nil _
-  map_add' := List.countp_append _
-#align free_add_monoid.countp FreeAddMonoid.countp
+/-- `List.countP` as a bundled additive monoid homomorphism. -/
+def countP : FreeAddMonoid α →+ ℕ where
+  toFun := List.countP p
+  map_zero' := List.countP_nil _
+  map_add' := List.countP_append _
+#align free_add_monoid.countp FreeAddMonoid.countP
 
-theorem countp_of (x : α) : countp p (of x) = if p x = true then 1 else 0 := by
-  simp [countp, List.countp, List.countp.go]
-#align free_add_monoid.countp_of FreeAddMonoid.countp_of
+theorem countP_of (x : α) : countP p (of x) = if p x = true then 1 else 0 := by
+  simp [countP, List.countP, List.countP.go]
+#align free_add_monoid.countp_of FreeAddMonoid.countP_of
 
-theorem countp_apply (l : FreeAddMonoid α) : countp p l = List.countp p l := rfl
-#align free_add_monoid.countp_apply FreeAddMonoid.countp_apply
+theorem countP_apply (l : FreeAddMonoid α) : countP p l = List.countP p l := rfl
+#align free_add_monoid.countp_apply FreeAddMonoid.countP_apply
 
 /-- `List.count` as a bundled additive monoid homomorphism. -/
 -- Porting note: was (x = ·)
-def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ := countp (· = x)
+def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ := countP (· = x)
 #align free_add_monoid.count FreeAddMonoid.count
 
 theorem count_of [DecidableEq α] (x y : α) : count x (of y) = (Pi.single x 1 : α → ℕ) y := by
-  simp [Pi.single, Function.update, count, countp, List.countp, List.countp.go,
+  simp [Pi.single, Function.update, count, countP, List.countP, List.countP.go,
     Bool.beq_eq_decide_eq]
 #align free_add_monoid.count_of FreeAddMonoid.count_of
 
@@ -54,28 +54,28 @@ end FreeAddMonoid
 
 namespace FreeMonoid
 
-/-- `List.countp` as a bundled multiplicative monoid homomorphism. -/
-def countp : FreeMonoid α →* Multiplicative ℕ :=
-    AddMonoidHom.toMultiplicative (FreeAddMonoid.countp p)
-#align free_monoid.countp FreeMonoid.countp
+/-- `List.countP` as a bundled multiplicative monoid homomorphism. -/
+def countP : FreeMonoid α →* Multiplicative ℕ :=
+    AddMonoidHom.toMultiplicative (FreeAddMonoid.countP p)
+#align free_monoid.countp FreeMonoid.countP
 
-theorem countp_of' (x : α) :
-    countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 := by
-    erw [FreeAddMonoid.countp_of]
+theorem countP_of' (x : α) :
+    countP p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 := by
+    erw [FreeAddMonoid.countP_of]
     simp only [eq_iff_iff, iff_true, ofAdd_zero]; rfl
-#align free_monoid.countp_of' FreeMonoid.countp_of'
+#align free_monoid.countp_of' FreeMonoid.countP_of'
 
-theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
-  rw [countp_of', ofAdd_zero]
-#align free_monoid.countp_of FreeMonoid.countp_of
+theorem countP_of (x : α) : countP p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
+  rw [countP_of', ofAdd_zero]
+#align free_monoid.countp_of FreeMonoid.countP_of
 
 -- `rfl` is not transitive
-theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd (List.countp p l) :=
+theorem countP_apply (l : FreeAddMonoid α) : countP p l = Multiplicative.ofAdd (List.countP p l) :=
   rfl
-#align free_monoid.countp_apply FreeMonoid.countp_apply
+#align free_monoid.countp_apply FreeMonoid.countP_apply
 
 /-- `List.count` as a bundled additive monoid homomorphism. -/
-def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ := countp (· = x)
+def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ := countP (· = x)
 #align free_monoid.count FreeMonoid.count
 
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
@@ -84,7 +84,7 @@ theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
 
 theorem count_of [DecidableEq α] (x y : α) :
     count x (of y) = @Pi.mulSingle α (fun _ => Multiplicative ℕ) _ _ x (Multiplicative.ofAdd 1) y :=
-  by simp [count, countp_of, Pi.mulSingle_apply, eq_comm, Bool.beq_eq_decide_eq]
+  by simp [count, countP_of, Pi.mulSingle_apply, eq_comm, Bool.beq_eq_decide_eq]
 #align free_monoid.count_of FreeMonoid.count_of
 
 end FreeMonoid
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
@@ -18,7 +18,7 @@ additive homomorphisms from `FreeMonoid` and `FreeAddMonoid`.
 We do not use `to_additive` because it can't map `Multiplicative ℕ` to `ℕ`.
 -/
 
-variable {α : Type _} (p : α → Prop) [DecidablePred p]
+variable {α : Type*} (p : α → Prop) [DecidablePred p]
 
 namespace FreeAddMonoid
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module algebra.free_monoid.count
-! leanprover-community/mathlib commit a2d2e18906e2b62627646b5d5be856e6a642062f
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.FreeMonoid.Basic
 import Mathlib.Data.List.Count
 
+#align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"a2d2e18906e2b62627646b5d5be856e6a642062f"
+
 /-!
 # `List.count` as a bundled homomorphism
 
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -32,7 +32,7 @@ def countp : FreeAddMonoid α →+ ℕ where
   map_add' := List.countp_append _
 #align free_add_monoid.countp FreeAddMonoid.countp
 
-theorem countp_of (x : α): countp p (of x) = if p x = true then 1 else 0 := by
+theorem countp_of (x : α) : countp p (of x) = if p x = true then 1 else 0 := by
   simp [countp, List.countp, List.countp.go]
 #align free_add_monoid.countp_of FreeAddMonoid.countp_of
 
chore: fix some names in comments (#3276)

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

Diff
@@ -57,7 +57,7 @@ end FreeAddMonoid
 
 namespace FreeMonoid
 
-/-- `list.countp` as a bundled multiplicative monoid homomorphism. -/
+/-- `List.countp` as a bundled multiplicative monoid homomorphism. -/
 def countp : FreeMonoid α →* Multiplicative ℕ :=
     AddMonoidHom.toMultiplicative (FreeAddMonoid.countp p)
 #align free_monoid.countp FreeMonoid.countp
chore: revert Multiset and Finset API to use Prop instead of Bool (#1652)

Co-authored-by: Reid Barton <rwbarton@gmail.com>

Diff
@@ -26,12 +26,10 @@ variable {α : Type _} (p : α → Prop) [DecidablePred p]
 namespace FreeAddMonoid
 
 /-- `List.countp` as a bundled additive monoid homomorphism. -/
--- Porting note: changed the type of `p : α → Prop` to `p : α → Bool` to match the
--- change in `List.countp`
-def countp (p : α → Bool): FreeAddMonoid α →+ ℕ where
+def countp : FreeAddMonoid α →+ ℕ where
   toFun := List.countp p
-  map_zero' := List.countp_nil p
-  map_add' := List.countp_append p
+  map_zero' := List.countp_nil _
+  map_add' := List.countp_append _
 #align free_add_monoid.countp FreeAddMonoid.countp
 
 theorem countp_of (x : α): countp p (of x) = if p x = true then 1 else 0 := by
@@ -42,9 +40,8 @@ theorem countp_apply (l : FreeAddMonoid α) : countp p l = List.countp p l := rf
 #align free_add_monoid.countp_apply FreeAddMonoid.countp_apply
 
 /-- `List.count` as a bundled additive monoid homomorphism. -/
--- Porting note: changed from `countp (Eq x)` to match the definition of `List.count` and thus
--- we can prove `count_apply` by `rfl`
-def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ := countp (· == x)
+-- Porting note: was (x = ·)
+def count [DecidableEq α] (x : α) : FreeAddMonoid α →+ ℕ := countp (· = x)
 #align free_add_monoid.count FreeAddMonoid.count
 
 theorem count_of [DecidableEq α] (x y : α) : count x (of y) = (Pi.single x 1 : α → ℕ) y := by
@@ -61,21 +58,17 @@ end FreeAddMonoid
 namespace FreeMonoid
 
 /-- `list.countp` as a bundled multiplicative monoid homomorphism. -/
--- Porting note: changed the type of `p : α → Prop` to `p : α → Bool` to match the
--- definition of `FreeAddMonoid.countp`
-def countp (p : α → Bool): FreeMonoid α →* Multiplicative ℕ :=
+def countp : FreeMonoid α →* Multiplicative ℕ :=
     AddMonoidHom.toMultiplicative (FreeAddMonoid.countp p)
 #align free_monoid.countp FreeMonoid.countp
 
--- Porting note: changed the type of `p : α → Prop` to `p : α → Bool` and `if` to `bif`
-theorem countp_of' (x : α) (p : α → Bool):
-    countp p (of x) = bif p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 := by
-    simp [countp]
-    exact AddMonoidHom.toMultiplicative_apply_apply (FreeAddMonoid.countp p) (of x)
+theorem countp_of' (x : α) :
+    countp p (of x) = if p x then Multiplicative.ofAdd 1 else Multiplicative.ofAdd 0 := by
+    erw [FreeAddMonoid.countp_of]
+    simp only [eq_iff_iff, iff_true, ofAdd_zero]; rfl
 #align free_monoid.countp_of' FreeMonoid.countp_of'
 
--- Porting note: changed `if` to `bif`
-theorem countp_of (x : α) : countp p (of x) = bif p x then Multiplicative.ofAdd 1 else 1 := by
+theorem countp_of (x : α) : countp p (of x) = if p x then Multiplicative.ofAdd 1 else 1 := by
   rw [countp_of', ofAdd_zero]
 #align free_monoid.countp_of FreeMonoid.countp_of
 
@@ -85,7 +78,7 @@ theorem countp_apply (l : FreeAddMonoid α) : countp p l = Multiplicative.ofAdd
 #align free_monoid.countp_apply FreeMonoid.countp_apply
 
 /-- `List.count` as a bundled additive monoid homomorphism. -/
-def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ := countp (· == x)
+def count [DecidableEq α] (x : α) : FreeMonoid α →* Multiplicative ℕ := countp (· = x)
 #align free_monoid.count FreeMonoid.count
 
 theorem count_apply [DecidableEq α] (x : α) (l : FreeAddMonoid α) :
feat port: Algebra.FreeMonoid.Count (#1483)

It necessary to use Bool instead of Prop to match the changes made in List.countp so I add to change some if to bif at a couple of places.

Co-authored-by: Johan Commelin <johan@commelin.net>

Dependencies 2 + 89

90 files ported (97.8%)
42106 lines ported (99.7%)
Show graph

The unported dependencies are