如何在Coq中写∀x(P(x)和Q(x))?

时间:2009-04-15 18:03:22

标签: logic predicate proof coq

我正在尝试Coq,但我不完全确定我在做什么。是:

Theorem new_theorem : forall x, P:Prop /\ Q:Prop

相当于:

∀x ( P(x) and Q(x) )

编辑:我认为他们是。

2 个答案:

答案 0 :(得分:3)

您是否遇到语法问题?

$ coqtop
Welcome to Coq 8.1pl3 (Dec. 2007)

Coq < Section Test.

Coq < Variable X:Set.
X is assumed

Coq < Variables P Q:X -> Prop.
P is assumed
Q is assumed

Coq < Theorem forall_test: forall x:X, P(x) /\ Q(x).
1 subgoal

  X : Set
  P : X -> Prop
  Q : X -> Prop
  ============================
   forall x : X, P x /\ Q x

forall_test < 

答案 1 :(得分:2)

好吧,回答你的问题:

Section test.

  Variable A : Type.           (* assume some universe A *)
  Variable P Q : A -> Prop.    (* and two predicates over A, P and Q *)

  Goal forall x, P x /\ Q x.   (* Ax, ( P(x) and Q(x) ) *)

End test.