@@ -129,13 +129,13 @@ theorem IterM.forIn_eq_foldM {α β : Type w} [Iterator α Id β]
129129theorem Iter.fold_eq_forIn {α β γ : Type w} [Iterator α Id β]
130130 [Finite α Id] [IteratorLoop α Id Id] {f : γ → β → γ} {init : γ} {it : Iter (α := α) β} :
131131 it.fold (init := init) f =
132- ForIn.forIn (m := Id) it init (fun x acc => pure (ForInStep.yield (f acc x))) := by
132+ ( ForIn.forIn (m := Id) it init (fun x acc => pure (ForInStep.yield (f acc x)))).run := by
133133 rfl
134134
135135theorem Iter.fold_eq_foldM {α β γ : Type w} [Iterator α Id β]
136136 [Finite α Id] [IteratorLoop α Id Id] {f : γ → β → γ} {init : γ}
137137 {it : Iter (α := α) β} :
138- it.fold (init := init) f = it.foldM (m := Id) (init := init) (pure <| f · ·) := by
138+ it.fold (init := init) f = ( it.foldM (m := Id) (init := init) (pure <| f · ·)).run := by
139139 simp [foldM_eq_forIn, fold_eq_forIn]
140140
141141theorem Iter.forIn_yield_eq_fold {α β γ : Type w} [Iterator α Id β]
@@ -144,7 +144,8 @@ theorem Iter.forIn_yield_eq_fold {α β γ : Type w} [Iterator α Id β]
144144 {it : Iter (α := α) β} :
145145 ForIn.forIn (m := Id) it init (fun c b => .yield (f c b)) =
146146 it.fold (fun b c => f c b) init := by
147- simp [Iter.fold_eq_forIn]
147+ simp only [fold_eq_forIn]
148+ rfl
148149
149150theorem Iter.fold_eq_match_step {α β γ : Type w} [Iterator α Id β] [Finite α Id]
150151 [IteratorLoop α Id Id] [LawfulIteratorLoop α Id Id]
@@ -163,6 +164,6 @@ theorem Iter.foldl_toList {α β γ : Type w} [Iterator α Id β] [Finite α Id]
163164 [IteratorCollect α Id] [LawfulIteratorCollect α Id]
164165 {f : γ → β → γ} {init : γ} {it : Iter (α := α) β} :
165166 it.toList.foldl (init := init) f = it.fold (init := init) f := by
166- simp [Iter. fold_eq_foldM, ← Iter.foldlM_toList, List.foldl_eq_foldlM ]
167+ rw [ fold_eq_foldM, List.foldl_eq_foldlM, ← Iter.foldlM_toList]
167168
168169end Std.Iterators
0 commit comments