Lemma pop_invariant: forall (symbols_to_pop symbols_popped:list symbol) (stack_cur:stack) (A:Type) (action:arrows_left (map symbol_semantic_type (rev_append symbols_to_pop symbols_popped)) A), forall word_stack word_popped, forall sem_popped, word_has_stack_semantics word_stack stack_cur -> inhabited (parse_tree_list symbols_popped word_popped sem_popped) -> let action' := eq_rect _ (fun x=>x) action _ (pop_invariant_converter _ _ _) in match pop symbols_to_pop stack_cur (uncurry action' sem_popped) with | OK (stack_new, sem) => exists word1res word2res sem_full, (word_stack = word1res ++ word2res)%list /\ word_has_stack_semantics word1res stack_new /\ sem = uncurry action sem_full /\ inhabited ( parse_tree_list (rev_append symbols_to_pop symbols_popped) (word2res++word_popped) sem_full) | Err => True end.