Skip to content

Commit 200191b

Browse files
committed
chore: more elementary Motzkin polynomial proof (leanprover-community#28482)
In leanprover-community#23170 @Parcly-Taxel proved that the Motzkin polynomial over the reals is nonnegative. This PR switches the proof to a more elementary one that works over all linearly ordered commutative rings. Also move out of `Analysis/MeanInequalities` (since it no longer uses that tool).
1 parent 35529d0 commit 200191b

File tree

3 files changed

+33
-15
lines changed

3 files changed

+33
-15
lines changed

Counterexamples.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Counterexamples.IrrationalPowerOfIrrational
1212
import Counterexamples.LinearOrderWithPosMulPosEqZero
1313
import Counterexamples.MapFloor
1414
import Counterexamples.MonicNonRegular
15+
import Counterexamples.Motzkin
1516
import Counterexamples.OrderedCancelAddCommMonoidWithBounds
1617
import Counterexamples.Phillips
1718
import Counterexamples.Pseudoelement

Counterexamples/Motzkin.lean

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/-
2+
Copyright (c) 2025 Jeremy Tan. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Jeremy Tan, Heather Macbeth
5+
-/
6+
import Mathlib.Tactic.LinearCombination
7+
import Mathlib.Tactic.Positivity
8+
9+
/-!
10+
# The Motzkin polynomial
11+
12+
The Motzkin polynomial is a well-known counterexample: it is nonnegative everywhere, but not
13+
expressible as a polynomial sum of squares.
14+
15+
This file contains a proof of the first property (nonnegativity).
16+
17+
TODO: prove the second property.
18+
-/
19+
20+
variable {K : Type*} [CommRing K] [LinearOrder K] [IsStrictOrderedRing K]
21+
22+
/-- The **Motzkin polynomial** is nonnegative.
23+
This bivariate polynomial cannot be written as a sum of squares. -/
24+
lemma motzkin_polynomial_nonneg (x y : K) :
25+
0 ≤ x ^ 4 * y ^ 2 + x ^ 2 * y ^ 4 - 3 * x ^ 2 * y ^ 2 + 1 := by
26+
by_cases hx : x = 0
27+
· simp [hx]
28+
have h : 0 < (x ^ 2 + y ^ 2) ^ 2 := by positivity
29+
refine nonneg_of_mul_nonneg_left ?_ h
30+
have H : 0 ≤ (x ^ 3 * y + x * y ^ 3 - 2 * x * y) ^ 2 * (1 + x ^ 2 + y ^ 2)
31+
+ (x ^ 2 - y ^ 2) ^ 2 := by positivity
32+
linear_combination H

Mathlib/Analysis/MeanInequalities.lean

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -327,21 +327,6 @@ theorem geom_mean_le_arith_mean4_weighted {w₁ w₂ w₃ w₄ p₁ p₂ p₃ p
327327
⟨p₂, hp₂⟩ ⟨p₃, hp₃⟩ ⟨p₄, hp₄⟩ <|
328328
NNReal.coe_inj.1 <| by assumption
329329

330-
/-- As an example application of AM-GM we prove that the **Motzkin polynomial** is nonnegative.
331-
This bivariate polynomial cannot be written as a sum of squares. -/
332-
lemma motzkin_polynomial_nonneg (x y : ℝ) :
333-
0 ≤ x ^ 4 * y ^ 2 + x ^ 2 * y ^ 4 - 3 * x ^ 2 * y ^ 2 + 1 := by
334-
have nn₁ : 0 ≤ x ^ 4 * y ^ 2 := by positivity
335-
have nn₂ : 0 ≤ x ^ 2 * y ^ 4 := by positivity
336-
have key := geom_mean_le_arith_mean3_weighted (by simp) (by simp) (by simp)
337-
nn₁ nn₂ zero_le_one (add_thirds 1)
338-
rw [one_rpow, mul_one, ← mul_rpow nn₁ nn₂, ← mul_add, ← mul_add,
339-
show x ^ 4 * y ^ 2 * (x ^ 2 * y ^ 4) = (x ^ 2) ^ 3 * (y ^ 2) ^ 3 by ring,
340-
mul_rpow (by positivity) (by positivity),
341-
← rpow_natCast _ 3, ← rpow_mul (sq_nonneg x), ← rpow_natCast _ 3, ← rpow_mul (sq_nonneg y),
342-
show ((3 : ℕ) * ((1 : ℝ) / 3)) = 1 by simp, rpow_one, rpow_one] at key
343-
linarith
344-
345330
end Real
346331

347332
end GeomMeanLEArithMean

0 commit comments

Comments
 (0)