File tree Expand file tree Collapse file tree 2 files changed +674
-418
lines changed
src/Init/Data/Range/Polymorphic Expand file tree Collapse file tree 2 files changed +674
-418
lines changed Original file line number Diff line number Diff line change @@ -828,6 +828,23 @@ public theorem toArray_eq_if_roo [UpwardEnumerable α] [LT α] [DecidableLT α]
828828 #[] := by
829829 rw [Internal.toArray_eq_toArray_iter, Rxo.Iterator.toArray_eq_match]; rfl
830830
831+ public theorem toList_eq_if_rco [UpwardEnumerable α] [LT α] [DecidableLT α]
832+ [LawfulUpwardEnumerable α] [Rxo.IsAlwaysFinite α] [LawfulUpwardEnumerableLT α] :
833+ r.toList = if r.lower < r.upper then
834+ match UpwardEnumerable.succ? r.lower with
835+ | none => [r.lower]
836+ | some next => r.lower :: (next...r.upper).toList
837+ else
838+ [] := by
839+ rw [Internal.toList_eq_toList_iter, Rxo.Iterator.toList_eq_match]
840+ simp only [Internal.iter]
841+ split
842+ · split
843+ · simp [Rxo.Iterator.toList_eq_match, *]
844+ · simp only [*]
845+ rfl
846+ · rfl
847+
831848public theorem toArray_eq_if_rco [UpwardEnumerable α] [LT α] [DecidableLT α]
832849 [LawfulUpwardEnumerable α] [Rxo.IsAlwaysFinite α] [LawfulUpwardEnumerableLT α] :
833850 r.toArray = if r.lower < r.upper then
You can’t perform that action at this time.
0 commit comments