For an exercise in software foundation I want to prove the following theorem :
Theorem rev_pal {X:Type} : forall (l:list X), l = rev l -> pal l.
pal is defined as follow :
Inductive pal {X:Type} : list X -> Prop :=
| pal_nil : pal []
| pal_one : forall x, pal [x]
| pal_rec : forall x l, pal l -> pal (snoc(x:: l) x).
However to proove this I want to use a lemma using exists
to say for exemple something like :
foral (l l':list X) (a b:X), a::l = l' ++[b] -> (a=b /\ l=[]) \/ exists k, l = k ++ [b].
In fact, I want to mention something little than l. But using the destruct
tactic doesn't seems to help.
Why I don't want to use exists
is because during the reading of the book software foundation, we don't have seen yet exists
. Of course, one could tell me that exists
can be seen as a forall
, but it's hard to use in this form.
So how to prove this theorem without a such lemma ? I'm stuck.