1

I am working through Software Foundations, and am currently on the IndProp section. Note: I'm doing this alone, this isn't homework.

I am still struggling to get my mind around how to work with these inductive types.

In the process of proving the pumping lemma (which I failed at :|), I tried to prove some lemmas...these lemmas ended up being unnecessary, but it still feels like they should be provable.

Lemma start_to_exists: forall (T:Type) (re: @reg_exp T) (s: list T),
  s =~ Star re -> exists (s':list T), s' =~ re.

Edit: per the comments, it was noted thtat start_to_exists can't be proven because of EmptySet. If we added a hypothesis that re isn't EmptySet, then I think it could be, yes? I guess I'm mainly interested in how to prove such propositions, because I wasn't able to figure out how to "use" Star re.

Lemma star_empty_is_empty: forall (T:Type) (s:list T),
  s =~ Star EmptyStr -> s =~ EmptyStr.

Lemma star_empty: forall (T:Type) (s:list T),
  s =~ Star EmptyStr -> s = [].

They're all fairly similar, really: trying to use the nature of star to tell us something about the nature of s. inversion doesn't seem to get me anywhere, because the Star definition will just unwrap to more Stars.

While I ended up looking up an answer to the pumping lemma and have moved on, I feel like understanding where I'm going wrong with the above proofs will help me work better with these sorts of types.

A Question Asker
  • 3,339
  • 7
  • 31
  • 39

1 Answers1

0

The stub of the solution of the weak pumping lemma in SF shows that you need induction to solve it. If you use just inversion, as you noted, you will end up getting more hypotheses with Star, which will not get you far.

Arthur Azevedo De Amorim
  • 23,012
  • 3
  • 33
  • 39