示例:
Require Import Basics.
Require Export Setoid.
Require Export Relation_Definitions.
Set Implicit Arguments.
Lemma simple1 (A B : Prop) (f : A -> B) (x : A) : B.
Proof.
assert (f2: impl A B) by exact f.
setoid_rewrite <- f2.
exact x.
Qed.
Lemma simple2 (A B : Prop) (f : A -> B) (x : A) : B.
Proof.
setoid_rewrite <- f.
exact x.
Qed.
simple1
有效,但是simple2
失败
Ltac call to "setoid_rewrite (orient) (glob_constr_with_bindings)" failed.
Ltac call to "setoid_rewrite (orient) (glob_constr_with_bindings)" failed.
Cannot find a relation to rewrite.
我想使用rewrite_strat
关系来模拟Hint Rewrite
,使用impl
/ apply
的鉴别树来编写自己的证明搜索。但是,如果我使用setoid_rewrite
而不是impl
重述引理,那么impl
仅适用于->
,这很烦人。有什么办法让setoid_rewrite
接受类型为A -> B
的引理并使用impl
关系?