@@ -201,7 +201,7 @@ public def Zipper.prependMapGT [Ord α] (t : Impl α β) (lowerBound : α)
201201 | .eq => prependMapGT r lowerBound it
202202 | .gt => prependMapGT r lowerBound it
203203
204- theorem Zipper.prependMap_of_pruneLE_eq_prependMapGE [Ord α] (t : Impl α β) (ord_t : t.Ordered)
204+ theorem Zipper.prependMap_pruneLE_eq_prependMapGE [Ord α] (t : Impl α β) (ord_t : t.Ordered)
205205 (z : Zipper α β) (lowerBound : α) :
206206 z.prependMap (t.pruneLE lowerBound) = z.prependMapGE t lowerBound := by
207207 induction t generalizing z
@@ -322,8 +322,8 @@ theorem Zipper.size_prependMap (t : Impl α β) (it : Zipper α β) :
322322
323323public def Zipper.step : Zipper α β → IterStep (IterM (α := Zipper α β) Id ((a : α) × β a)) ((a : α) × β a)
324324 | .done => .done
325- | .cons k v t it=>
326- .yield ⟨it.prependMap t⟩ ⟨k, v⟩
325+ | .cons k v t it =>
326+ .yield ⟨it.prependMap t⟩ ⟨k, v⟩
327327
328328public instance : Iterator (Zipper α β) Id ((a : α) × β a) where
329329 IsPlausibleStep it step := it.internalState.step = step
@@ -333,7 +333,7 @@ public instance : IteratorCollect (Zipper α β) Id Id := .defaultImplementation
333333
334334public instance : IteratorCollectPartial (Zipper α β) Id Id := .defaultImplementation
335335
336- def Zipper.instFinitenessRelation : FinitenessRelation (Zipper α β) Id where
336+ def Zipper.FinitenessRelation : FinitenessRelation (Zipper α β) Id where
337337 rel t' t := t'.internalState.size < t.internalState.size
338338 wf := by
339339 apply InvImage.wf
@@ -362,7 +362,7 @@ def Zipper.instFinitenessRelation : FinitenessRelation (Zipper α β) Id where
362362
363363@[no_expose]
364364public instance Zipper.instFinite : Finite (Zipper α β) Id :=
365- .of_finitenessRelation Zipper.instFinitenessRelation
365+ .of_finitenessRelation Zipper.FinitenessRelation
366366
367367public def Zipper.iter (t : Zipper α β) : Iter (α := Zipper α β) ((a : α) × β a) := ⟨t⟩
368368
@@ -407,21 +407,17 @@ theorem Zipper.toList_iter {α β} {z : Zipper α β} : z.iter.toList = z.toList
407407termination_by z.size
408408decreasing_by simp [size_prependMap]
409409
410- public theorem Zipper.iterOfTree_toList_eq_toList (t : Impl α β) :
410+ public theorem Zipper.toList.iterOfTree (t : Impl α β) :
411411 (Zipper.iterOfTree t).toList = t.toList := by
412- rw [iterOfTree, iter]
412+ rw [Zipper. iterOfTree, Zipper. iter]
413413 have := @Zipper.toList_iter α β (prependMap t .done)
414414 simp only [iter] at this
415415 rw [this]
416416 simp only [Zipper.toList_prependMap_eq_append, toList, List.append_nil]
417417
418418public theorem Zipper.map_iterOfTree_eq_tree_toList_map (t : Impl α β) :
419419 (Iter.map f (Internal.Zipper.iterOfTree t)).toList = List.map f t.toList := by
420- rw [Iter.toList_map]
421- congr
422- rw [iterOfTree]
423- rw [@toList_iter α β (prependMap t .done)]
424- simp [Zipper.toList_prependMap_eq_append, toList]
420+ rw [Iter.toList_map, toList.iterOfTree]
425421
426422end Zipper
427423
@@ -449,7 +445,7 @@ public instance [Ord α] : IteratorCollect (RxcIterator α β) Id Id := .default
449445
450446public instance [Ord α] : IteratorCollectPartial (RxcIterator α β) Id Id := .defaultImplementation
451447
452- def instFinitenessRelation [Ord α] : FinitenessRelation (RxcIterator α β) Id where
448+ def RxcIterator.FinitenessRelation [Ord α] : FinitenessRelation (RxcIterator α β) Id where
453449 rel t' t := t'.internalState.iter.size < t.internalState.iter.size
454450 wf := by
455451 apply InvImage.wf
@@ -484,7 +480,7 @@ def instFinitenessRelation [Ord α] : FinitenessRelation (RxcIterator α β) Id
484480
485481@[no_expose]
486482public instance instFinite [Ord α] : Finite (RxcIterator α β) Id :=
487- .of_finitenessRelation instFinitenessRelation
483+ .of_finitenessRelation RxcIterator.FinitenessRelation
488484
489485@[simp]
490486theorem RxcIterator.step_done [Ord α] {upper : α} : ({iter := .done, upper := upper } : RxcIterator α β).step = .done := rfl
@@ -836,13 +832,13 @@ theorem toList_rccIter {α β} [Ord α] [TransOrd α]
836832 rw [Bool.and_comm]
837833 rw [← List.filter_filter]
838834 congr 1
839- rw [← Zipper.prependMap_of_pruneLE_eq_prependMapGE ]
835+ rw [← Zipper.prependMap_pruneLE_eq_prependMapGE ]
840836 . rw [Zipper.toList_prependMap_eq_append]
841837 rw [Impl.toList_pruneLE]
842838 . simp [Zipper.toList]
843839 . exact t_ord
844840 . exact t_ord
845- . rw [← Zipper.prependMap_of_pruneLE_eq_prependMapGE ]
841+ . rw [← Zipper.prependMap_pruneLE_eq_prependMapGE ]
846842 . simp only [Zipper.toList_prependMap_eq_append, Zipper.toList, List.append_nil]
847843 rw [Impl.toList_pruneLE]
848844 . apply List.Pairwise.filter
@@ -929,13 +925,13 @@ theorem toList_rcoIter {α β} [Ord α] [TransOrd α]
929925 rw [Bool.and_comm]
930926 rw [← List.filter_filter]
931927 congr 1
932- rw [← Zipper.prependMap_of_pruneLE_eq_prependMapGE ]
928+ rw [← Zipper.prependMap_pruneLE_eq_prependMapGE ]
933929 . rw [Zipper.toList_prependMap_eq_append]
934930 rw [Impl.toList_pruneLE]
935931 . simp only [Zipper.toList, List.append_nil]
936932 . exact t_ord
937933 . exact t_ord
938- . rw [← Zipper.prependMap_of_pruneLE_eq_prependMapGE ]
934+ . rw [← Zipper.prependMap_pruneLE_eq_prependMapGE ]
939935 . simp only [Zipper.toList_prependMap_eq_append, Zipper.toList, List.append_nil]
940936 rw [Impl.toList_pruneLE]
941937 . apply List.Pairwise.filter
@@ -1203,7 +1199,7 @@ theorem toList_rciIter {α β} [Ord α] [TransOrd α]
12031199 have := @Zipper.toList_iter _ _ (Zipper.prependMapGE t lowerBound Zipper.done)
12041200 simp only [Zipper.iter] at this
12051201 simp only [this]
1206- rw [← Zipper.prependMap_of_pruneLE_eq_prependMapGE ]
1202+ rw [← Zipper.prependMap_pruneLE_eq_prependMapGE ]
12071203 . simp only [Zipper.toList_prependMap_eq_append, Zipper.toList, List.append_nil]
12081204 apply Impl.toList_pruneLE
12091205 exact t_ord
@@ -1258,7 +1254,7 @@ public theorem toList_rci {α : Type u} {β : Type v} [Ord α] [TransOrd α] (t
12581254 have := @Zipper.toList_iter _ _ (Zipper.prependMapGE t lowerBound Zipper.done)
12591255 simp only [Zipper.iter] at this
12601256 simp only [this]
1261- rw [← Zipper.prependMap_of_pruneLE_eq_prependMapGE ]
1257+ rw [← Zipper.prependMap_pruneLE_eq_prependMapGE ]
12621258 . simp [Zipper.toList_prependMap_eq_append]
12631259 rw [Impl.toList_pruneLE]
12641260 simp [Impl.toList_eq_toListModel]
0 commit comments