【发布时间】:2020-02-13 18:15:54
【问题描述】:
我试图证明various definitions of the reflexive-transitive closure 是等价的。这是有效的代码:
Require Import Coq.Relations.Relation_Definitions.
Require Import Coq.Relations.Relation_Operators.
Hint Constructors clos_refl_trans.
Hint Constructors clos_refl_trans_1n.
Lemma clos_refl_trans_1n_right:
forall {A: Type} {R: relation A} (x y: A),
clos_refl_trans A R x y -> clos_refl_trans_1n A R x y.
Proof.
intros A R x y H.
induction H as [ | | x y z _ IH1 _ IH2]; eauto.
induction IH1; eauto.
Qed.
注意下划线表示丢弃的变量。如果我给这些变量起名字,自动化就会失败:
Lemma clos_refl_trans_1n_right:
forall {A: Type} {R: relation A} (x y: A),
clos_refl_trans A R x y -> clos_refl_trans_1n A R x y.
Proof.
intros A R x y H.
induction H as [ | | x y z H1 IH1 H2 IH2]; eauto.
induction IH1; eauto. (* three subgoals left *)
Fail Qed.
经过检查,我们发现第二个例子中的内归纳假设较弱。看起来归纳策略正在检测有问题的假设与内部归纳对象之间的幕后依赖关系。
这在任何地方都有记录吗?原因是什么,我如何预测它会发生?
【问题讨论】:
标签: coq coq-tactic