此证明可以使用单个omega
完成:
a : Z
b : Z
H : a > 1
H0 : b > 1
H1 : b = 1
H2 : a mod b = 0
============================
False
为什么? omega
在这里做了什么?由于H0
和H1
相互矛盾,不应该有可能证明什么吗?此外,这可以在没有omega
的情况下得到证明吗?怎么样?
答案 0 :(得分:5)
1-在此,omega
意识到H0
和H1
是矛盾的,并使用它们来生成False
的证明。通过将H1
重写为H0
(导致1 > 1
)直接显示此内容并不难,然后应用一些显示a > b -> a <> b
的引理,结果在1 <> 1
中,然后应用于我们的目标,从而产生新的目标1 = 1
,可由reflexivity
解除。很难描述 omega
如何详细工作,因为它背后有一个复杂的算法,可以处理大量类似的目标(粗略地说,{{ 3}})
2-是的。 H0
和H1
可用于证明任何内容,包括False
。这有时被称为Presburger arithmetic。但请注意,您只能在特定上下文中证明。换句话说,并不是因为你在某些证据上下文中存在矛盾,而是你能够证明其他任何。
答案 1 :(得分:3)
你可以通过展示它产生的证明术语来弄清楚任何策略的作用。
Require Import Omega.
Definition how : forall (a : Z), (a > 1)%Z -> (a = 1)%Z -> False.
intros.
omega.
Qed.
Print how.
(* Here are the library functions "how" uses on my machine: *)
Check fast_Zplus_assoc_reverse.
Check fast_Zred_factor0.
Check fast_OMEGA15.
Check fast_Zred_factor5.
Check OMEGA6.
Check Zegal_left.
Check Zgt_left.
你也可以在没有任何花哨的机器的情况下证明这一点:
Locate "_ > _".
Print Z.gt.
Locate "_ ?= _".
Print Z.compare.
Definition this : forall (a : Z), (a > 1)%Z -> (a = 1)%Z -> False.
Proof with (subst; simpl in *; auto).
intros...
unfold Z.gt in * ...
unfold Pos.compare in * ...
inversion H.
Qed.
Print this.
答案 2 :(得分:2)
如果您在Coq手册中查找omega
,则会看到Bill Pugh's "The Omega Test: a fast and practical integer programming algorithm for dependence analysis"的引用,该引用应该大致解释omega
正在做什么。