@@ -5,6 +5,7 @@ Authors: Paul Reichert
55-/
66prelude
77import Std.Data.Iterators.Consumers
8+ import Std.Data.Iterators.Lemmas.Consumers.Collect
89import Std.Data.Iterators.Lemmas.Producers.Monadic.List
910
1011/-!
@@ -30,18 +31,17 @@ theorem _root_.List.step_iter_cons {x : β} {xs : List β} :
3031
3132@[simp]
3233theorem _root_.List.toArray_iter {m : Type w → Type w'} [Monad m] [LawfulMonad m] {l : List β} :
33- (l.iterM m).toArray = pure l.toArray := by
34- simp only [IterM.toArray, ListIterator.toArrayMapped_toIterM]
35- rw [List.mapM_pure, map_pure, List.map_id']
34+ l.iter.toArray = l.toArray := by
35+ simp [List.iter, List.toArray_iterM, Iter.toArray_eq_toArray_toIterM]
3636
3737@[simp]
3838theorem _root_.List.toList_iter {m : Type w → Type w'} [Monad m] [LawfulMonad m] {l : List β} :
39- (l.iterM m) .toList = pure l := by
40- rw [← IterM.toList_toArray, List.toArray_iterM, map_pure, List.toList_toArray ]
39+ l.iter .toList = l := by
40+ simp [ List.iter, List.toList_iterM ]
4141
4242@[simp]
4343theorem _root_.List.toListRev_iter {m : Type w → Type w'} [Monad m] [LawfulMonad m] {l : List β} :
44- (l.iterM m) .toListRev = pure l.reverse := by
45- simp [IterM.toListRev_eq, List.toList_iterM ]
44+ l.iter .toListRev = l.reverse := by
45+ simp [List.iter, Iter.toListRev_eq_toListRev_toIterM, List.toListRev_iterM ]
4646
4747end Std.Iterators
0 commit comments