如何处理COQ的部门?
How to deal with with the division in a goal?
Because I have a goal which is clearly true... However I cannot use lia
and I think that this is related to the division.
2 ^ k / 2 ≤ 2 ^ k
Bellow is my COQ screen:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自然部门没有自动化 - 它们甚至没有形成一个领域。但是,搜索不难找到相应的引理:
如果您的术语确实很复杂,则可以使用
floor(a/b)
用于整数a/b ,然后使用COQ Interval。嵌入易于自动化,COQ Interval对于证明真实的不平等现象非常有力,但是如果您有多个楼层,则可能会扼杀。您可以将其与Coq-Gappa结合使用,然后摆脱地板。那时它已经很参与,但仍然完全自动化。但是请注意,它可能无法证明不平等,因为它使用了真实的分析。
nia
(要求导入psatz
),正如ANA所建议的那样,无法解决此问题(老实说,我停止尝试)。There is no automation for division on naturals - they don't even form a field. But the corresponding lemmas are not hard to find with Search:
If you have really complicated terms, you can embed the goal into reals using
floor (a/b)
for integera/b
and then use coq-interval. The embedding is easy to automate and coq-interval is quite powerful for proving real inequalities, but it might choke if you have more than a few floors. You can combine it with coq-gappa then to get rid of the floors. It gets quite involved then, but still fully automated. But be aware that it might not be able to prove very tight inequalities, since it uses real analysis.Nia
(Require Import Psatz
), as suggested by Ana, can't solve this (and I honestly stopped trying it).自然数的部门不像理性或真实的那样容易管理(思考
1/3 < / code>)。从中的一种方法可能是尝试用乘法重新构造约束。例如,
n&lt; M / p < / code>有时可以用作
n * p&lt; M
。否则,使用库进行理性可能是解决方案。Division on natural numbers is not as easy to manage as on rationals or reals (think
1 / 3
). One way out of this could be to try to reframe your constraints with multiplication instead; for instance,n < m / p
can sometimes be handled asn * p < m
. Otherwise, using a library for rationals could be a solution.