I am trying to prove the pumping Lemma (which is one of the exercises of the Logical Foundations book). I thought I had completed the MStarApp
case but the interpreter tells me that there are still unfocused goals remaining. Only I can't bring this remaining goal to the front. I tried every bullet level but each time I get [Focus] Wrong bullet: No more goals.
I don't know if something is wrong with my proof or if it's a bug in the interpreter. Any help would be much appreciated.
- (* MStarApp *)
intros.
destruct s1.
-- replace ([ ] ++ s2) with s2 in *. apply (IH2 H).
reflexivity.
-- pose proof (lt_ge_cases (length (x::s1)) (pumping_constant re)) as [
Hs1lt | Hs1ge].
--- exists [ ], (x::s1), s2. repeat split.
+ unfold not. intro. inversion H0.
+ simpl. simpl in Hs1lt.
apply n_lt_m__n_le_m in Hs1lt.
apply Hs1lt.
+ simpl. intro m.
apply (napp_star T m (x::s1) s2 re Hmatch1 Hmatch2).
--- unfold ge in Hs1ge. pose proof (IH1 Hs1ge) as [
s2' [s3' [s4' [Hxs1Eq [Hs3notEmpty [
Hlens2's3' Hnapp]]]]]].
exists s2', s3', (s4' ++ s2). repeat split.
+ rewrite Hxs1Eq. repeat rewrite <- app_assoc.
reflexivity.
+ assumption.
+ simpl. assumption.
+ intro m. pose proof Hnapp m.
replace (s2' ++ napp m s3' ++ s4' ++ s2) with
((s2' ++ napp m s3' ++ s4') ++ s2).
constructor.
++ assumption.
++ assumption.
++ repeat rewrite <- app_assoc. reflexivity.
(* 'There are unfocused goals.' *)
Edit: I don't know if this is relevant, but higher in my proof (in the MApp
case) I have an assert
whose closing curly bracket is highlighted in an unusual way (in yellow instead of green -- I am using the Coq language support extension in VSCode).