我正在嘗試使用可以輕鬆生成的術語(在此特定示例中,從tauto
)實例化存在量詞的策略。我第一次嘗試:使用特定證據實例化存在
Ltac mytac :=
match goal with
| |- (exists (_ : ?X), _) => cut X;
[ let t := fresh "t" in intro t ; exists t; firstorder
| tauto ]
end.
這種戰術將在一個簡單的問題,工作就像
Lemma obv1(X : Set) : exists f : X -> X, f = f.
mytac.
Qed.
但是它不會在一個目標的工作就像
Lemma obv2(X : Set) : exists f : X -> X, forall x, f x = x.
mytac. (* goal becomes t x = x for arbitrary t,x *)
在這裏,我想用這種策略,相信f
哪tauto
發現將只是fun x => x
,因此潛在的具體證明(應該是身份函數)和d不僅僅是我當前腳本中的通用t
。我可以怎樣去寫這種策略?
你碰巧知道是否有更強大的尋找統一者的策略?只是玩了一下似乎'eexists' +'eauto/tauto'方法不適用於具有多個實例的東西,比如引理two_ids(X:Set):存在fg:X - > X,forall x,f (gx)= x.'或者像Lemma const:forall(XY:Set)(y:Y)這樣的觸碰技巧,存在f:X - > Y,forall x x',fx = f x'.(所需的統一體是'fun _ => y') – user181407