【发布时间】:2018-09-17 10:32:12
【问题描述】:
这里是Coq初学者,我最近一个人看完了“Logical Foundations”的前7章。
我正在尝试通过 Coq 中的归纳来创建证明
∀ n>= 3, 2n+1 < 2^n.
我从destruct 开始删除错误假设,直到达到 n=3。
然后,我对 n 进行归纳,n=3 的情况很简单,但是,如何证明归纳步骤??
我可以看到目标成立。我可以使用destruct 进行案例分析来证明这一点,但无法以一般形式展示。
The functions I'm using are from "Logical Foundations" and can be seen here.
到目前为止我的证明:
(* n>=3, 2n+1 < 2^n *)
Theorem two_n_plus_one_leq_three_lt_wo_pow_n : forall n:nat,
(blt_nat (two_n_plus_one n) (exp 2 n)) = true
-> (bge_nat n 3) = true.
Proof.
intros n.
destruct n.
(* n = 0 *)
compute.
intros H.
inversion H.
destruct n.
(* n = 1 *)
compute.
intros H.
inversion H.
destruct n.
(* n = 2 *)
compute.
intros H.
inversion H.
induction n as [ | k IHk].
(* n = 3 *)
- compute.
reflexivity.
- rewrite <- IHk.
(* Inductive step... *)
【问题讨论】:
-
目前尚不清楚您要确切证明什么。证明
n>= 3, 2n+1 < 2^n没有任何意义。根据 Coq 代码,你想证明2n+1 < 2^n -> n >=3。不应该反过来吗? -
只是觉得可能值得一提的是,如果您执行
intros [|[|[|n]]],您可以一步完成所有这些destruct n。然后根据你已经写的内容,intros [|[|[|n]]]; try (compute; intro H; inversion H).应该能够创建并立即清除n=0,1,2案例。