Skip to content

Commit fdee760

Browse files
menon-codesocfnash
authored andcommitted
feat: IMO 2000 Q2 (leanprover-community#40286)
Feat: adding IMO 2000 Q2. Formalizes a solution of IMO 2000 Q2 from [The Art of Problem Solving](https://artofproblemsolving.com/wiki/index.php?title=2000_IMO_Problems/Problem_2). See [this Zulip chat](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Feedback.20on.20first.20PR.20.28IMO.20problem.29/) Co-authored-by: Oliver Nash <github@olivernash.org>
1 parent fe67ead commit fdee760

2 files changed

Lines changed: 101 additions & 0 deletions

File tree

Archive.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import Archive.Imo.Imo1988Q6
3030
import Archive.Imo.Imo1994Q1
3131
import Archive.Imo.Imo1997Q3
3232
import Archive.Imo.Imo1998Q2
33+
import Archive.Imo.Imo2000Q2
3334
import Archive.Imo.Imo2001Q2
3435
import Archive.Imo.Imo2001Q3
3536
import Archive.Imo.Imo2001Q4

Archive/Imo/Imo2000Q2.lean

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
/-
2+
Copyright (c) 2026 Aditya Menon. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Aditya Menon
5+
-/
6+
import Mathlib.Algebra.Order.Archimedean.Real.Basic
7+
8+
/-!
9+
# IMO 2000 Q2
10+
11+
Let `A`, `B`, `C` be positive reals with `ABC = 1`. Prove that
12+
`(A - 1 + 1 / B)(B - 1 + 1 / C)(C - 1 + 1 / A) ≤ 1`.
13+
14+
## Solution
15+
16+
We follow the first solution from
17+
<https://artofproblemsolving.com/wiki/index.php?title=2000_IMO_Problems/Problem_2>.
18+
19+
We parametrize `A = x / y`, `B = y / z`, `C = z / x` where `x, y, z > 0`.
20+
This reduces the problem to proving `(x - y + z)(y - z + x)(z - x + y) ≤ 8xyz`.
21+
22+
We then reparametrize `x = q + r`, `y = r + p`, `z = p + q` where `p, q, r ∈ ℝ`,
23+
which transforms the inequality to `8pqr ≤ (q + r)(r + p)(p + q)`.
24+
25+
The proof splits into cases based on the signs of `p`, `q`, `r`.
26+
When all are positive, AM-GM gives the result.
27+
When at least one is negative or zero, the inequality is verified by sign analysis.
28+
29+
## Implementation notes
30+
31+
- The inequality is reduced via `A = x / y`, `B = y / z`, `C = z / x`, then the substitution
32+
`x = q + r`, `y = r + p`, `z = p + q`.
33+
- Helper lemmas prove `8pqr ≤ (p + q)(r + p)(q + r)` by AM-GM when `p, q, r > 0` and by sign
34+
analysis otherwise; the main proof closes with `grind`.
35+
36+
## References
37+
38+
* <https://artofproblemsolving.com/wiki/index.php?title=2000_IMO_Problems/Problem_2>
39+
40+
-/
41+
42+
namespace Imo2000Q2
43+
44+
/-- When `p`, `q`, `r > 0`, `8pqr ≤ (p + q)(r + p)(q + r)`, by writing the difference of squares as
45+
a sum of nonnegative squares. -/
46+
lemma eight_mul_le_prod_add_of_pos {p q r : ℝ} (p_pos : 0 < p)
47+
(q_pos : 0 < q) (r_pos : 0 < r) :
48+
8 * p * q * r ≤ (p + q) * (q + r) * (r + p) := by
49+
suffices 0 ≤ ((p + q) * (q + r) * (r + p)) ^ 2 - (8 * p * q * r) ^ 2 from
50+
le_of_sq_le_sq (le_of_sub_nonneg this) (by positivity)
51+
calc 0 ≤ (p * (q - r) ^ 2 + q * (r - p) ^ 2 + r * (p - q) ^ 2)
52+
* ((p + q) * (q + r) * (r + p) + 8 * p * q * r) := by positivity
53+
_ = ((p + q) * (q + r) * (r + p)) ^ 2 - (8 * p * q * r) ^ 2 := by ring
54+
55+
/-- When `p ≤ 0` but `q`, `r > 0` and both pairwise sums are positive, the left side is
56+
nonpositive so the inequality holds. -/
57+
lemma eight_mul_le_prod_add_of_nonpos {p q r : ℝ} (p_nonpos : p ≤ 0) (r_pos : 0 < r) (q_pos : 0 < q)
58+
(p_add_q_pos : 0 < p + q) (r_add_p_pos : 0 < r + p) :
59+
8 * p * q * r ≤ (p + q) * (r + p) * (q + r) := by
60+
calc 8 * p * q * r ≤ 0 := by grw [mul_nonpos_of_nonpos_of_nonneg ?_ (by positivity)]
61+
grw [mul_nonpos_of_nonpos_of_nonneg (by grind) (by positivity)]
62+
_ ≤ (p + q) * (r + p) * (q + r) := by positivity
63+
64+
/-- When all three pairwise sums `p + q`, `r + p`, `q + r` are positive, the inequality holds by
65+
casing on the signs of `p`, `q`, `r`. -/
66+
lemma eight_mul_le_prod_add_of_add_pos (p q r : ℝ)
67+
(hpq : 0 < p + q := by grind)
68+
(hqr : 0 < q + r := by grind)
69+
(hrp : 0 < r + p := by grind) :
70+
8 * p * q * r ≤ (p + q) * (q + r) * (r + p) := by
71+
rcases lt_or_ge 0 p with p_pos | p_nonpos <;>
72+
rcases lt_or_ge 0 q with q_pos | q_nonpos <;>
73+
rcases lt_or_ge 0 r with r_pos | r_nonpos
74+
-- At most one of `p`, `q`, `r` can be negative; otherwise some pairwise sum is nonpositive.
75+
· exact eight_mul_le_prod_add_of_pos p_pos q_pos r_pos
76+
· -- `r` is the unique nonpositive variable.
77+
convert eight_mul_le_prod_add_of_nonpos r_nonpos q_pos p_pos hrp hqr using 1 <;> ring
78+
· -- `q` is the unique nonpositive variable.
79+
convert eight_mul_le_prod_add_of_nonpos q_nonpos p_pos r_pos hqr hpq using 1 <;> ring
80+
· linarith
81+
· -- `p` is the unique nonpositive variable.
82+
convert eight_mul_le_prod_add_of_nonpos p_nonpos r_pos q_pos hpq hrp using 1; ring
83+
· linarith
84+
· linarith
85+
· linarith
86+
87+
/-- **IMO 2000 Q2**. If `A`, `B`, `C > 0` and `ABC = 1`, then
88+
`(A - 1 + 1 / B)(B - 1 + 1 / C)(C - 1 + 1 / A) ≤ 1`. -/
89+
theorem imo2000_q2 {A B C : ℝ}
90+
(A_pos : 0 < A) (B_pos : 0 < B) (C_pos : 0 < C) (h_prod : A * B * C = 1) :
91+
(A - 1 + 1 / B) * (B - 1 + 1 / C) * (C - 1 + 1 / A) ≤ 1 := by
92+
obtain ⟨x, y, z, x_pos, y_pos, z_pos, rfl, rfl, rfl⟩ :
93+
∃ x y z, 0 < x ∧ 0 < y ∧ 0 < z ∧ A = x / y ∧ B = y / z ∧ C = z / x :=
94+
⟨A, 1, 1 / B, by grind only [inv_pos]⟩
95+
-- If `x = q + r`, `y = r + p`, `z = p + q`, it suffices to show `8pqr ≤ (q + r)(r + p)(p + q)`.
96+
have := eight_mul_le_prod_add_of_add_pos ((y + z - x) / 2) ((z + x - y) / 2) ((x + y - z) / 2)
97+
field_simp
98+
grind
99+
100+
end Imo2000Q2

0 commit comments

Comments
 (0)