Theorem: Monoid.foldlM.ofFreeMonoid_apply
File: Mathlib/Control/Fold.lean

Proof steps:
state_before: m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
⊢ ∀ (x y : FreeMonoid α),
    { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x * y) =
      { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x *
        { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y
state_after: m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
x✝ y✝ : FreeMonoid α
⊢ { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x✝ * y✝) =
    { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x✝ *
      { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y✝
tactic: intros
state_before: m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
x✝ y✝ : FreeMonoid α
⊢ { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x✝ * y✝) =
    { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x✝ *
      { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y✝
state_after: case a
m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
x✝ y✝ : FreeMonoid α
⊢ unop ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x✝ * y✝)) =
    unop
      ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x✝ *
        { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y✝)
tactic: apply unop_injective
state_before: case a
m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
x✝ y✝ : FreeMonoid α
⊢ unop ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x✝ * y✝)) =
    unop
      ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x✝ *
        { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y✝)
state_after: case a.h
m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
x✝¹ y✝ : FreeMonoid α
x✝ : KleisliCat.mk m β
⊢ unop ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x✝¹ * y✝)) x✝ =
    unop
      ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x✝¹ *
        { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y✝)
      x✝
tactic: funext
state_before: case a.h
m : Type u → Type u
inst✝¹ : Monad m
α β : Type u
inst✝ : LawfulMonad m
f : β → α → m β
x✝¹ y✝ : FreeMonoid α
x✝ : KleisliCat.mk m β
⊢ unop ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun (x✝¹ * y✝)) x✝ =
    unop
      ({ toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun x✝¹ *
        { toFun := fun xs => op (flip (List.foldlM f) (FreeMonoid.toList xs)), map_one' := ⋯ }.toFun y✝)
      x✝
state_after: no goals
tactic: apply List.foldlM_append