@@ -101,8 +101,8 @@ private theorem qpartition_loop_perm (as : Vector α n)
101101 fun_induction qpartition.loop with grind
102102
103103@[local grind]
104- private theorem qpartition_perm (as : Vector α n) (w : lo ≤ hi)
105- (hlo : lo < n := by omega ) (hhi : hi < n := by omega ) :
104+ private theorem qpartition_perm
105+ (as : Vector α n) (w : lo ≤ hi ) (hlo : lo < n) (hhi : hi < n ) :
106106 (qpartition as lt lo hi).2 ~ as := by
107107 unfold qpartition
108108 refine Vector.Perm.trans (qpartition_loop_perm ..) ?_
@@ -111,22 +111,10 @@ private theorem qpartition_perm (as : Vector α n) (w : lo ≤ hi)
111111 | grind
112112 | refine Vector.Perm.trans (Vector.swap_perm ..) ?_
113113
114- private theorem qsort_sort_perm (as : Vector α n) (lo hi : Nat) (w : lo ≤ hi)
115- (hlo : lo < n) (hhi : hi < n) :
114+ private theorem qsort_sort_perm
115+ (as : Vector α n) (w : lo ≤ hi) ( hlo : lo < n) (hhi : hi < n) :
116116 qsort.sort lt as lo hi w hlo hhi ~ as := by
117- -- TODO: try `fun_induction` here,
118- -- but only after `fun_induction` takes care of more unfolding and splitting!
119- unfold qsort.sort
120- split
121- · split
122- rename_i as' h
123- obtain rfl := (show as' = (qpartition as lt lo hi ..).2 by simp [h])
124- split
125- · apply qpartition_perm
126- · refine Vector.Perm.trans (qsort_sort_perm ..) ?_
127- refine Vector.Perm.trans (qsort_sort_perm ..) ?_
128- grind
129- · grind
117+ fun_induction qsort.sort with grind
130118
131119grind_pattern qsort_sort_perm => qsort.sort lt as lo hi w hlo hhi
132120
0 commit comments