Logic Coq中的谓词逻辑
关于谓词逻辑和使用coq,有人能帮助我们理解这两个定理吗。我很难理解coq语法Logic Coq中的谓词逻辑,logic,coq,Logic,Coq,关于谓词逻辑和使用coq,有人能帮助我们理解这两个定理吗。我很难理解coq语法 存在x:D,(rx/\sx)|-(存在y:D,ry)/\(存在z:D,sz) 存在x:D,(rx\/sx)|-(存在y:D,ry)\/(存在z:D,sz) 如果我理解得很好,那么您要寻找的是证明,如果一个元素同时满足两个道具,那么有一个特定的元素满足每个道具: Lemma and : forall (D:Type)(R S:D -> Prop), (exists x:D, (R x /\ S x)) ->
如果我理解得很好,那么您要寻找的是证明,如果一个元素同时满足两个道具,那么有一个特定的元素满足每个道具:
Lemma and : forall (D:Type)(R S:D -> Prop),
(exists x:D, (R x /\ S x)) -> (exists y:D, R y) /\ (exists z:D, S z).
如果一个元素满足至少一个道具,则对于其中一个道具,存在满足它的元素:
Lemma or : forall (D:Type)(R S:D -> Prop),
(exists x:D, (R x \/ S x)) -> (exists y:D, R y) \/ (exists z:D, S z).
证明将非常简单,如下所示:
Lemma and : forall (D:Type)(R S:D -> Prop),
(exists x:D, (R x /\ S x)) -> (exists y:D, R y) /\ (exists z:D, S z).
Proof.
intros. destruct H. destruct H as [H1 H2].
split; exists x; [apply H1 | apply H2].
Qed.
Lemma or : forall (D:Type)(R S:D -> Prop),
(exists x:D, (R x \/ S x)) -> (exists y:D, R y) \/ (exists z:D, S z).
Proof.
intros. destruct H.
destruct H; [left | right]; exists x; apply H.
Qed.