Skip to content

Commit ef5f884

Browse files
committed
make pure lemma statements actually pure
1 parent eb64326 commit ef5f884

File tree

1 file changed

+7
-7
lines changed
  • src/Std/Data/Iterators/Lemmas/Producers

1 file changed

+7
-7
lines changed

src/Std/Data/Iterators/Lemmas/Producers/List.lean

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Paul Reichert
55
-/
66
prelude
77
import Std.Data.Iterators.Consumers
8+
import Std.Data.Iterators.Lemmas.Consumers.Collect
89
import 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]
3233
theorem _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]
3838
theorem _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]
4343
theorem _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

4747
end Std.Iterators

0 commit comments

Comments
 (0)