@@ -34,19 +34,19 @@ theorem Iter.toListRev_eq_toListRev_toIterM {α β} [Iterator α Id β] [Finite
3434 (rfl)
3535
3636@[simp]
37- theorem Iter.ensureTerminationToArray_eq_toArray {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
37+ theorem Iter.toArray_ensureTermination {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
3838 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
3939 it.ensureTermination.toArray = it.toArray :=
4040 (rfl)
4141
4242@[simp]
43- theorem Iter.ensureTerminationToList_eq_toList {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
43+ theorem Iter.toList_ensureTermination {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
4444 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
4545 it.ensureTermination.toList = it.toList :=
4646 (rfl)
4747
4848@[simp]
49- theorem Iter.ensureTerminationToListRev_eq_toListRev {α β} [Iterator α Id β] [Finite α Id]
49+ theorem Iter.toListRev_ensureTermination_eq_toListRev {α β} [Iterator α Id β] [Finite α Id]
5050 {it : Iter (α := α) β} : it.ensureTermination.toListRev = it.toListRev :=
5151 (rfl)
5252
@@ -68,23 +68,21 @@ theorem Iter.toList_toArray {α β} [Iterator α Id β] [Finite α Id] [Iterator
6868 it.toArray.toList = it.toList := by
6969 simp [toArray_eq_toArray_toIterM, toList_eq_toList_toIterM, ← IterM.toList_toArray]
7070
71- @[simp]
72- theorem Iter.toList_ensureTerminationToArray {α β} [Iterator α Id β] [Finite α Id]
71+ theorem Iter.toList_toArray_ensureTermination {α β} [Iterator α Id β] [Finite α Id]
7372 [IteratorCollect α Id Id] [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
7473 it.ensureTermination.toArray.toList = it.toList := by
75- rw [ensureTerminationToArray_eq_toArray, toList_toArray]
74+ simp
7675
7776@[simp]
7877theorem Iter.toArray_toList {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
7978 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
8079 it.toList.toArray = it.toArray := by
8180 simp [toArray_eq_toArray_toIterM, toList_eq_toList_toIterM, ← IterM.toArray_toList]
8281
83- @[simp]
84- theorem Iter.toArray_ensureTerminationToList {α β} [Iterator α Id β] [Finite α Id]
82+ theorem Iter.toArray_toList_ensureTermination {α β} [Iterator α Id β] [Finite α Id]
8583 [IteratorCollect α Id Id] [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
8684 it.ensureTermination.toList.toArray = it.toArray := by
87- rw [ensureTerminationToList_eq_toList, toArray_toList]
85+ simp
8886
8987@[simp]
9088theorem Iter.reverse_toListRev [Iterator α Id β] [Finite α Id]
@@ -93,21 +91,20 @@ theorem Iter.reverse_toListRev [Iterator α Id β] [Finite α Id]
9391 it.toListRev.reverse = it.toList := by
9492 simp [toListRev_eq_toListRev_toIterM, toList_eq_toList_toIterM, ← IterM.reverse_toListRev]
9593
96- @[simp]
97- theorem Iter.reverse_ensureTerminationToListRev [Iterator α Id β] [Finite α Id]
94+ theorem Iter.reverse_toListRev_ensureTermination [Iterator α Id β] [Finite α Id]
9895 [IteratorCollect α Id Id] [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
9996 it.ensureTermination.toListRev.reverse = it.toList := by
100- rw [ensureTerminationToListRev_eq_toListRev, reverse_toListRev]
97+ simp
10198
10299theorem Iter.toListRev_eq {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
103100 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
104101 it.toListRev = it.toList.reverse := by
105102 simp [Iter.toListRev_eq_toListRev_toIterM, Iter.toList_eq_toList_toIterM, IterM.toListRev_eq]
106103
107- theorem Iter.ensureTerminationToListRev_eq {α β} [Iterator α Id β] [Finite α Id]
104+ theorem Iter.toListRev_ensureTermination {α β} [Iterator α Id β] [Finite α Id]
108105 [IteratorCollect α Id Id] [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
109106 it.ensureTermination.toListRev = it.toList.reverse := by
110- rw [ensureTerminationToListRev_eq_toListRev, toListRev_eq]
107+ simp [ toListRev_eq]
111108
112109theorem Iter.toArray_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
113110 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
@@ -120,13 +117,13 @@ theorem Iter.toArray_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [I
120117 generalize it.toIterM.step.run = step
121118 cases step.inflate using PlausibleIterStep.casesOn <;> simp
122119
123- theorem Iter.ensureTerminationToArray_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
120+ theorem Iter.toArray_ensureTermination_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
124121 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
125122 it.ensureTermination.toArray = match it.step.val with
126123 | .yield it' out => #[out] ++ it'.toArray
127124 | .skip it' => it'.toArray
128125 | .done => #[] := by
129- rw [ensureTerminationToArray_eq_toArray , toArray_eq_match_step]
126+ rw [toArray_ensureTermination , toArray_eq_match_step]
130127
131128theorem Iter.toList_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
132129 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
@@ -137,13 +134,13 @@ theorem Iter.toList_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [It
137134 rw [← Iter.toList_toArray, Iter.toArray_eq_match_step]
138135 split <;> simp [Iter.toList_toArray]
139136
140- theorem Iter.ensureTerminationToList_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
137+ theorem Iter.toList_ensureTermination_eq_match_step {α β} [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id]
141138 [LawfulIteratorCollect α Id Id] {it : Iter (α := α) β} :
142139 it.ensureTermination.toList = match it.step.val with
143140 | .yield it' out => out :: it'.toList
144141 | .skip it' => it'.toList
145142 | .done => [] := by
146- rw [ensureTerminationToList_eq_toList , toList_eq_match_step]
143+ rw [toList_ensureTermination , toList_eq_match_step]
147144
148145theorem Iter.toListRev_eq_match_step {α β} [Iterator α Id β] [Finite α Id] {it : Iter (α := α) β} :
149146 it.toListRev = match it.step.val with
@@ -154,12 +151,12 @@ theorem Iter.toListRev_eq_match_step {α β} [Iterator α Id β] [Finite α Id]
154151 generalize it.toIterM.step.run = step
155152 cases step.inflate using PlausibleIterStep.casesOn <;> simp
156153
157- theorem Iter.ensureTerminationToListRev_eq_match_step {α β} [Iterator α Id β] [Finite α Id] {it : Iter (α := α) β} :
154+ theorem Iter.toListRev_ensureTermination_eq_match_step {α β} [Iterator α Id β] [Finite α Id] {it : Iter (α := α) β} :
158155 it.ensureTermination.toListRev = match it.step.val with
159156 | .yield it' out => it'.toListRev ++ [out]
160157 | .skip it' => it'.toListRev
161158 | .done => [] := by
162- rw [ensureTerminationToListRev_eq_toListRev , toListRev_eq_match_step]
159+ rw [toListRev_ensureTermination_eq_toListRev , toListRev_eq_match_step]
163160
164161theorem Iter.getElem ?_toList_eq_atIdxSlow ? {α β}
165162 [Iterator α Id β] [Finite α Id] [IteratorCollect α Id Id] [LawfulIteratorCollect α Id Id]
0 commit comments