@@ -123,7 +123,12 @@ def Foldl.ofFreeMonoid (f : β → α → β) : FreeMonoid α →* Monoid.Foldl
123123 toFun xs := op <| flip (List.foldl f) (FreeMonoid.toList xs)
124124 map_one' := rfl
125125 map_mul' := by
126- intros; simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj]; rfl
126+ intros
127+ -- Adaptation note: nightly-2024-03-16: simp was
128+ -- simp only [FreeMonoid.toList_mul, flip, unop_op, List.foldl_append, op_inj]
129+ simp only [FreeMonoid.toList_mul, unop_op, List.foldl_append, op_inj, Function.flip_def,
130+ List.foldl_append]
131+ rfl
127132#align monoid.foldl.of_free_monoid Monoid.Foldl.ofFreeMonoid
128133
129134@[reducible]
@@ -316,16 +321,22 @@ theorem foldr.ofFreeMonoid_comp_of (f : β → α → α) :
316321theorem foldlm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : α → β → m α) :
317322 foldlM.ofFreeMonoid f ∘ FreeMonoid.of = foldlM.mk ∘ flip f := by
318323 ext1 x
319- simp only [foldlM.ofFreeMonoid, flip, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply,
320- FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure, foldlM.mk, op_inj]
324+ -- Adaptation note: nightly-2024-03-16: simp was
325+ -- simp only [foldlM.ofFreeMonoid, flip, MonoidHom.coe_mk, OneHom.coe_mk, Function.comp_apply,
326+ -- FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure, foldlM.mk, op_inj]
327+ simp only [foldlM.ofFreeMonoid, Function.flip_def, MonoidHom.coe_mk, OneHom.coe_mk,
328+ Function.comp_apply, FreeMonoid.toList_of, List.foldlM_cons, List.foldlM_nil, bind_pure,
329+ foldlM.mk, op_inj]
321330 rfl
322331#align traversable.mfoldl.of_free_monoid_comp_of Traversable.foldlm.ofFreeMonoid_comp_of
323332
324333@[simp]
325334theorem foldrm.ofFreeMonoid_comp_of {m} [Monad m] [LawfulMonad m] (f : β → α → m α) :
326335 foldrM.ofFreeMonoid f ∘ FreeMonoid.of = foldrM.mk ∘ f := by
327336 ext
328- simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, flip]
337+ -- Adaptation note: nightly-2024-03-16: simp was
338+ -- simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, flip]
339+ simp [(· ∘ ·), foldrM.ofFreeMonoid, foldrM.mk, Function.flip_def]
329340#align traversable.mfoldr.of_free_monoid_comp_of Traversable.foldrm.ofFreeMonoid_comp_of
330341
331342theorem 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
336347 by simp only [List.reverse_reverse]
337348 _ = FreeMonoid.toList (List.foldr cons [] (foldMap FreeMonoid.of xs).reverse).reverse :=
338349 by simp only [List.foldr_eta]
339- _ = (unop (Foldl.ofFreeMonoid (flip cons) (foldMap FreeMonoid.of xs)) []).reverse :=
340- by simp [flip, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
341- _ = toList xs :=
342- by rw [foldMap_hom_free (Foldl.ofFreeMonoid (flip <| @cons α))]
343- simp only [toList, foldl, List.reverse_inj, Foldl.get, foldl.ofFreeMonoid_comp_of,
344- Function.comp_apply]
350+ _ = (unop (Foldl.ofFreeMonoid (flip cons) (foldMap FreeMonoid.of xs)) []).reverse := by
351+ -- Adaptation note: nightly-2024-03-16: simp was
352+ -- simp [flip, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
353+ simp [Function.flip_def, List.foldr_reverse, Foldl.ofFreeMonoid, unop_op]
354+ _ = toList xs := by
355+ rw [foldMap_hom_free (Foldl.ofFreeMonoid (flip <| @cons α))]
356+ simp only [toList, foldl, List.reverse_inj, Foldl.get, foldl.ofFreeMonoid_comp_of,
357+ Function.comp_apply]
345358#align traversable.to_list_spec Traversable.toList_spec
346359
347360theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) :
@@ -370,7 +383,9 @@ theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toLis
370383@[simp]
371384theorem foldl_map (g : β → γ) (f : α → γ → α) (a : α) (l : t β) :
372385 foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l := by
373- simp only [foldl, foldMap_map, (· ∘ ·), flip]
386+ -- Adaptation note: nightly-2024-03-16: simp was
387+ -- simp only [foldl, foldMap_map, (· ∘ ·), flip]
388+ simp only [foldl, foldMap_map, (· ∘ ·), Function.flip_def]
374389#align traversable.foldl_map Traversable.foldl_map
375390
376391@[simp]
@@ -418,7 +433,9 @@ theorem foldrm_toList (f : α → β → m β) (x : β) (xs : t α) :
418433@[simp]
419434theorem foldlm_map (g : β → γ) (f : α → γ → m α) (a : α) (l : t β) :
420435 foldlm f a (g <$> l) = foldlm (fun x y => f x (g y)) a l := by
421- simp only [foldlm, foldMap_map, (· ∘ ·), flip]
436+ -- Adaptation note: nightly-2024-03-16: simp was
437+ -- simp only [foldlm, foldMap_map, (· ∘ ·), flip]
438+ simp only [foldlm, foldMap_map, (· ∘ ·), Function.flip_def]
422439#align traversable.mfoldl_map Traversable.foldlm_map
423440
424441@[simp]
0 commit comments