[英]How to prove logical equivalence in Coq?
如何使用Coq证明以下内容?
(q V p)∧(¬p-> q)<->(p V q)。
我的尝试
Lemma work: (forall p q: Prop, (q \/ p)/\(~p -> q) <-> (p \/ q)).
Proof.
intros p q.
split.
intros q_or_p_and_not_p_implies_q.
intros p_or_q.
split.
这是一个非常相似的陈述的证明。 将第一个p \\/ q
交换为q \\/ p
需要更多的工作,以便与您给出的语句匹配。
Theorem work : (forall p q : Prop, (p \/ q) /\ (~p -> q) <-> (p \/ q)).
Proof.
intros p q.
split.
(* Prove the "->" direction *)
intros given.
destruct given as [p_or_q _].
exact p_or_q.
(* Prove the "<-" direction *)
intros p_or_q.
refine (conj p_or_q _).
case p_or_q.
(* We're given that p is true, so ~p implies anything *)
intros p_true p_false.
case (p_false p_true).
(* We're given that q is true *)
intros q_true p_false.
exact q_true.
Qed.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.