@@ -7945,14 +7945,14 @@ end Const
79457945
79467946end map
79477947
7948- theorem prune_LE_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α β) (ord_t : t.Ordered) (lower_bound : α) :
7949- (t.prune_LE ord_t lower_bound ).toList = t.toList.filter (fun e => (compare e.fst lower_bound ).isGE) := by
7948+ theorem pruneLE_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α β) (ord_t : t.Ordered) (lowerBound : α) :
7949+ (t.pruneLE lowerBound ).toList = t.toList.filter (fun e => (compare e.fst lowerBound ).isGE) := by
79507950 induction t
79517951 case leaf =>
7952- simp only [prune_LE , toList_eq_toListModel, toListModel_leaf, List.filter_nil]
7952+ simp only [pruneLE , toList_eq_toListModel, toListModel_leaf, List.filter_nil]
79537953 case inner _ k v l r l_ih r_ih =>
7954- simp only [prune_LE , toList_eq_toListModel, toListModel_inner, List.filter_append]
7955- generalize heq : compare lower_bound k = x
7954+ simp only [pruneLE , toList_eq_toListModel, toListModel_inner, List.filter_append]
7955+ generalize heq : compare lowerBound k = x
79567956 cases x
79577957 case lt =>
79587958 simp only [toListModel_inner]
@@ -7972,7 +7972,7 @@ theorem prune_LE_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α
79727972 simp only [toListModel_inner, toListModel_leaf, List.nil_append, List.filter]
79737973 rw [OrientedCmp.eq_comm] at heq
79747974 simp only [heq, Ordering.isGE_eq]
7975- suffices new_goal : List.filter (fun e => (compare e.fst lower_bound ).isGE) l.toListModel = [] from by
7975+ suffices new_goal : List.filter (fun e => (compare e.fst lowerBound ).isGE) l.toListModel = [] from by
79767976 simp only [new_goal, List.nil_append, List.cons.injEq, true_and]
79777977 symm
79787978 apply List.filter_eq_self.2
@@ -7989,23 +7989,25 @@ theorem prune_LE_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α
79897989 simp only [List.filter]
79907990 rw [OrientedOrd.eq_swap, Ordering.swap_eq_gt] at heq
79917991 rw [heq]
7992- suffices new_goal : List.filter (fun e => (compare e.fst lower_bound).isGE) l.toListModel = [] from by
7993- simp only [new_goal, Ordering.isGE_lt, List.nil_append]
7992+ simp
7993+ suffices new_goal : List.filter (fun e => (compare e.fst lowerBound).isGE) l.toListModel = [] from by
7994+ simp only [new_goal, List.nil_append]
79947995 simp only [toList_eq_toListModel] at r_ih
79957996 apply r_ih
7997+ exact Internal.Impl.Ordered.right ord_t
79967998 rw [List.filter_eq_nil_iff]
79977999 intro a mem
79988000 simp only [Bool.not_eq_true, Ordering.isGE_eq_false]
79998001 exact TransCmp.lt_trans (Internal.Impl.Ordered.compare_left ord_t mem) heq
80008002
8001- theorem prune_LT_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α β) (ord_t : t.Ordered) (lower_bound : α) :
8002- (t.prune_LT ord_t lower_bound ).toList = t.toList.filter (fun e => (compare e.fst lower_bound ).isGT) := by
8003+ theorem pruneLT_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α β) (ord_t : t.Ordered) (lowerBound : α) :
8004+ (t.pruneLT lowerBound ).toList = t.toList.filter (fun e => (compare e.fst lowerBound ).isGT) := by
80038005 induction t
80048006 case leaf =>
8005- simp only [prune_LT , toList_eq_toListModel, toListModel_leaf, List.filter_nil]
8007+ simp only [pruneLT , toList_eq_toListModel, toListModel_leaf, List.filter_nil]
80068008 case inner _ k v l r l_ih r_ih =>
8007- simp only [prune_LT , toList_eq_toListModel, toListModel_inner, List.filter_append]
8008- generalize heq : compare lower_bound k = x
8009+ simp only [pruneLT , toList_eq_toListModel, toListModel_inner, List.filter_append]
8010+ generalize heq : compare lowerBound k = x
80098011 cases x
80108012 case lt =>
80118013 simp
@@ -8025,8 +8027,8 @@ theorem prune_LT_eq_filter {α β} [Ord α] [TransOrd α] (t : Internal.Impl α
80258027 simp only [List.filter]
80268028 rw [OrientedCmp.eq_comm] at heq
80278029 rw [heq]
8028- suffices new_goal : List.filter (fun e => (compare e.fst lower_bound ).isGT) l.toListModel = [] ∧
8029- List.filter (fun e => (compare e.fst lower_bound ).isGT) r.toListModel = r.toListModel from by
8030+ suffices new_goal : List.filter (fun e => (compare e.fst lowerBound ).isGT) l.toListModel = [] ∧
8031+ List.filter (fun e => (compare e.fst lowerBound ).isGT) r.toListModel = r.toListModel from by
80308032 simp only [new_goal, Ordering.isGT_eq, List.nil_append]
80318033 apply And.intro
80328034 . rw [List.filter_eq_nil_iff]
0 commit comments