【发布时间】:2019-05-28 21:59:43
【问题描述】:
我试图证明以下引理:
Inductive even : nat → Prop :=
| ev_0 : even 0
| ev_SS (n : nat) (H : even n) : even (S (S n)).
Lemma even_Sn_not_even_n : forall n,
even (S n) <-> not (even n).
Proof.
intros n. split.
+ intros H. unfold not. intros H1. induction H1 as [|n' E' IHn].
- inversion H.
- inversion_clear H. apply IHn in H0. apply H0.
+ unfold not. intros H. induction n as [|n' E' IHn].
-
Qed.
这是我最后得到的:
1 subgoal (ID 173)
H : even 0 -> False
============================
even 1
我希望 coq 将“偶数 0”评估为真,将“偶数 1”评估为假。我试过simpl,apply ev_0 in H.,但他们给出了一个错误。怎么办?
【问题讨论】:
-
你还没有向我们展示
even的定义。 -
@Perry 添加了定义。