量词消除与屠杀竞赛问题
Slaughtering Competition Problems with Quantifier Elimination (2021)

原始链接: https://grossack.site/2021/12/22/qe-competition.html

## 使用Sage进行量词消去:强大的问题解决工具 这篇文章重点介绍了一种强大的解决不等式问题的技术,尤其是在竞赛数学中:**量词消去**。其核心思想是利用Tarski-Seidenberg定理,该定理指出,任何涉及多项式方程/不等式和量词(如“存在”或“对于所有”)的公式,都可以重写为等价的*不含*量词的公式。 这可以将复杂的问题简化为更简单的、可以直接验证的多项式不等式。作者展示了如何利用**SageMath**,特别是它与**QEPCAD**的接口,来自动化这个过程。 文章展示了示例,包括证明Math StackExchange问题中的一个不等式和验证等价条件。它强调,虽然最初需要设置(安装QEPCAD),但Sage使得应用这个定理出奇地简单。 作者鼓励读者探索这种方法来解决不等式问题,甚至使用坐标和Sage重新证明几何定理,将其描述为一种“屠杀”通常需要手动操作的问题的方法。最终,文章提倡拥抱计算工具以有效地解决数学挑战。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 用量词消除法解决竞争问题 (grossack.site) 6点 由 todsacerdoti 51分钟前 | 隐藏 | 过去 | 收藏 | 讨论 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

22 Dec 2021 - Tags: sage , featured

Anytime I see questions on mse that ask something “simple”, I feel a powerful urge to chime in with “a computer can do this for you!”. Obviously if you’re a researching mathematician you shouldn’t waste your time with something a computer can do for you, but when you’re still learning techniques (or, as is frequently the case on mse, solving homework problems), it’s not a particularly useful comment (so I usually abstain). The urge is particularly powerful when it comes to the contrived inequalities that show up in a lot of competition math, and today I saw a question that really made me want to say something about this! I still feel like it would be a bit inappropriate for mse, but thankfully I have a blog where I can talk about whatever I please :P So today, let’s see how to hit these problems with the proverbial nuke that is quantifier elimination!

I want this to be a fairly quick post, so I won’t go into too much detail. The gist is the following powerful theorem from model theory:

Tarski-Seidenberg Theorem

If $\varphi$ is any formula of the form

  • $p(\overline{x}) = 0$, for $p \in \mathbb{R}[\overline{x}]$
  • $p(\overline{x}) \lt 0$, for $p \in \mathbb{R}[\overline{x}]$
  • combinations of the above using $\lor$, $\land$, $\lnot$, $\to$
  • combinations of the above using $\exists$ and $\forall$

Then $\varphi$ is equivalent to a formula without quantifiers.

I’m legally required to give the following example:

The formula $\exists x . a x^2 + bx + c = 0$ (which has a quantifier) is equivalent to the formula $b^2 - 4ac \geq 0$

As a more complicated example, we have

\[\forall x . \exists y . (x > 0 \to ax + by + xy > c)\]

is equivalent to

\[b \geq 0 \ \lor \ c + ab \lt 0\]

Of course, this means if we want to know whether the above formula really is true for some choice of $a,b,c \in \mathbb{R}$, we can just plug into this quantifier free formula and check!

Now, you might be wondering: “How did you find this quantifier free expression?”, and the answer is, of course, sage! Sage has interfaces with a lot of pre-existing software, and for us the relevant interface is to QEPCAD, which will actually do quantifier elimination for us!

To get started, you have to make sure you have qepcad installed in a way that sage can access. You’ll want to run sage -i qepcad just in case (it wasn’t installed for me).

Next, let’s see how we eliminated quantifiers from the “more complicted example” above!

Yup. It’s that easy!

If you’re interested in reading more about this, you should check out the documentation, but I’m also going to give a handful of examples in the next section!


So then, let’s slaughter some competition problems!

First, the problem that made me write this post in the first place (here is the mse link again)

Let $a,b \geq 0$ with $a^4 + b^4 = 17$.

Prove $15(a+b) \geq 17 + 14 \sqrt{2ab}$

This isn’t given to us as polynomials, but of course it’s easy for us to fix that by rewriting it as

\[(15(a+b) - 17)^2 \geq 14^2 \cdot 2ab\]

then we simply ask sage:

We can extend this too. The asker conjectures that $(1,2)$ and $(2,1)$ are the only choices of $(a,b)$ for which we get equality. As a bonus, we can check this:

So we see that these really are the only points where equality holds!


Let’s take another example I remember seeing recently (the original mse link is here):

Let $x,y,z$ be positive real numbers. Show

\(\left ( x + \frac{1}{x} \right ) \left ( y + \frac{1}{y} \right ) \left ( z + \frac{1}{z} \right ) \geq \left ( x + \frac{1}{y} \right ) \left ( y + \frac{1}{z} \right ) \left ( z + \frac{1}{x} \right )\)

Again, we cannot plug this into sage directly, because it’s not a polynomial inequality. But multiplying through by $xyz$ on both sides solves that issue.

and even though the asker doesn’t mention it, one thing that Steele makes very clear in the (excellent) book The Cauchy-Schwarz Masterclass is that whenever working with a new inequality, we should ask where it’s sharp.

So we ask sage!

It turns out this inequality is sharp at infinitely many points, so instead of asking for the list of all points, we ask for a geometric description of the solution set.

Now, this admits some simplification, since we know that $x = y$ by the second line. I’ll leave it to you to figure out exactly what set this is if you’re interested.

As an exercise, you should be on the lookout for places to use this tool!

Next time somebody is asking about some wacky inequality, or really any question about sets definable by polynomial (in)equations in $\mathbb{R}^n$, you should think about whether you can slaughter the problem without much thought by asking a computer!

As a more concrete exercise to show the flexibility of this method, pick your favorite theorem in euclidean geometry. Rephrase it using coordinates, then ask sage if it’s true!

As a very concrete exercise, can you do this with Ptolemy’s Theorem?

Also, if you find yourself using this, definitely come back and let me know! I would love to hear about places where this comes up in the wild!

Also also, if you have other (possibly surprising) uses for sage or other programs that automatically answer ceretain problems, definitely let me know! This is one of the parts of mathematical logic that I get most geeky about!

See you next time ^_^


联系我们 contact @ memedata.com