I am reading/testing a proof in Coq
Theorem ceval_step__ceval: forall c st st',
(exists i, ceval_step st c i = Some st') -> c / st || st'.
The specific functions/definitions don't matter as they are not used. After a few steps, the theorem is transformed to a form where the inner existential quantifier is changed to a universal:
1 subgoals
______________________________________(1/1)
forall (c : com) (st st' : state) (i : nat),
ceval_step st c i = Some st' -> c / st || st'
This is basically,
Theorem ceval_step__ceval'': forall c st st', forall i
ceval_step st c i = Some st' -> c / st || st'.
Although this is not exactly replacing exists i
with forall i
verbatim, I am kind of surprised. I was wondering if this kind of replacing existential quantifier with universals always possible, or when is this possible? What's the general rule/technique for this conversion?
(I vaguely remember something called skolemization but didn't quite understand it when learning it.)
The steps in Coq (8.4) to transform the theorem are:
Proof.
intros c st st' H.
inversion H as [i E].
clear H.
generalize dependent i.
generalize dependent st'.
generalize dependent st.
generalize dependent c.