@@ -114,8 +114,7 @@ private theorem Spec.mapFinIdxM_list_go [Monad m] [LawfulMonad m] [WPMonad m ps]
114114 | nil =>
115115 simp [List.mapFinIdxM.go]
116116 mvcgen
117- simp only [List.length_nil, Nat.zero_add] at hlen
118- simp_all
117+ grind
119118 | cons b bs ih =>
120119 simp only [List.mapFinIdxM.go]
121120 have hacc : acc.size < xs.length := by simp [List.length_cons] at hlen; omega
@@ -125,19 +124,9 @@ private theorem Spec.mapFinIdxM_list_go [Monad m] [LawfulMonad m] [WPMonad m ps]
125124 subst hb
126125 mvcgen
127126 mspec (hs acc.size _ hmot)
128- mframe
129- rename_i r h
130- obtain ⟨h_p, h_motive⟩ := h
131- mspec (ih _ (Array.size_push r ▸ h_motive) _)
132- . simp only [Array.size_push]
133- rw [List.drop_eq_getElem_cons hacc] at hsuff
134- exact List.cons_inj_right _ |>.mp ‹_›
135- . intro i hi
136- simp only [Array.size_push] at hi
137- simp only [Array.getElem_push]
138- split
139- . exact hprev i ‹_›
140- . simp_all [show i = acc.size by omega]
127+ mframe; rename_i h
128+ mspec ih _ (Array.size_push ‹_› ▸ h.2 ) _ <;>
129+ grind [List.drop_eq_getElem_cons]
141130
142131@[spec]
143132theorem Spec.mapFinIdxM_list [Monad m] [LawfulMonad m] [WPMonad m ps]
@@ -151,7 +140,7 @@ theorem Spec.mapFinIdxM_list [Monad m] [LawfulMonad m] [WPMonad m ps]
151140 xs.mapFinIdxM f
152141 ⦃(fun bs => ⌜motive xs.length ∧ ∃ eq : bs.length = xs.length, ∀ i h, p i bs[i] h⌝, exc)⦄ := by
153142 unfold List.mapFinIdxM
154- exact Spec.mapFinIdxM_list_go hs ( by simp) ( by simp [h0]) ( fun i hi => absurd hi ( by simp))
143+ apply Spec.mapFinIdxM_list_go <;> grind
155144
156145end Std.Do
157146
@@ -192,7 +181,7 @@ theorem anyM_iff_exists [Monad m] [LawfulMonad m] [WPMonad m ps]
192181 mframe
193182 rename_i hiff
194183 split <;> mpure_intro
195- case isTrue => exact ⟨⟨pref, cur :: suff, h.symm⟩, ( by simp), hiff.mp ‹_›⟩
184+ case isTrue => grind only
196185 intro c hsuff hlen
197186 simp only [List.length_append, List.length_singleton] at hlen
198187 by_cases hc : c.prefix.length < pref.length
0 commit comments