coq:证明定理negb_不是来自教程
证明这一点是有意义的coq:证明定理negb_不是来自教程,coq,Coq,证明这一点是有意义的 Theorem negb_is_not : (forall a, Is_true (negb a) <-> (~(Is_true a))). 我想我错过了教程中一些重要的小东西。好的,经过一些重写,我能够写出以下证明: Theorem negb_is_not : (forall a, Is_true (negb a) <-> (~(Is_true a))). Proof. intros A. unfold iff. refine (co
Theorem negb_is_not : (forall a, Is_true (negb a) <-> (~(Is_true a))).
我想我错过了教程中一些重要的小东西。好的,经过一些重写,我能够写出以下证明:
Theorem negb_is_not : (forall a, Is_true (negb a) <-> (~(Is_true a))).
Proof.
intros A.
unfold iff.
refine (conj _ _).
case A.
simpl.
intros H.
case H.
simpl.
intros.
unfold not.
intros.
exact H0.
case A.
simpl.
unfold not.
intros.
refine (H _).
exact I.
simpl.
unfold not.
intros.
exact I.
Qed.
定理negbu不是:(对于所有a,是真的(negba)(~(是真的a)))。
证明。
介绍A。
展开iff。
精炼(联合)。
案例A。
简单。
介绍H。
案例H。
简单。
介绍。
不要展开。
介绍。
精确H0。
案例A。
简单。
不要展开。
介绍。
精炼(H)。
准确的I。
简单。
不要展开。
介绍。
准确的I。
Qed。
几句话:case
似乎只对结论起作用,你可以使用destruct
代替,它对结论和假设起作用;而不是展开iff。细化(conj).
,您可以使用更自然的拆分。
Theorem negb_is_not : (forall a, Is_true (negb a) <-> (~(Is_true a))).
Proof.
intros A.
unfold iff.
refine (conj _ _).
case A.
simpl.
intros H.
case H.
simpl.
intros.
unfold not.
intros.
exact H0.
case A.
simpl.
unfold not.
intros.
refine (H _).
exact I.
simpl.
unfold not.
intros.
exact I.
Qed.