control.fold
⟷
Mathlib.Control.Fold
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.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(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)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -9,7 +9,7 @@ import Control.Traversable.Instances
import Control.Traversable.Lemmas
import CategoryTheory.Endomorphism
import CategoryTheory.Types
-import CategoryTheory.Category.Kleisli
+import CategoryTheory.Category.KleisliCat
#align_import control.fold from "leanprover-community/mathlib"@"25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e"
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,13 +3,13 @@ Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon, Sean Leather
-/
-import Mathbin.Algebra.Group.Opposite
-import Mathbin.Algebra.FreeMonoid.Basic
-import Mathbin.Control.Traversable.Instances
-import Mathbin.Control.Traversable.Lemmas
-import Mathbin.CategoryTheory.Endomorphism
-import Mathbin.CategoryTheory.Types
-import Mathbin.CategoryTheory.Category.Kleisli
+import Algebra.Group.Opposite
+import Algebra.FreeMonoid.Basic
+import Control.Traversable.Instances
+import Control.Traversable.Lemmas
+import CategoryTheory.Endomorphism
+import CategoryTheory.Types
+import CategoryTheory.Category.Kleisli
#align_import control.fold from "leanprover-community/mathlib"@"25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,11 +2,6 @@
Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon, Sean Leather
-
-! This file was ported from Lean 3 source module control.fold
-! leanprover-community/mathlib commit 25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.Group.Opposite
import Mathbin.Algebra.FreeMonoid.Basic
@@ -16,6 +11,8 @@ import Mathbin.CategoryTheory.Endomorphism
import Mathbin.CategoryTheory.Types
import Mathbin.CategoryTheory.Category.Kleisli
+#align_import control.fold from "leanprover-community/mathlib"@"25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e"
+
/-!
# List folds generalized to `traversable`
mathlib commit https://github.com/leanprover-community/mathlib/commit/5dc6092d09e5e489106865241986f7f2ad28d4c8
@@ -332,9 +332,9 @@ theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a :
variable (m : Type u → Type u) [Monad m] [LawfulMonad m]
-variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
+variable {t : Type u → Type u} [Traversable t] [LawfulTraversable t]
-open IsLawfulTraversable
+open LawfulTraversable
#print Traversable.foldMap_hom /-
theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
@@ -358,13 +358,13 @@ end ApplicativeTransformation
section Equalities
-open IsLawfulTraversable
+open LawfulTraversable
open List (cons)
variable {α β γ : Type u}
-variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
+variable {t : Type u → Type u} [Traversable t] [LawfulTraversable t]
#print Traversable.foldl.ofFreeMonoid_comp_of /-
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -131,6 +131,7 @@ def Foldl.get (x : Foldl α) : α → α :=
#align monoid.foldl.get Monoid.Foldl.get
-/
+#print Monoid.Foldl.ofFreeMonoid /-
@[simps]
def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β
where
@@ -139,6 +140,7 @@ def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl
map_mul' := by
intros <;> simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj] <;> rfl
#align monoid.foldl.of_free_monoid Monoid.Foldl.ofFreeMonoid
+-/
#print Monoid.Foldr /-
@[reducible]
@@ -159,6 +161,7 @@ def Foldr.get (x : Foldr α) : α → α :=
#align monoid.foldr.get Monoid.Foldr.get
-/
+#print Monoid.Foldr.ofFreeMonoid /-
@[simps]
def Foldr.ofFreeMonoid (f : α → β → β) : FreeMonoid α →* Monoid.Foldr β
where
@@ -166,6 +169,7 @@ def Foldr.ofFreeMonoid (f : α → β → β) : FreeMonoid α →* Monoid.Foldr
map_one' := rfl
map_mul' xs ys := funext fun z => List.foldr_append _ _ _ _
#align monoid.foldr.of_free_monoid Monoid.Foldr.ofFreeMonoid
+-/
#print Monoid.foldlM /-
@[reducible]
@@ -186,6 +190,7 @@ def foldlM.get (x : foldlM m α) : α → m α :=
#align monoid.mfoldl.get Monoid.foldlM.get
-/
+#print Monoid.foldlM.ofFreeMonoid /-
@[simps]
def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β
where
@@ -193,6 +198,7 @@ def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α
map_one' := rfl
map_mul' := by intros <;> apply unop_injective <;> ext <;> apply List.foldlM_append
#align monoid.mfoldl.of_free_monoid Monoid.foldlM.ofFreeMonoid
+-/
#print Monoid.foldrM /-
@[reducible]
@@ -213,6 +219,7 @@ def foldrM.get (x : foldrM m α) : α → m α :=
#align monoid.mfoldr.get Monoid.foldrM.get
-/
+#print Monoid.foldrM.ofFreeMonoid /-
@[simps]
def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β
where
@@ -220,6 +227,7 @@ def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α
map_one' := rfl
map_mul' := by intros <;> ext <;> apply List.foldrM_append
#align monoid.mfoldr.of_free_monoid Monoid.foldrM.ofFreeMonoid
+-/
end Monoid
@@ -308,15 +316,19 @@ def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation
#align traversable.map_fold Traversable.mapFold
-/
+#print Traversable.Free.map_eq_map /-
theorem Free.map_eq_map (f : α → β) (xs : List α) :
f <$> xs = (FreeMonoid.map f (FreeMonoid.ofList xs)).toList :=
rfl
#align traversable.free.map_eq_map Traversable.Free.map_eq_map
+-/
+#print Traversable.foldl.unop_ofFreeMonoid /-
theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a : β) :
unop (Foldl.ofFreeMonoid f xs) a = List.foldl f a xs.toList :=
rfl
#align traversable.foldl.unop_of_free_monoid Traversable.foldl.unop_ofFreeMonoid
+-/
variable (m : Type u → Type u) [Monad m] [LawfulMonad m]
@@ -324,6 +336,7 @@ variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
open IsLawfulTraversable
+#print Traversable.foldMap_hom /-
theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
f (foldMap g x) = foldMap (f ∘ g) x :=
calc
@@ -332,11 +345,14 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
_ = traverse ((mapFold f).app _ ∘ Const.mk' ∘ g) x := (naturality (mapFold f) _ _)
_ = foldMap (f ∘ g) x := rfl
#align traversable.fold_map_hom Traversable.foldMap_hom
+-/
+#print Traversable.foldMap_hom_free /-
theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
f (foldMap FreeMonoid.of x) = foldMap (f ∘ FreeMonoid.of) x :=
foldMap_hom f _ x
#align traversable.fold_map_hom_free Traversable.foldMap_hom_free
+-/
end ApplicativeTransformation
@@ -350,29 +366,37 @@ variable {α β γ : Type u}
variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
+#print Traversable.foldl.ofFreeMonoid_comp_of /-
@[simp]
theorem foldl.ofFreeMonoid_comp_of (f : α → β → α) :
Foldl.ofFreeMonoid f ∘ FreeMonoid.of = Foldl.mk ∘ flip f :=
rfl
#align traversable.foldl.of_free_monoid_comp_of Traversable.foldl.ofFreeMonoid_comp_of
+-/
+#print Traversable.foldr.ofFreeMonoid_comp_of /-
@[simp]
theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
Foldr.ofFreeMonoid f ∘ FreeMonoid.of = Foldr.mk ∘ f :=
rfl
#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_of
+-/
+#print Traversable.foldlm.ofFreeMonoid_comp_of /-
@[simp]
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by ext1 x;
simp [(· ∘ ·), mfoldl.of_free_monoid, mfoldl.mk, flip]; rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
+-/
+#print Traversable.foldrm.ofFreeMonoid_comp_of /-
@[simp]
theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by ext;
simp [(· ∘ ·), mfoldr.of_free_monoid, mfoldr.mk, flip]
#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_of
+-/
#print Traversable.toList_spec /-
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) :=
@@ -393,9 +417,11 @@ theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMon
#align traversable.to_list_spec Traversable.toList_spec
-/
+#print Traversable.foldMap_map /-
theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) :
foldMap g (f <$> xs) = foldMap (g ∘ f) xs := by simp only [fold_map, traverse_map]
#align traversable.fold_map_map Traversable.foldMap_map
+-/
#print Traversable.foldl_toList /-
theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) :
@@ -417,6 +443,7 @@ theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) :
#align traversable.foldr_to_list Traversable.foldr_toList
-/
+#print Traversable.toList_map /-
/-
-/
@@ -424,6 +451,7 @@ theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toLis
simp only [to_list_spec, free.map_eq_map, fold_map_hom, fold_map_map, FreeMonoid.ofList_toList,
FreeMonoid.map_of, (· ∘ ·)]
#align traversable.to_list_map Traversable.toList_map
+-/
#print Traversable.foldl_map /-
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -331,7 +331,6 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
_ = (mapFold f).app _ (traverse (Const.mk' ∘ g) x) := rfl
_ = traverse ((mapFold f).app _ ∘ Const.mk' ∘ g) x := (naturality (mapFold f) _ _)
_ = foldMap (f ∘ g) x := rfl
-
#align traversable.fold_map_hom Traversable.foldMap_hom
theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
@@ -391,7 +390,6 @@ theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMon
rw [fold_map_hom_free (foldl.of_free_monoid (flip <| @cons α))]
· simp only [to_list, foldl, List.reverse_inj, foldl.get, foldl.of_free_monoid_comp_of]
· infer_instance
-
#align traversable.to_list_spec Traversable.toList_spec
-/
@@ -483,7 +481,6 @@ theorem foldlm_toList {f : α → β → m α} {x : α} {xs : t β} :
simp only [mfoldl, to_list_spec, fold_map_hom_free (mfoldl.of_free_monoid f),
mfoldl.of_free_monoid_comp_of, mfoldl.get, FreeMonoid.ofList_toList]
_ = List.foldlM f x (toList xs) := by simp [mfoldl.of_free_monoid, unop_op, flip]
-
#align traversable.mfoldl_to_list Traversable.foldlm_toList
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -303,8 +303,8 @@ open Function hiding const
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β)
where
app x := f
- preserves_seq' := by intros ; simp only [f.map_mul, (· <*> ·)]
- preserves_pure' := by intros ; simp only [f.map_one, pure]
+ preserves_seq' := by intros; simp only [f.map_mul, (· <*> ·)]
+ preserves_pure' := by intros; simp only [f.map_one, pure]
#align traversable.map_fold Traversable.mapFold
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -131,12 +131,6 @@ def Foldl.get (x : Foldl α) : α → α :=
#align monoid.foldl.get Monoid.Foldl.get
-/
-/- warning: monoid.foldl.of_free_monoid -> Monoid.Foldl.ofFreeMonoid is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}}, (β -> α -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}}, (β -> α -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))))
-Case conversion may be inaccurate. Consider using '#align monoid.foldl.of_free_monoid Monoid.Foldl.ofFreeMonoidₓ'. -/
@[simps]
def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β
where
@@ -165,12 +159,6 @@ def Foldr.get (x : Foldr α) : α → α :=
#align monoid.foldr.get Monoid.Foldr.get
-/
-/- warning: monoid.foldr.of_free_monoid -> Monoid.Foldr.ofFreeMonoid is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}}, (α -> β -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldr.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}}, (α -> β -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldr.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))
-Case conversion may be inaccurate. Consider using '#align monoid.foldr.of_free_monoid Monoid.Foldr.ofFreeMonoidₓ'. -/
@[simps]
def Foldr.ofFreeMonoid (f : α → β → β) : FreeMonoid α →* Monoid.Foldr β
where
@@ -198,12 +186,6 @@ def foldlM.get (x : foldlM m α) : α → m α :=
#align monoid.mfoldl.get Monoid.foldlM.get
-/
-/- warning: monoid.mfoldl.of_free_monoid -> Monoid.foldlM.ofFreeMonoid is a dubious translation:
-lean 3 declaration is
- forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (β -> α -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldlM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)))))
-but is expected to have type
- forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (β -> α -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldlM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)))))
-Case conversion may be inaccurate. Consider using '#align monoid.mfoldl.of_free_monoid Monoid.foldlM.ofFreeMonoidₓ'. -/
@[simps]
def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β
where
@@ -231,12 +213,6 @@ def foldrM.get (x : foldrM m α) : α → m α :=
#align monoid.mfoldr.get Monoid.foldrM.get
-/
-/- warning: monoid.mfoldr.of_free_monoid -> Monoid.foldrM.ofFreeMonoid is a dubious translation:
-lean 3 declaration is
- forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (α -> β -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldrM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_1 β) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β))))
-but is expected to have type
- forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (α -> β -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldrM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_1 β) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β))))
-Case conversion may be inaccurate. Consider using '#align monoid.mfoldr.of_free_monoid Monoid.foldrM.ofFreeMonoidₓ'. -/
@[simps]
def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β
where
@@ -332,23 +308,11 @@ def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation
#align traversable.map_fold Traversable.mapFold
-/
-/- warning: traversable.free.map_eq_map -> Traversable.Free.map_eq_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} (fun {α : Type.{u1}} => List.{u1} α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => List.{u1} α) List.traversable.{u1}) α β f xs) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (fun (_x : Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) => (FreeMonoid.{u1} β) -> (List.{u1} β)) (Equiv.hasCoeToFun.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) => (FreeMonoid.{u1} α) -> (FreeMonoid.{u1} β)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) (FreeMonoid.map.{u1, u1} α β f) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) => (List.{u1} α) -> (FreeMonoid.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} List.{u1} List.instFunctorList.{u1} α β f xs) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : FreeMonoid.{u1} β) => List.{u1} β) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => FreeMonoid.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (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.{u1} (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))))) (FreeMonoid.map.{u1, u1} α β f) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (List.{u1} α) (fun (_x : List.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : List.{u1} α) => FreeMonoid.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
-Case conversion may be inaccurate. Consider using '#align traversable.free.map_eq_map Traversable.Free.map_eq_mapₓ'. -/
theorem Free.map_eq_map (f : α → β) (xs : List α) :
f <$> xs = (FreeMonoid.map f (FreeMonoid.ofList xs)).toList :=
rfl
#align traversable.free.map_eq_map Traversable.Free.map_eq_map
-/- warning: traversable.foldl.unop_of_free_monoid -> Traversable.foldl.unop_ofFreeMonoid is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) => (FreeMonoid.{u1} α) -> (Monoid.Foldl.{u1} β)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) => (FreeMonoid.{u1} α) -> (List.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Monoid.Foldl.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (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.{u1} (Monoid.Foldl.{u1} β) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : FreeMonoid.{u1} α) => List.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
-Case conversion may be inaccurate. Consider using '#align traversable.foldl.unop_of_free_monoid Traversable.foldl.unop_ofFreeMonoidₓ'. -/
theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a : β) :
unop (Foldl.ofFreeMonoid f xs) a = List.foldl f a xs.toList :=
rfl
@@ -360,12 +324,6 @@ variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
open IsLawfulTraversable
-/- warning: traversable.fold_map_hom -> Traversable.foldMap_hom is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (fun (_x : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) => α -> β) (MonoidHom.hasCoeToFun.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) f (Traversable.foldMap.{u1} (fun {γ : Type.{u1}} => t γ) _inst_3 γ α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} (fun {γ : Type.{u1}} => t γ) _inst_3 γ β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (fun (_x : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) => α -> β) (MonoidHom.hasCoeToFun.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) f) g) x)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : α) => β) (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} t _inst_3 γ β (Monoid.toOne.{u1} β _inst_6) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f) g) x)
-Case conversion may be inaccurate. Consider using '#align traversable.fold_map_hom Traversable.foldMap_homₓ'. -/
theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
f (foldMap g x) = foldMap (f ∘ g) x :=
calc
@@ -376,12 +334,6 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
#align traversable.fold_map_hom Traversable.foldMap_hom
-/- warning: traversable.fold_map_hom_free -> Traversable.foldMap_hom_free is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) => (FreeMonoid.{u1} α) -> β) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) f (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_3 α (FreeMonoid.{u1} α) (MulOneClass.toHasOne.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α))))) (MulOneClass.toHasMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_3 α β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) => (FreeMonoid.{u1} α) -> β) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) f) (FreeMonoid.of.{u1} α)) x)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => β) (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} t _inst_3 α β (Monoid.toOne.{u1} β _inst_5) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f) (FreeMonoid.of.{u1} α)) x)
-Case conversion may be inaccurate. Consider using '#align traversable.fold_map_hom_free Traversable.foldMap_hom_freeₓ'. -/
theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
f (foldMap FreeMonoid.of x) = foldMap (f ∘ FreeMonoid.of) x :=
foldMap_hom f _ x
@@ -399,45 +351,24 @@ variable {α β γ : Type u}
variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
-/- warning: traversable.foldl.of_free_monoid_comp_of -> Traversable.foldl.ofFreeMonoid_comp_of is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) => (FreeMonoid.{u1} β) -> (Monoid.Foldl.{u1} α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.Foldl.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (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.{u1} (Monoid.Foldl.{u1} α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
-Case conversion may be inaccurate. Consider using '#align traversable.foldl.of_free_monoid_comp_of Traversable.foldl.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldl.ofFreeMonoid_comp_of (f : α → β → α) :
Foldl.ofFreeMonoid f ∘ FreeMonoid.of = Foldl.mk ∘ flip f :=
rfl
#align traversable.foldl.of_free_monoid_comp_of Traversable.foldl.ofFreeMonoid_comp_of
-/- warning: traversable.foldr.of_free_monoid_comp_of -> Traversable.foldr.ofFreeMonoid_comp_of is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) => (FreeMonoid.{u1} β) -> (Monoid.Foldr.{u1} α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.Foldr.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (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.{u1} (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
-Case conversion may be inaccurate. Consider using '#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
Foldr.ofFreeMonoid f ∘ FreeMonoid.of = Foldr.mk ∘ f :=
rfl
#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_of
-/- warning: traversable.mfoldl.of_free_monoid_comp_of -> Traversable.foldlm.ofFreeMonoid_comp_of is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by ext1 x;
simp [(· ∘ ·), mfoldl.of_free_monoid, mfoldl.mk, flip]; rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
-/- warning: traversable.mfoldr.of_free_monoid_comp_of -> Traversable.foldrm.ofFreeMonoid_comp_of is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) => (FreeMonoid.{u1} β) -> (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) (Monoid.foldrM.ofFreeMonoid.{u1} (fun {α : Type.{u1}} => m α) _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.foldrM.mk.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) f)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.foldrM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))))) (Monoid.foldrM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.foldrM.mk.{u1} m _inst_3 α) f)
-Case conversion may be inaccurate. Consider using '#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by ext;
@@ -464,12 +395,6 @@ theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMon
#align traversable.to_list_spec Traversable.toList_spec
-/
-/- warning: traversable.fold_map_map -> Traversable.foldMap_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] [_inst_3 : Monoid.{u1} γ] (f : α -> β) (g : β -> γ) (xs : t α), Eq.{succ u1} γ (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_1 β γ (MulOneClass.toHasOne.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (MulOneClass.toHasMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) g (Functor.map.{u1, u1} (fun {α : Type.{u1}} => t α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => t α) _inst_1) α β f xs)) (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_1 α γ (MulOneClass.toHasOne.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (MulOneClass.toHasMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (Function.comp.{succ u1, succ u1, succ u1} α β γ g f) xs)
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] [_inst_3 : Monoid.{u1} γ] (f : α -> β) (g : β -> γ) (xs : t α), Eq.{succ u1} γ (Traversable.foldMap.{u1} t _inst_1 β γ (Monoid.toOne.{u1} γ _inst_3) (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) g (Functor.map.{u1, u1} t (Traversable.toFunctor.{u1} t _inst_1) α β f xs)) (Traversable.foldMap.{u1} t _inst_1 α γ (Monoid.toOne.{u1} γ _inst_3) (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (Function.comp.{succ u1, succ u1, succ u1} α β γ g f) xs)
-Case conversion may be inaccurate. Consider using '#align traversable.fold_map_map Traversable.foldMap_mapₓ'. -/
theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) :
foldMap g (f <$> xs) = foldMap (g ∘ f) xs := by simp only [fold_map, traverse_map]
#align traversable.fold_map_map Traversable.foldMap_map
@@ -494,12 +419,6 @@ theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) :
#align traversable.foldr_to_list Traversable.foldr_toList
-/
-/- warning: traversable.to_list_map -> Traversable.toList_map is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] (f : α -> β) (xs : t α), Eq.{succ u1} (List.{u1} β) (Traversable.toList.{u1} β (fun {α : Type.{u1}} => t α) _inst_1 (Functor.map.{u1, u1} (fun {α : Type.{u1}} => t α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => t α) _inst_1) α β f xs)) (Functor.map.{u1, u1} List.{u1} (Traversable.toFunctor.{u1} List.{u1} List.traversable.{u1}) α β f (Traversable.toList.{u1} α (fun {α : Type.{u1}} => t α) _inst_1 xs))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] (f : α -> β) (xs : t α), Eq.{succ u1} (List.{u1} β) (Traversable.toList.{u1} β t _inst_1 (Functor.map.{u1, u1} t (Traversable.toFunctor.{u1} t _inst_1) α β f xs)) (Functor.map.{u1, u1} List.{u1} List.instFunctorList.{u1} α β f (Traversable.toList.{u1} α t _inst_1 xs))
-Case conversion may be inaccurate. Consider using '#align traversable.to_list_map Traversable.toList_mapₓ'. -/
/-
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -327,12 +327,8 @@ open Function hiding const
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β)
where
app x := f
- preserves_seq' := by
- intros
- simp only [f.map_mul, (· <*> ·)]
- preserves_pure' := by
- intros
- simp only [f.map_one, pure]
+ preserves_seq' := by intros ; simp only [f.map_mul, (· <*> ·)]
+ preserves_pure' := by intros ; simp only [f.map_one, pure]
#align traversable.map_fold Traversable.mapFold
-/
@@ -432,11 +428,8 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
Case conversion may be inaccurate. Consider using '#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
- foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f :=
- by
- ext1 x
- simp [(· ∘ ·), mfoldl.of_free_monoid, mfoldl.mk, flip]
- rfl
+ foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by ext1 x;
+ simp [(· ∘ ·), mfoldl.of_free_monoid, mfoldl.mk, flip]; rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
/- warning: traversable.mfoldr.of_free_monoid_comp_of -> Traversable.foldrm.ofFreeMonoid_comp_of is a dubious translation:
@@ -447,9 +440,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
- foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f :=
- by
- ext
+ foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by ext;
simp [(· ∘ ·), mfoldr.of_free_monoid, mfoldr.mk, flip]
#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_of
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -428,10 +428,7 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_of
/- warning: traversable.mfoldl.of_free_monoid_comp_of -> Traversable.foldlm.ofFreeMonoid_comp_of is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) => (FreeMonoid.{u1} β) -> (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) (Monoid.foldlM.ofFreeMonoid.{u1} (fun {α : Type.{u1}} => m α) _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.foldlM.mk.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
-but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.foldlM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldlM.{u1} m _inst_3 α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))))) (Monoid.foldlM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.foldlM.mk.{u1} m _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
+<too large>
Case conversion may be inaccurate. Consider using '#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/95a87616d63b3cb49d3fe678d416fbe9c4217bf4
@@ -340,7 +340,7 @@ def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} (fun {α : Type.{u1}} => List.{u1} α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => List.{u1} α) List.traversable.{u1}) α β f xs) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (fun (_x : Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) => (FreeMonoid.{u1} β) -> (List.{u1} β)) (Equiv.hasCoeToFun.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) => (FreeMonoid.{u1} α) -> (FreeMonoid.{u1} β)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) (FreeMonoid.map.{u1, u1} α β f) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) => (List.{u1} α) -> (FreeMonoid.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} List.{u1} List.instFunctorList.{u1} α β f xs) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : FreeMonoid.{u1} β) => List.{u1} β) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => FreeMonoid.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (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.{u1} (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))))) (FreeMonoid.map.{u1, u1} α β f) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (List.{u1} α) (fun (_x : List.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : List.{u1} α) => FreeMonoid.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} List.{u1} List.instFunctorList.{u1} α β f xs) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : FreeMonoid.{u1} β) => List.{u1} β) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => FreeMonoid.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (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.{u1} (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))))) (FreeMonoid.map.{u1, u1} α β f) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (List.{u1} α) (fun (_x : List.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : List.{u1} α) => FreeMonoid.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
Case conversion may be inaccurate. Consider using '#align traversable.free.map_eq_map Traversable.Free.map_eq_mapₓ'. -/
theorem Free.map_eq_map (f : α → β) (xs : List α) :
f <$> xs = (FreeMonoid.map f (FreeMonoid.ofList xs)).toList :=
@@ -351,7 +351,7 @@ theorem Free.map_eq_map (f : α → β) (xs : List α) :
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) => (FreeMonoid.{u1} α) -> (Monoid.Foldl.{u1} β)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) => (FreeMonoid.{u1} α) -> (List.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Monoid.Foldl.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (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.{u1} (Monoid.Foldl.{u1} β) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : FreeMonoid.{u1} α) => List.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => Monoid.Foldl.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (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.{u1} (Monoid.Foldl.{u1} β) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : FreeMonoid.{u1} α) => List.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
Case conversion may be inaccurate. Consider using '#align traversable.foldl.unop_of_free_monoid Traversable.foldl.unop_ofFreeMonoidₓ'. -/
theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a : β) :
unop (Foldl.ofFreeMonoid f xs) a = List.foldl f a xs.toList :=
@@ -368,7 +368,7 @@ open IsLawfulTraversable
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (fun (_x : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) => α -> β) (MonoidHom.hasCoeToFun.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) f (Traversable.foldMap.{u1} (fun {γ : Type.{u1}} => t γ) _inst_3 γ α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} (fun {γ : Type.{u1}} => t γ) _inst_3 γ β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (fun (_x : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) => α -> β) (MonoidHom.hasCoeToFun.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) f) g) x)
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => β) (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} t _inst_3 γ β (Monoid.toOne.{u1} β _inst_6) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f) g) x)
+ forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : α) => β) (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} t _inst_3 γ β (Monoid.toOne.{u1} β _inst_6) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f) g) x)
Case conversion may be inaccurate. Consider using '#align traversable.fold_map_hom Traversable.foldMap_homₓ'. -/
theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
f (foldMap g x) = foldMap (f ∘ g) x :=
@@ -384,7 +384,7 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) => (FreeMonoid.{u1} α) -> β) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) f (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_3 α (FreeMonoid.{u1} α) (MulOneClass.toHasOne.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α))))) (MulOneClass.toHasMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_3 α β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) => (FreeMonoid.{u1} α) -> β) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) f) (FreeMonoid.of.{u1} α)) x)
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => β) (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} t _inst_3 α β (Monoid.toOne.{u1} β _inst_5) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f) (FreeMonoid.of.{u1} α)) x)
+ forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => β) (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} t _inst_3 α β (Monoid.toOne.{u1} β _inst_5) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f) (FreeMonoid.of.{u1} α)) x)
Case conversion may be inaccurate. Consider using '#align traversable.fold_map_hom_free Traversable.foldMap_hom_freeₓ'. -/
theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
f (foldMap FreeMonoid.of x) = foldMap (f ∘ FreeMonoid.of) x :=
@@ -407,7 +407,7 @@ variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) => (FreeMonoid.{u1} β) -> (Monoid.Foldl.{u1} α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.Foldl.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (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.{u1} (Monoid.Foldl.{u1} α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.Foldl.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (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.{u1} (Monoid.Foldl.{u1} α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
Case conversion may be inaccurate. Consider using '#align traversable.foldl.of_free_monoid_comp_of Traversable.foldl.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldl.ofFreeMonoid_comp_of (f : α → β → α) :
@@ -419,7 +419,7 @@ theorem foldl.ofFreeMonoid_comp_of (f : α → β → α) :
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) => (FreeMonoid.{u1} β) -> (Monoid.Foldr.{u1} α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.Foldr.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (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.{u1} (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.Foldr.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (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.{u1} (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
Case conversion may be inaccurate. Consider using '#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
@@ -431,7 +431,7 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) => (FreeMonoid.{u1} β) -> (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) (Monoid.foldlM.ofFreeMonoid.{u1} (fun {α : Type.{u1}} => m α) _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.foldlM.mk.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.foldlM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldlM.{u1} m _inst_3 α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))))) (Monoid.foldlM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.foldlM.mk.{u1} m _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
+ forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.foldlM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldlM.{u1} m _inst_3 α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))))) (Monoid.foldlM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.foldlM.mk.{u1} m _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
Case conversion may be inaccurate. Consider using '#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
@@ -446,7 +446,7 @@ theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β
lean 3 declaration is
forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) => (FreeMonoid.{u1} β) -> (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) (Monoid.foldrM.ofFreeMonoid.{u1} (fun {α : Type.{u1}} => m α) _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.foldrM.mk.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) f)
but is expected to have type
- forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.foldrM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))))) (Monoid.foldrM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.foldrM.mk.{u1} m _inst_3 α) f)
+ forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2397 : FreeMonoid.{u1} β) => Monoid.foldrM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))))) (Monoid.foldrM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.foldrM.mk.{u1} m _inst_3 α) f)
Case conversion may be inaccurate. Consider using '#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/039ef89bef6e58b32b62898dd48e9d1a4312bb65
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon, Sean Leather
! This file was ported from Lean 3 source module control.fold
-! leanprover-community/mathlib commit 364d871405dff5a56a5ba2a82eb21a9c1deaa8d7
+! leanprover-community/mathlib commit 25a9423c6b2c8626e91c688bfd6c1d0a986a3e6e
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -20,6 +20,9 @@ import Mathbin.CategoryTheory.Category.Kleisli
# List folds generalized to `traversable`
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
Informally, we can think of `foldl` as a special case of `traverse` where we do not care about the
reconstructed data structure and, in a state monad, we care about the final state.
mathlib commit https://github.com/leanprover-community/mathlib/commit/e05ead7993520a432bec94ac504842d90707ad63
@@ -69,6 +69,7 @@ variable {m : Type u → Type u} [Monad m]
variable {α β : Type u}
+#print Monoid.Foldl /-
/-- For a list, foldl f x [y₀,y₁] reduces as follows:
```
@@ -113,15 +114,26 @@ how the monoid of endofunctions define `foldl`.
def Foldl (α : Type u) : Type u :=
(End α)ᵐᵒᵖ
#align monoid.foldl Monoid.Foldl
+-/
+#print Monoid.Foldl.mk /-
def Foldl.mk (f : α → α) : Foldl α :=
op f
#align monoid.foldl.mk Monoid.Foldl.mk
+-/
+#print Monoid.Foldl.get /-
def Foldl.get (x : Foldl α) : α → α :=
unop x
#align monoid.foldl.get Monoid.Foldl.get
+-/
+/- warning: monoid.foldl.of_free_monoid -> Monoid.Foldl.ofFreeMonoid is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}}, (β -> α -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}}, (β -> α -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))))
+Case conversion may be inaccurate. Consider using '#align monoid.foldl.of_free_monoid Monoid.Foldl.ofFreeMonoidₓ'. -/
@[simps]
def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl β
where
@@ -131,19 +143,31 @@ def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl
intros <;> simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj] <;> rfl
#align monoid.foldl.of_free_monoid Monoid.Foldl.ofFreeMonoid
+#print Monoid.Foldr /-
@[reducible]
def Foldr (α : Type u) : Type u :=
End α
#align monoid.foldr Monoid.Foldr
+-/
+#print Monoid.Foldr.mk /-
def Foldr.mk (f : α → α) : Foldr α :=
f
#align monoid.foldr.mk Monoid.Foldr.mk
+-/
+#print Monoid.Foldr.get /-
def Foldr.get (x : Foldr α) : α → α :=
x
#align monoid.foldr.get Monoid.Foldr.get
+-/
+/- warning: monoid.foldr.of_free_monoid -> Monoid.Foldr.ofFreeMonoid is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}}, (α -> β -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldr.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}}, (α -> β -> β) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldr.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))
+Case conversion may be inaccurate. Consider using '#align monoid.foldr.of_free_monoid Monoid.Foldr.ofFreeMonoidₓ'. -/
@[simps]
def Foldr.ofFreeMonoid (f : α → β → β) : FreeMonoid α →* Monoid.Foldr β
where
@@ -152,47 +176,71 @@ def Foldr.ofFreeMonoid (f : α → β → β) : FreeMonoid α →* Monoid.Foldr
map_mul' xs ys := funext fun z => List.foldr_append _ _ _ _
#align monoid.foldr.of_free_monoid Monoid.Foldr.ofFreeMonoid
+#print Monoid.foldlM /-
@[reducible]
-def Mfoldl (m : Type u → Type u) [Monad m] (α : Type u) : Type u :=
+def foldlM (m : Type u → Type u) [Monad m] (α : Type u) : Type u :=
MulOpposite <| End <| KleisliCat.mk m α
-#align monoid.mfoldl Monoid.Mfoldl
+#align monoid.mfoldl Monoid.foldlM
+-/
-def Mfoldl.mk (f : α → m α) : Mfoldl m α :=
+#print Monoid.foldlM.mk /-
+def foldlM.mk (f : α → m α) : foldlM m α :=
op f
-#align monoid.mfoldl.mk Monoid.Mfoldl.mk
+#align monoid.mfoldl.mk Monoid.foldlM.mk
+-/
-def Mfoldl.get (x : Mfoldl m α) : α → m α :=
+#print Monoid.foldlM.get /-
+def foldlM.get (x : foldlM m α) : α → m α :=
unop x
-#align monoid.mfoldl.get Monoid.Mfoldl.get
+#align monoid.mfoldl.get Monoid.foldlM.get
+-/
+/- warning: monoid.mfoldl.of_free_monoid -> Monoid.foldlM.ofFreeMonoid is a dubious translation:
+lean 3 declaration is
+ forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (β -> α -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldlM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)))))
+but is expected to have type
+ forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (β -> α -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldlM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_1) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β)))))
+Case conversion may be inaccurate. Consider using '#align monoid.mfoldl.of_free_monoid Monoid.foldlM.ofFreeMonoidₓ'. -/
@[simps]
-def Mfoldl.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.Mfoldl m β
+def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β
where
toFun xs := op <| flip (List.foldlM f) xs.toList
map_one' := rfl
map_mul' := by intros <;> apply unop_injective <;> ext <;> apply List.foldlM_append
-#align monoid.mfoldl.of_free_monoid Monoid.Mfoldl.ofFreeMonoid
+#align monoid.mfoldl.of_free_monoid Monoid.foldlM.ofFreeMonoid
+#print Monoid.foldrM /-
@[reducible]
-def Mfoldr (m : Type u → Type u) [Monad m] (α : Type u) : Type u :=
+def foldrM (m : Type u → Type u) [Monad m] (α : Type u) : Type u :=
End <| KleisliCat.mk m α
-#align monoid.mfoldr Monoid.Mfoldr
+#align monoid.mfoldr Monoid.foldrM
+-/
-def Mfoldr.mk (f : α → m α) : Mfoldr m α :=
+#print Monoid.foldrM.mk /-
+def foldrM.mk (f : α → m α) : foldrM m α :=
f
-#align monoid.mfoldr.mk Monoid.Mfoldr.mk
+#align monoid.mfoldr.mk Monoid.foldrM.mk
+-/
-def Mfoldr.get (x : Mfoldr m α) : α → m α :=
+#print Monoid.foldrM.get /-
+def foldrM.get (x : foldrM m α) : α → m α :=
x
-#align monoid.mfoldr.get Monoid.Mfoldr.get
+#align monoid.mfoldr.get Monoid.foldrM.get
+-/
+/- warning: monoid.mfoldr.of_free_monoid -> Monoid.foldrM.ofFreeMonoid is a dubious translation:
+lean 3 declaration is
+ forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (α -> β -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldrM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_1 β) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β))))
+but is expected to have type
+ forall {m : Type.{u1} -> Type.{u1}} [_inst_1 : Monad.{u1, u1} m] {α : Type.{u1}} {β : Type.{u1}} [_inst_2 : LawfulMonad.{u1, u1} m _inst_1], (α -> β -> (m β)) -> (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.foldrM.{u1} m _inst_1 β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_1 β) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_1 _inst_2) (CategoryTheory.KleisliCat.mk.{u1, u1} m β))))
+Case conversion may be inaccurate. Consider using '#align monoid.mfoldr.of_free_monoid Monoid.foldrM.ofFreeMonoidₓ'. -/
@[simps]
-def Mfoldr.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.Mfoldr m β
+def foldrM.ofFreeMonoid [LawfulMonad m] (f : α → β → m β) : FreeMonoid α →* Monoid.foldrM m β
where
toFun xs := flip (List.foldrM f) xs.toList
map_one' := rfl
map_mul' := by intros <;> ext <;> apply List.foldrM_append
-#align monoid.mfoldr.of_free_monoid Monoid.Mfoldr.ofFreeMonoid
+#align monoid.mfoldr.of_free_monoid Monoid.foldrM.ofFreeMonoid
end Monoid
@@ -204,18 +252,25 @@ section Defs
variable {α β : Type u} {t : Type u → Type u} [Traversable t]
+#print Traversable.foldMap /-
def foldMap {α ω} [One ω] [Mul ω] (f : α → ω) : t α → ω :=
traverse (Const.mk' ∘ f)
#align traversable.fold_map Traversable.foldMap
+-/
+#print Traversable.foldl /-
def foldl (f : α → β → α) (x : α) (xs : t β) : α :=
(foldMap (Foldl.mk ∘ flip f) xs).get x
#align traversable.foldl Traversable.foldl
+-/
+#print Traversable.foldr /-
def foldr (f : α → β → β) (x : β) (xs : t α) : β :=
(foldMap (Foldr.mk ∘ f) xs).get x
#align traversable.foldr Traversable.foldr
+-/
+#print Traversable.toList /-
/-- Conceptually, `to_list` collects all the elements of a collection
in a list. This idea is formalized by
@@ -235,20 +290,27 @@ prevents each element of the traversable to be appended at the end
def toList : t α → List α :=
List.reverse ∘ foldl (flip List.cons) []
#align traversable.to_list Traversable.toList
+-/
+#print Traversable.length /-
def length (xs : t α) : ℕ :=
down <| foldl (fun l _ => up <| l.down + 1) (up 0) xs
#align traversable.length Traversable.length
+-/
variable {m : Type u → Type u} [Monad m]
-def mfoldl (f : α → β → m α) (x : α) (xs : t β) : m α :=
- (foldMap (Mfoldl.mk ∘ flip f) xs).get x
-#align traversable.mfoldl Traversable.mfoldl
+#print Traversable.foldlm /-
+def foldlm (f : α → β → m α) (x : α) (xs : t β) : m α :=
+ (foldMap (foldlM.mk ∘ flip f) xs).get x
+#align traversable.mfoldl Traversable.foldlm
+-/
-def mfoldr (f : α → β → m β) (x : β) (xs : t α) : m β :=
- (foldMap (Mfoldr.mk ∘ f) xs).get x
-#align traversable.mfoldr Traversable.mfoldr
+#print Traversable.foldrm /-
+def foldrm (f : α → β → m β) (x : β) (xs : t α) : m β :=
+ (foldMap (foldrM.mk ∘ f) xs).get x
+#align traversable.mfoldr Traversable.foldrm
+-/
end Defs
@@ -258,6 +320,7 @@ variable {α β γ : Type u}
open Function hiding const
+#print Traversable.mapFold /-
def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation (Const α) (Const β)
where
app x := f
@@ -268,12 +331,25 @@ def mapFold [Monoid α] [Monoid β] (f : α →* β) : ApplicativeTransformation
intros
simp only [f.map_one, pure]
#align traversable.map_fold Traversable.mapFold
+-/
+/- warning: traversable.free.map_eq_map -> Traversable.Free.map_eq_map is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} (fun {α : Type.{u1}} => List.{u1} α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => List.{u1} α) List.traversable.{u1}) α β f xs) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (fun (_x : Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) => (FreeMonoid.{u1} β) -> (List.{u1} β)) (Equiv.hasCoeToFun.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) => (FreeMonoid.{u1} α) -> (FreeMonoid.{u1} β)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β))))) (FreeMonoid.map.{u1, u1} α β f) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) => (List.{u1} α) -> (FreeMonoid.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β) (xs : List.{u1} α), Eq.{succ u1} (List.{u1} β) (Functor.map.{u1, u1} List.{u1} List.instFunctorList.{u1} α β f xs) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : FreeMonoid.{u1} β) => List.{u1} β) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} β) (List.{u1} β)) (FreeMonoid.toList.{u1} β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => FreeMonoid.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (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.{u1} (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))) (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (FreeMonoid.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β))))))) (FreeMonoid.map.{u1, u1} α β f) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (List.{u1} α) (fun (_x : List.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : List.{u1} α) => FreeMonoid.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (List.{u1} α) (FreeMonoid.{u1} α)) (FreeMonoid.ofList.{u1} α) xs)))
+Case conversion may be inaccurate. Consider using '#align traversable.free.map_eq_map Traversable.Free.map_eq_mapₓ'. -/
theorem Free.map_eq_map (f : α → β) (xs : List α) :
f <$> xs = (FreeMonoid.map f (FreeMonoid.ofList xs)).toList :=
rfl
#align traversable.free.map_eq_map Traversable.Free.map_eq_map
+/- warning: traversable.foldl.unop_of_free_monoid -> Traversable.foldl.unop_ofFreeMonoid is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) => (FreeMonoid.{u1} α) -> (Monoid.Foldl.{u1} β)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (fun (_x : Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) => (FreeMonoid.{u1} α) -> (List.{u1} α)) (Equiv.hasCoeToFun.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> β) (xs : FreeMonoid.{u1} α) (a : β), Eq.{succ u1} β (MulOpposite.unop.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => Monoid.Foldl.{u1} β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (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.{u1} (Monoid.Foldl.{u1} β) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))) (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) (Monoid.Foldl.{u1} β) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) β) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} β)))))) (Monoid.Foldl.ofFreeMonoid.{u1} α β f) xs) a) (List.foldl.{u1, u1} β α f a (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : FreeMonoid.{u1} α) => List.{u1} α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} (FreeMonoid.{u1} α) (List.{u1} α)) (FreeMonoid.toList.{u1} α) xs))
+Case conversion may be inaccurate. Consider using '#align traversable.foldl.unop_of_free_monoid Traversable.foldl.unop_ofFreeMonoidₓ'. -/
theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a : β) :
unop (Foldl.ofFreeMonoid f xs) a = List.foldl f a xs.toList :=
rfl
@@ -285,6 +361,12 @@ variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
open IsLawfulTraversable
+/- warning: traversable.fold_map_hom -> Traversable.foldMap_hom is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (fun (_x : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) => α -> β) (MonoidHom.hasCoeToFun.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) f (Traversable.foldMap.{u1} (fun {γ : Type.{u1}} => t γ) _inst_3 γ α (MulOneClass.toHasOne.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toHasMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} (fun {γ : Type.{u1}} => t γ) _inst_3 γ β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (fun (_x : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) => α -> β) (MonoidHom.hasCoeToFun.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) f) g) x)
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} α] [_inst_6 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) (g : γ -> α) (x : t γ), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => β) (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f (Traversable.foldMap.{u1} t _inst_3 γ α (Monoid.toOne.{u1} α _inst_5) (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) g x)) (Traversable.foldMap.{u1} t _inst_3 γ β (Monoid.toOne.{u1} β _inst_6) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (Function.comp.{succ u1, succ u1, succ u1} γ α β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (MulOneClass.toMul.{u1} α (Monoid.toMulOneClass.{u1} α _inst_5)) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_6)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)) α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6) (MonoidHom.monoidHomClass.{u1, u1} α β (Monoid.toMulOneClass.{u1} α _inst_5) (Monoid.toMulOneClass.{u1} β _inst_6)))) f) g) x)
+Case conversion may be inaccurate. Consider using '#align traversable.fold_map_hom Traversable.foldMap_homₓ'. -/
theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
f (foldMap g x) = foldMap (f ∘ g) x :=
calc
@@ -295,6 +377,12 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
#align traversable.fold_map_hom Traversable.foldMap_hom
+/- warning: traversable.fold_map_hom_free -> Traversable.foldMap_hom_free is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) => (FreeMonoid.{u1} α) -> β) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) f (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_3 α (FreeMonoid.{u1} α) (MulOneClass.toHasOne.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α))))) (MulOneClass.toHasMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_3 α β (MulOneClass.toHasOne.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MulOneClass.toHasMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) => (FreeMonoid.{u1} α) -> β) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.cancelMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) f) (FreeMonoid.of.{u1} α)) x)
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_3 : Traversable.{u1} t] [_inst_4 : IsLawfulTraversable.{u1} t _inst_3] [_inst_5 : Monoid.{u1} β] (f : MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (x : t α), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => β) (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f (Traversable.foldMap.{u1} t _inst_3 α (FreeMonoid.{u1} α) (RightCancelMonoid.toOne.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))) (MulOneClass.toMul.{u1} (FreeMonoid.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α))))) (FreeMonoid.of.{u1} α) x)) (Traversable.foldMap.{u1} t _inst_3 α β (Monoid.toOne.{u1} β _inst_5) (MulOneClass.toMul.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (Function.comp.{succ u1, succ u1, succ u1} α (FreeMonoid.{u1} α) β (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) (fun (_x : FreeMonoid.{u1} α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} α) => β) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (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.{u1} β (Monoid.toMulOneClass.{u1} β _inst_5)) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)) (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} α) β (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} α) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} α) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} α) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} α)))) (Monoid.toMulOneClass.{u1} β _inst_5)))) f) (FreeMonoid.of.{u1} α)) x)
+Case conversion may be inaccurate. Consider using '#align traversable.fold_map_hom_free Traversable.foldMap_hom_freeₓ'. -/
theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
f (foldMap FreeMonoid.of x) = foldMap (f ∘ FreeMonoid.of) x :=
foldMap_hom f _ x
@@ -312,35 +400,60 @@ variable {α β γ : Type u}
variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
+/- warning: traversable.foldl.of_free_monoid_comp_of -> Traversable.foldl.ofFreeMonoid_comp_of is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) => (FreeMonoid.{u1} β) -> (Monoid.Foldl.{u1} α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : α -> β -> α), Eq.{succ u1} (β -> (Monoid.Foldl.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.Foldl.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (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.{u1} (Monoid.Foldl.{u1} α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))) (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldl.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1}) α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)))))) (Monoid.Foldl.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldl.{u1} α) (Monoid.Foldl.mk.{u1} α) (flip.{succ u1, succ u1, succ u1} α β α f))
+Case conversion may be inaccurate. Consider using '#align traversable.foldl.of_free_monoid_comp_of Traversable.foldl.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldl.ofFreeMonoid_comp_of (f : α → β → α) :
Foldl.ofFreeMonoid f ∘ FreeMonoid.of = Foldl.mk ∘ flip f :=
rfl
#align traversable.foldl.of_free_monoid_comp_of Traversable.foldl.ofFreeMonoid_comp_of
+/- warning: traversable.foldr.of_free_monoid_comp_of -> Traversable.foldr.ofFreeMonoid_comp_of is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) => (FreeMonoid.{u1} β) -> (Monoid.Foldr.{u1} α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} (f : β -> α -> α), Eq.{succ u1} (β -> (Monoid.Foldr.{u1} α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.Foldr.{u1} α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (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.{u1} (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))) (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α)) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.Foldr.{u1} α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.Foldr.{u1} α) (CategoryTheory.End.monoid.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} α))))) (Monoid.Foldr.ofFreeMonoid.{u1} β α f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> α) (Monoid.Foldr.{u1} α) (Monoid.Foldr.mk.{u1} α) f)
+Case conversion may be inaccurate. Consider using '#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
Foldr.ofFreeMonoid f ∘ FreeMonoid.of = Foldr.mk ∘ f :=
rfl
#align traversable.foldr.of_free_monoid_comp_of Traversable.foldr.ofFreeMonoid_comp_of
+/- warning: traversable.mfoldl.of_free_monoid_comp_of -> Traversable.foldlm.ofFreeMonoid_comp_of is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) => (FreeMonoid.{u1} β) -> (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α))))) (Monoid.foldlM.ofFreeMonoid.{u1} (fun {α : Type.{u1}} => m α) _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.foldlM.mk.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : α -> β -> (m α)), Eq.{succ u1} (β -> (Monoid.foldlM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.foldlM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldlM.{u1} m _inst_3 α) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))) (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (MulOpposite.mulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (Monoid.toMulOneClass.{u1} (CategoryTheory.End.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.categoryStruct.{u1, u1} m _inst_3) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))))))) (Monoid.foldlM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldlM.{u1} m _inst_3 α) (Monoid.foldlM.mk.{u1} m _inst_3 α) (flip.{succ u1, succ u1, succ u1} α β (m α) f))
+Case conversion may be inaccurate. Consider using '#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
-theorem mfoldl.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
- Mfoldl.ofFreeMonoid f ∘ FreeMonoid.of = Mfoldl.mk ∘ flip f :=
+theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
+ foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f :=
by
ext1 x
simp [(· ∘ ·), mfoldl.of_free_monoid, mfoldl.mk, flip]
rfl
-#align traversable.mfoldl.of_free_monoid_comp_of Traversable.mfoldl.ofFreeMonoid_comp_of
-
+#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
+
+/- warning: traversable.mfoldr.of_free_monoid_comp_of -> Traversable.foldrm.ofFreeMonoid_comp_of is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (coeFn.{succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) (fun (_x : MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) => (FreeMonoid.{u1} β) -> (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α)) (MonoidHom.hasCoeToFun.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.cancelMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} (fun {α : Type.{u1}} => m α)) (CategoryTheory.KleisliCat.category.{u1, u1} (fun {α : Type.{u1}} => m α) _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} (fun {α : Type.{u1}} => m α) α)))) (Monoid.foldrM.ofFreeMonoid.{u1} (fun {α : Type.{u1}} => m α) _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) (Monoid.foldrM.mk.{u1} (fun {α : Type.{u1}} => m α) _inst_3 α) f)
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} {m : Type.{u1} -> Type.{u1}} [_inst_3 : Monad.{u1, u1} m] [_inst_4 : LawfulMonad.{u1, u1} m _inst_3] (f : β -> α -> (m α)), Eq.{succ u1} (β -> (Monoid.foldrM.{u1} m _inst_3 α)) (Function.comp.{succ u1, succ u1, succ u1} β (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (FunLike.coe.{succ u1, succ u1, succ u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (fun (_x : FreeMonoid.{u1} β) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : FreeMonoid.{u1} β) => Monoid.foldrM.{u1} m _inst_3 α) _x) (MulHomClass.toFunLike.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (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.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (MonoidHomClass.toMulHomClass.{u1, u1, u1} (MonoidHom.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))) (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α))) (MonoidHom.monoidHomClass.{u1, u1} (FreeMonoid.{u1} β) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.toMulOneClass.{u1} (FreeMonoid.{u1} β) (RightCancelMonoid.toMonoid.{u1} (FreeMonoid.{u1} β) (CancelMonoid.toRightCancelMonoid.{u1} (FreeMonoid.{u1} β) (FreeMonoid.instCancelMonoidFreeMonoid.{u1} β)))) (Monoid.toMulOneClass.{u1} (Monoid.foldrM.{u1} m _inst_3 α) (CategoryTheory.End.monoid.{u1, succ u1} (CategoryTheory.KleisliCat.{u1, u1} m) (CategoryTheory.KleisliCat.category.{u1, u1} m _inst_3 _inst_4) (CategoryTheory.KleisliCat.mk.{u1, u1} m α)))))) (Monoid.foldrM.ofFreeMonoid.{u1} m _inst_3 β α _inst_4 f)) (FreeMonoid.of.{u1} β)) (Function.comp.{succ u1, succ u1, succ u1} β (α -> (m α)) (Monoid.foldrM.{u1} m _inst_3 α) (Monoid.foldrM.mk.{u1} m _inst_3 α) f)
+Case conversion may be inaccurate. Consider using '#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_ofₓ'. -/
@[simp]
-theorem mfoldr.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
- Mfoldr.ofFreeMonoid f ∘ FreeMonoid.of = Mfoldr.mk ∘ f :=
+theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
+ foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f :=
by
ext
simp [(· ∘ ·), mfoldr.of_free_monoid, mfoldr.mk, flip]
-#align traversable.mfoldr.of_free_monoid_comp_of Traversable.mfoldr.ofFreeMonoid_comp_of
+#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_of
+#print Traversable.toList_spec /-
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) :=
Eq.symm <|
calc
@@ -358,11 +471,19 @@ theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMon
· infer_instance
#align traversable.to_list_spec Traversable.toList_spec
+-/
+/- warning: traversable.fold_map_map -> Traversable.foldMap_map is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] [_inst_3 : Monoid.{u1} γ] (f : α -> β) (g : β -> γ) (xs : t α), Eq.{succ u1} γ (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_1 β γ (MulOneClass.toHasOne.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (MulOneClass.toHasMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) g (Functor.map.{u1, u1} (fun {α : Type.{u1}} => t α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => t α) _inst_1) α β f xs)) (Traversable.foldMap.{u1} (fun {α : Type.{u1}} => t α) _inst_1 α γ (MulOneClass.toHasOne.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (MulOneClass.toHasMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (Function.comp.{succ u1, succ u1, succ u1} α β γ g f) xs)
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] [_inst_3 : Monoid.{u1} γ] (f : α -> β) (g : β -> γ) (xs : t α), Eq.{succ u1} γ (Traversable.foldMap.{u1} t _inst_1 β γ (Monoid.toOne.{u1} γ _inst_3) (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) g (Functor.map.{u1, u1} t (Traversable.toFunctor.{u1} t _inst_1) α β f xs)) (Traversable.foldMap.{u1} t _inst_1 α γ (Monoid.toOne.{u1} γ _inst_3) (MulOneClass.toMul.{u1} γ (Monoid.toMulOneClass.{u1} γ _inst_3)) (Function.comp.{succ u1, succ u1, succ u1} α β γ g f) xs)
+Case conversion may be inaccurate. Consider using '#align traversable.fold_map_map Traversable.foldMap_mapₓ'. -/
theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) :
foldMap g (f <$> xs) = foldMap (g ∘ f) xs := by simp only [fold_map, traverse_map]
#align traversable.fold_map_map Traversable.foldMap_map
+#print Traversable.foldl_toList /-
theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) :
foldl f x xs = List.foldl f x (toList xs) :=
by
@@ -370,7 +491,9 @@ theorem foldl_toList (f : α → β → α) (xs : t β) (x : α) :
simp only [foldl, to_list_spec, fold_map_hom_free, foldl.of_free_monoid_comp_of, foldl.get,
FreeMonoid.ofList_toList]
#align traversable.foldl_to_list Traversable.foldl_toList
+-/
+#print Traversable.foldr_toList /-
theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) :
foldr f x xs = List.foldr f x (toList xs) :=
by
@@ -378,7 +501,14 @@ theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) :
rw [to_list_spec, foldr, foldr.get, FreeMonoid.ofList_toList, fold_map_hom_free,
foldr.of_free_monoid_comp_of]
#align traversable.foldr_to_list Traversable.foldr_toList
+-/
+/- warning: traversable.to_list_map -> Traversable.toList_map is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] (f : α -> β) (xs : t α), Eq.{succ u1} (List.{u1} β) (Traversable.toList.{u1} β (fun {α : Type.{u1}} => t α) _inst_1 (Functor.map.{u1, u1} (fun {α : Type.{u1}} => t α) (Traversable.toFunctor.{u1} (fun {α : Type.{u1}} => t α) _inst_1) α β f xs)) (Functor.map.{u1, u1} List.{u1} (Traversable.toFunctor.{u1} List.{u1} List.traversable.{u1}) α β f (Traversable.toList.{u1} α (fun {α : Type.{u1}} => t α) _inst_1 xs))
+but is expected to have type
+ forall {α : Type.{u1}} {β : Type.{u1}} {t : Type.{u1} -> Type.{u1}} [_inst_1 : Traversable.{u1} t] [_inst_2 : IsLawfulTraversable.{u1} t _inst_1] (f : α -> β) (xs : t α), Eq.{succ u1} (List.{u1} β) (Traversable.toList.{u1} β t _inst_1 (Functor.map.{u1, u1} t (Traversable.toFunctor.{u1} t _inst_1) α β f xs)) (Functor.map.{u1, u1} List.{u1} List.instFunctorList.{u1} α β f (Traversable.toList.{u1} α t _inst_1 xs))
+Case conversion may be inaccurate. Consider using '#align traversable.to_list_map Traversable.toList_mapₓ'. -/
/-
-/
@@ -387,17 +517,22 @@ theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toLis
FreeMonoid.map_of, (· ∘ ·)]
#align traversable.to_list_map Traversable.toList_map
+#print Traversable.foldl_map /-
@[simp]
theorem foldl_map (g : β → γ) (f : α → γ → α) (a : α) (l : t β) :
foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l := by
simp only [foldl, fold_map_map, (· ∘ ·), flip]
#align traversable.foldl_map Traversable.foldl_map
+-/
+#print Traversable.foldr_map /-
@[simp]
theorem foldr_map (g : β → γ) (f : γ → α → α) (a : α) (l : t β) :
foldr f a (g <$> l) = foldr (f ∘ g) a l := by simp only [foldr, fold_map_map, (· ∘ ·), flip]
#align traversable.foldr_map Traversable.foldr_map
+-/
+#print Traversable.toList_eq_self /-
@[simp]
theorem toList_eq_self {xs : List α} : toList xs = xs :=
by
@@ -406,7 +541,9 @@ theorem toList_eq_self {xs : List α} : toList xs = xs :=
case nil => rfl
case cons _ _ ih => conv_rhs => rw [← ih]; rfl
#align traversable.to_list_eq_self Traversable.toList_eq_self
+-/
+#print Traversable.length_toList /-
theorem length_toList {xs : t α} : length xs = List.length (toList xs) :=
by
unfold length
@@ -424,37 +561,46 @@ theorem length_toList {xs : t α} : length xs = List.length (toList xs) :=
rw [← ih]
exact tl.foldl_hom (fun x => x + 1) f f 0 fun n x => rfl
#align traversable.length_to_list Traversable.length_toList
+-/
variable {m : Type u → Type u} [Monad m] [LawfulMonad m]
-theorem mfoldl_toList {f : α → β → m α} {x : α} {xs : t β} :
- mfoldl f x xs = List.foldlM f x (toList xs) :=
+#print Traversable.foldlm_toList /-
+theorem foldlm_toList {f : α → β → m α} {x : α} {xs : t β} :
+ foldlm f x xs = List.foldlM f x (toList xs) :=
calc
- mfoldl f x xs = unop (Mfoldl.ofFreeMonoid f (FreeMonoid.ofList <| toList xs)) x := by
+ foldlm f x xs = unop (foldlM.ofFreeMonoid f (FreeMonoid.ofList <| toList xs)) x := by
simp only [mfoldl, to_list_spec, fold_map_hom_free (mfoldl.of_free_monoid f),
mfoldl.of_free_monoid_comp_of, mfoldl.get, FreeMonoid.ofList_toList]
_ = List.foldlM f x (toList xs) := by simp [mfoldl.of_free_monoid, unop_op, flip]
-#align traversable.mfoldl_to_list Traversable.mfoldl_toList
+#align traversable.mfoldl_to_list Traversable.foldlm_toList
+-/
-theorem mfoldr_toList (f : α → β → m β) (x : β) (xs : t α) :
- mfoldr f x xs = List.foldrM f x (toList xs) :=
+#print Traversable.foldrm_toList /-
+theorem foldrm_toList (f : α → β → m β) (x : β) (xs : t α) :
+ foldrm f x xs = List.foldrM f x (toList xs) :=
by
change _ = mfoldr.of_free_monoid f (FreeMonoid.ofList <| to_list xs) x
simp only [mfoldr, to_list_spec, fold_map_hom_free (mfoldr.of_free_monoid f),
mfoldr.of_free_monoid_comp_of, mfoldr.get, FreeMonoid.ofList_toList]
-#align traversable.mfoldr_to_list Traversable.mfoldr_toList
+#align traversable.mfoldr_to_list Traversable.foldrm_toList
+-/
+#print Traversable.foldlm_map /-
@[simp]
-theorem mfoldl_map (g : β → γ) (f : α → γ → m α) (a : α) (l : t β) :
- mfoldl f a (g <$> l) = mfoldl (fun x y => f x (g y)) a l := by
+theorem foldlm_map (g : β → γ) (f : α → γ → m α) (a : α) (l : t β) :
+ foldlm f a (g <$> l) = foldlm (fun x y => f x (g y)) a l := by
simp only [mfoldl, fold_map_map, (· ∘ ·), flip]
-#align traversable.mfoldl_map Traversable.mfoldl_map
+#align traversable.mfoldl_map Traversable.foldlm_map
+-/
+#print Traversable.foldrm_map /-
@[simp]
-theorem mfoldr_map (g : β → γ) (f : γ → α → m α) (a : α) (l : t β) :
- mfoldr f a (g <$> l) = mfoldr (f ∘ g) a l := by simp only [mfoldr, fold_map_map, (· ∘ ·), flip]
-#align traversable.mfoldr_map Traversable.mfoldr_map
+theorem foldrm_map (g : β → γ) (f : γ → α → m α) (a : α) (l : t β) :
+ foldrm f a (g <$> l) = foldrm (f ∘ g) a l := by simp only [mfoldr, fold_map_map, (· ∘ ·), flip]
+#align traversable.mfoldr_map Traversable.foldrm_map
+-/
end Equalities
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -290,7 +290,7 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
calc
f (foldMap g x) = f (traverse (Const.mk' ∘ g) x) := rfl
_ = (mapFold f).app _ (traverse (Const.mk' ∘ g) x) := rfl
- _ = traverse ((mapFold f).app _ ∘ Const.mk' ∘ g) x := naturality (mapFold f) _ _
+ _ = traverse ((mapFold f).app _ ∘ Const.mk' ∘ g) x := (naturality (mapFold f) _ _)
_ = foldMap (f ∘ g) x := rfl
#align traversable.fold_map_hom Traversable.foldMap_hom
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -123,7 +123,12 @@ def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl
toFun xs := op <| flip (List.foldl f) (FreeMonoid.toList xs)
map_one' := rfl
map_mul' := by
- intros; simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj]; rfl
+ intros
+ -- Adaptation note: nightly-2024-03-16: simp was
+ -- simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj]
+ simp only [FreeMonoid.toList_mul, unop_op, List.foldl_append, op_inj, Function.flip_def,
+ List.foldl_append]
+ rfl
#align monoid.foldl.of_free_monoid Monoid.Foldl.ofFreeMonoid
@[reducible]
@@ -316,8 +321,12 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
ext1 x
- simp only [foldlM.ofFreeMonoid, flip, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply,
- FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure, foldlM.mk, op_inj]
+ -- Adaptation note: nightly-2024-03-16: simp was
+ -- simp only [foldlM.ofFreeMonoid, flip, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply,
+ -- FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure, foldlM.mk, op_inj]
+ simp only [foldlM.ofFreeMonoid, Function.flip_def, MonoidHom.coe_mk, OneHom.coe_mk,
+ Function.comp_apply, FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure,
+ foldlM.mk, op_inj]
rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
@@ -325,7 +334,9 @@ theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β
theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by
ext
- simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, flip]
+ -- Adaptation note: nightly-2024-03-16: simp was
+ -- simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, flip]
+ simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, Function.flip_def]
#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_of
theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMonoid.of xs) :=
@@ -336,12 +347,14 @@ theorem toList_spec (xs : t α) : toList xs = FreeMonoid.toList (foldMap FreeMon
by simp only [List.reverse_reverse]
_ = FreeMonoid.toList (List.foldr cons [] (foldMap FreeMonoid.of xs).reverse).reverse :=
by simp only [List.foldr_eta]
- _ = (unop (Foldl.ofFreeMonoid (flip cons) (foldMap FreeMonoid.of xs)) []).reverse :=
- by simp [flip, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
- _ = toList xs :=
- by rw [foldMap_hom_free (Foldl.ofFreeMonoid (flip <| @cons α))]
- simp only [toList, foldl, List.reverse_inj, Foldl.get, foldl.ofFreeMonoid_comp_of,
- Function.comp_apply]
+ _ = (unop (Foldl.ofFreeMonoid (flip cons) (foldMap FreeMonoid.of xs)) []).reverse := by
+ -- Adaptation note: nightly-2024-03-16: simp was
+ -- simp [flip, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
+ simp [Function.flip_def, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
+ _ = toList xs := by
+ rw [foldMap_hom_free (Foldl.ofFreeMonoid (flip <| @cons α))]
+ simp only [toList, foldl, List.reverse_inj, Foldl.get, foldl.ofFreeMonoid_comp_of,
+ Function.comp_apply]
#align traversable.to_list_spec Traversable.toList_spec
theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) :
@@ -370,7 +383,9 @@ theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toLis
@[simp]
theorem foldl_map (g : β → γ) (f : α → γ → α) (a : α) (l : t β) :
foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l := by
- simp only [foldl, foldMap_map, (· ∘ ·), flip]
+ -- Adaptation note: nightly-2024-03-16: simp was
+ -- simp only [foldl, foldMap_map, (· ∘ ·), flip]
+ simp only [foldl, foldMap_map, (· ∘ ·), Function.flip_def]
#align traversable.foldl_map Traversable.foldl_map
@[simp]
@@ -418,7 +433,9 @@ theorem foldrm_toList (f : α → β → m β) (x : β) (xs : t α) :
@[simp]
theorem foldlm_map (g : β → γ) (f : α → γ → m α) (a : α) (l : t β) :
foldlm f a (g <$> l) = foldlm (fun x y => f x (g y)) a l := by
- simp only [foldlm, foldMap_map, (· ∘ ·), flip]
+ -- Adaptation note: nightly-2024-03-16: simp was
+ -- simp only [foldlm, foldMap_map, (· ∘ ·), flip]
+ simp only [foldlm, foldMap_map, (· ∘ ·), Function.flip_def]
#align traversable.mfoldl_map Traversable.foldlm_map
@[simp]
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -61,7 +61,6 @@ open ULift CategoryTheory MulOpposite
namespace Monoid
variable {m : Type u → Type u} [Monad m]
-
variable {α β : Type u}
/-- For a list, foldl f x [y₀,y₁] reduces as follows:
@@ -272,7 +271,6 @@ theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a :
#align traversable.foldl.unop_of_free_monoid Traversable.foldl.unop_ofFreeMonoid
variable (m : Type u → Type u) [Monad m] [LawfulMonad m]
-
variable {t : Type u → Type u} [Traversable t] [LawfulTraversable t]
open LawfulTraversable
@@ -300,7 +298,6 @@ open LawfulTraversable
open List (cons)
variable {α β γ : Type u}
-
variable {t : Type u → Type u} [Traversable t] [LawfulTraversable t]
@[simp]
Includes some doc comments and real code: this is exhaustive, with two exceptions:
Follow-up to #11301, much shorter this time.
@@ -88,10 +88,11 @@ We can view the above as a composition of functions:
We can use traverse and const to construct this composition:
```
-calc const.run (traverse (λ y, const.mk' (flip f y)) [y₀,y₁]) x
- = const.run ((::) <$> const.mk' (flip f y₀) <*> traverse (λ y, const.mk' (flip f y)) [y₁]) x
+calc const.run (traverse (fun y ↦ const.mk' (flip f y)) [y₀,y₁]) x
+ = const.run ((::) <$> const.mk' (flip f y₀) <*>
+ traverse (fun y ↦ const.mk' (flip f y)) [y₁]) x
... = const.run ((::) <$> const.mk' (flip f y₀) <*>
- ( (::) <$> const.mk' (flip f y₁) <*> traverse (λ y, const.mk' (flip f y)) [] )) x
+ ( (::) <$> const.mk' (flip f y₁) <*> traverse (fun y ↦ const.mk' (flip f y)) [] )) x
... = const.run ((::) <$> const.mk' (flip f y₀) <*>
( (::) <$> const.mk' (flip f y₁) <*> pure [] )) x
... = const.run ( ((::) <$> const.mk' (flip f y₁) <*> pure []) ∘
@@ -318,7 +318,8 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
ext1 x
- simp [(· ∘ ·), foldlM.ofFreeMonoid, foldlM.mk, flip]
+ simp only [foldlM.ofFreeMonoid, flip, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply,
+ FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure, foldlM.mk, op_inj]
rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
cases x with | ...
instead of cases x; case => ...
(#9321)
This converts usages of the pattern
cases h
case inl h' => ...
case inr h' => ...
which derive from mathported code, to the "structured cases
" syntax:
cases h with
| inl h' => ...
| inr h' => ...
The case where the subgoals are handled with ·
instead of case
is more contentious (and much more numerous) so I left those alone. This pattern also appears with cases'
, induction
, induction'
, and rcases
. Furthermore, there is a similar transformation for by_cases
:
by_cases h : cond
case pos => ...
case neg => ...
is replaced by:
if h : cond then
...
else
...
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -382,9 +382,9 @@ theorem foldr_map (g : β → γ) (f : γ → α → α) (a : α) (l : t β) :
@[simp]
theorem toList_eq_self {xs : List α} : toList xs = xs := by
simp only [toList_spec, foldMap, traverse]
- induction xs
- case nil => rfl
- case cons _ _ ih => conv_rhs => rw [← ih]; rfl
+ induction xs with
+ | nil => rfl
+ | cons _ _ ih => conv_rhs => rw [← ih]; rfl
#align traversable.to_list_eq_self Traversable.toList_eq_self
theorem length_toList {xs : t α} : length xs = List.length (toList xs) := by
@@ -319,6 +319,7 @@ theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
ext1 x
simp [(· ∘ ·), foldlM.ofFreeMonoid, foldlM.mk, flip]
+ rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
@[simp]
@@ -319,7 +319,6 @@ theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
ext1 x
simp [(· ∘ ·), foldlM.ofFreeMonoid, foldlM.mk, flip]
- rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
@[simp]
@@ -319,6 +319,7 @@ theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β
foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
ext1 x
simp [(· ∘ ·), foldlM.ofFreeMonoid, foldlM.mk, flip]
+ rfl
#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
@[simp]
@@ -27,10 +27,8 @@ primitive and `foldMap_hom` as a defining property.
```
def foldMap {α ω} [One ω] [Mul ω] (f : α → ω) : t α → ω := ...
-lemma foldMap_hom (α β)
- [Monoid α] [Monoid β] (f : α →* β)
- (g : γ → α) (x : t γ) :
- f (foldMap g x) = foldMap (f ∘ g) x :=
+lemma foldMap_hom (α β) [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
+ f (foldMap g x) = foldMap (f ∘ g) x :=
...
```
@@ -2,11 +2,6 @@
Copyright (c) 2018 Simon Hudon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Simon Hudon, Sean Leather
-
-! This file was ported from Lean 3 source module control.fold
-! leanprover-community/mathlib commit 740acc0e6f9adf4423f92a485d0456fc271482da
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.Group.Opposite
import Mathlib.Algebra.FreeMonoid.Basic
@@ -16,6 +11,8 @@ import Mathlib.CategoryTheory.Endomorphism
import Mathlib.CategoryTheory.Types
import Mathlib.CategoryTheory.Category.KleisliCat
+#align_import control.fold from "leanprover-community/mathlib"@"740acc0e6f9adf4423f92a485d0456fc271482da"
+
/-!
# List folds generalized to `Traversable`
@@ -277,9 +277,9 @@ theorem foldl.unop_ofFreeMonoid (f : β → α → β) (xs : FreeMonoid α) (a :
variable (m : Type u → Type u) [Monad m] [LawfulMonad m]
-variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
+variable {t : Type u → Type u} [Traversable t] [LawfulTraversable t]
-open IsLawfulTraversable
+open LawfulTraversable
theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x : t γ) :
f (foldMap g x) = foldMap (f ∘ g) x :=
@@ -299,13 +299,13 @@ end ApplicativeTransformation
section Equalities
-open IsLawfulTraversable
+open LawfulTraversable
open List (cons)
variable {α β γ : Type u}
-variable {t : Type u → Type u} [Traversable t] [IsLawfulTraversable t]
+variable {t : Type u → Type u} [Traversable t] [LawfulTraversable t]
@[simp]
theorem foldl.ofFreeMonoid_comp_of (f : α → β → α) :
This PR is the result of running
find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;
which firstly replaces .
focusing dots with ·
and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.
@@ -398,8 +398,8 @@ theorem length_toList {xs : t α} : length xs = List.length (toList xs) := by
rw [← Nat.add_zero ys.length]
generalize 0 = n
induction' ys with _ _ ih generalizing n
- . simp
- . simp_arith [ih]
+ · simp
+ · simp_arith [ih]
#align traversable.length_to_list Traversable.length_toList
variable {m : Type u → Type u} [Monad m] [LawfulMonad m]
This PR fixes two things:
align
statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align
). This is often seen in the mathport output after ending calc
blocks.#align
statements. (This was needed for a script I wrote for #3630.)@@ -288,7 +288,6 @@ theorem foldMap_hom [Monoid α] [Monoid β] (f : α →* β) (g : γ → α) (x
_ = (mapFold f).app _ (traverse (Const.mk' ∘ g) x) := rfl
_ = traverse ((mapFold f).app _ ∘ Const.mk' ∘ g) x := naturality (mapFold f) _ _
_ = foldMap (f ∘ g) x := rfl
-
#align traversable.fold_map_hom Traversable.foldMap_hom
theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
@@ -412,7 +411,6 @@ theorem foldlm_toList {f : α → β → m α} {x : α} {xs : t β} :
by simp only [foldlm, toList_spec, foldMap_hom_free (foldlM.ofFreeMonoid f),
foldlm.ofFreeMonoid_comp_of, foldlM.get, FreeMonoid.ofList_toList]
_ = List.foldlM f x (toList xs) := by simp [foldlM.ofFreeMonoid, unop_op, flip]
-
#align traversable.mfoldl_to_list Traversable.foldlm_toList
theorem foldrm_toList (f : α → β → m β) (x : β) (xs : t α) :
The unported dependencies are