【发布时间】:2013-09-29 20:58:11
【问题描述】:
我试图用 lambda 演算编码的 Coq 逻辑连接词,类型为 System F。这是我写的一堆代码(我认为是标准的东西)
Definition True := forall X: Prop, X -> X.
Lemma I: True.
Proof.
unfold True. intros. apply H.
Qed.
Section s.
Variables A B: Prop.
(* conjunction *)
Definition and := forall X: Prop, (A -> B -> X) -> X.
Infix "/\" := and.
Lemma and_intro: A -> B -> A/\B.
Proof.
intros HA HB. split.
apply HA.
apply HB.
Qed.
Lemma and_elim_l: A/\B -> A.
Proof.
intros H. destruct H as [HA HB]. apply HA.
Qed.
Lemma and_elim_r: A/\B -> B.
Proof.
intros H. destruct H as [HA HB]. apply HB.
Qed.
(* disjunction *)
Definition or := forall X:Prop, (A -> X) -> (B -> X) -> X.
Infix "\/" := or.
Lemma or_intro_l: A -> A\/B.
intros HA. left. apply HA.
Qed.
Lemma or_elim: forall C:Prop, A \/ B -> (A -> C) -> (B -> C) -> C.
Proof.
intros C HOR HAC HBC. destruct HOR.
apply (HAC H).
apply (HBC H).
Qed.
(* falsity *)
Definition False := forall Y:Prop, Y.
Lemma false_elim: False -> A.
Proof.
unfold False. intros. apply (H A).
Qed.
End s.
基本上,我写下了合取、析取、真假的排除和引入法则。我不确定是否正确地做事,但我认为事情应该这样工作。现在我想定义存在量化,但我不知道如何进行。有人有什么建议吗?
【问题讨论】:
-
一个小评论:假,and,or 已经是 Coq 的条款。您可能希望使用 other 来轻松区分您的构造和 Coq 的构造。
-
您还没有证明析取和合取定义的引入和消除原则。你已经证明了 Coq 的定义。您需要将您的符号放在
type_scope中以覆盖 Coq。
标签: logic coq impredicativetypes