Coq 证明函数如何证明?
如果有人好心地向我解释在以下简单情况下如何使用证明函数,这将有助于我理解“程序/证明”的并行性:Coq 证明函数如何证明?,coq,Coq,如果有人好心地向我解释在以下简单情况下如何使用证明函数,这将有助于我理解“程序/证明”的并行性: Theorem ex1: forall n:nat, 7*5 < n -> 6*6 <= n. Proof. intros. assumption. Qed. 证明功能: ex1 = fun (n : nat) (H : 7 * 5 < n) => H : forall n : nat, 7 * 5 < n -> 6 * 6 <=
Theorem ex1: forall n:nat, 7*5 < n -> 6*6 <= n.
Proof.
intros.
assumption.
Qed.
证明功能:
ex1 = fun (n : nat) (H : 7 * 5 < n) => H
: forall n : nat, 7 * 5 < n -> 6 * 6 <= n
验证过程中是否执行了验证功能?如何使用其返回值?
ex1的返回值是all n:nat,7*5Theorem foo : True.
Proof.
assert (H : True -> True).
{ intros H'. exact H'. }
apply H.
exact I. (* I is a proof of True *)
Qed.
Print foo.
(* foo = let H : True -> True := fun H' : True => H' in
H I *)
Compute let H : True -> True := fun H' : True => H' in H I.
(* = I : True *)