【问题标题】:How to prove logical equivalence in Coq?如何在 Coq 中证明逻辑等价?
【发布时间】:2019-02-24 00:37:56
【问题描述】:

如何使用 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.

【问题讨论】:

    标签: logic logical-operators coq discrete-mathematics


    【解决方案1】:

    这是一个非常相似的陈述的证明。将第一个 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.
    

    【讨论】:

      猜你喜欢
      • 2019-07-25
      • 2021-12-17
      • 1970-01-01
      • 2017-06-08
      • 1970-01-01
      • 1970-01-01
      • 2016-04-30
      • 1970-01-01
      相关资源
      最近更新 更多