在Coq中,destruct策略有多种用途,其中之一是分解存在式,即形为 exists x, P x 的假设或目标。destruct 还可以用于分解或还原与假设有关的逻辑表达式。
假设 ~ (exists x : X, ~ P x) 的含义是存在x使得 ~ P x,即存在至少一个x使P x为假。最好的方法是尝试证明它相反的情况,并将假设应用于推理过程中。这可以通过使用Coq的证明策略not exists来实现,即:
Theorem my_theorem : forall X : Type, ~ (exists x : X, ~ P x) -> forall (x : X), P x.
Proof.
intros X H x.
contradict H.
exists x.
intros Hnot.
contradict H.
exact Hnot.
Qed.
在这里,我们首先从假设 ~ (exists x : X, ~ P x) 开始,然后应用 not exists 技术,得到了一个新的存在性质 exists x : X, ~ P x ,接着我们在证明结束时应用最后一个理论技巧,即考虑使用'反证法”进行证明。然后,我们应用 not 策略以'假设前提”,并使用 exact证明。
最终,我们可以得到一个针对~ (exists x : X, ~ P x) 的证明。