Automating the resolution of IMO 2025 Problem 1
Imported on
The forum classified this question as unanswered when collected. This does not certify an open research problem; check the answers and revision history at the source.
Read the question with its definitions and background below. The source provides the full formulation and further discussion; the glossary and Wikipedia links offer additional reading aids.
Problem statement
The problem 1 of the 2025 IMO is the following:
A line in the plane is called sunny if it is not parallel to any of the x-axis, the y-axis, and the line .
Let be a given integer.
Determine all nonnegative integers such that there exist distinct lines in the plane satisfying both of the following:
-
for all positive integers and with , the point is on at least one of the lines; and
-
exactly of the lines are sunny.
Warning: this post will spoil the solution.
I am interested here in the possibility of solving this problem in a fully automated way using deterministic solvers of some sort.
For specific values of , I was able to solve the problem using the Satisfiability Modulo Theories tool z3 and the following program:
from z3 import *
def solve_sunny_lines(n):
s = Solver()
lines = []
is_vertical = [Bool(f"v_{i}") for i in range(n)]
m = [Real(f"m_{i}") for i in range(n)]
c = [Real(f"c_{i}") for i in range(n)]
d = [Real(f"d_{i}") for i in range(n)]
is_sunny = [Bool(f"sunny_{i}") for i in range(n)]
for i in range(n):
s.add(
is_sunny[i] ==
And(
Not(is_vertical[i]),
m[i] != 0,
m[i] != -1
)
)
points = [(a, b) for a in range(1, n+1) for b in range(1, n+1) if a + b <= n + 1]
for (a, b) in points:
on_some_line = []
for i in range(n):
vertical_case = And(is_vertical[i], a == d[i])
non_vertical_case = And(Not(is_vertical[i]), b == m[i]*a + c[i])
on_some_line.append(Or(vertical_case, non_vertical_case))
s.add(Or(*on_some_line))
possible_k = []
for k in range(n+1):
s_k = Solver()
s_k.add(s.assertions())
s_k.add(Sum([If(is_sunny[i], 1, 0) for i in range(n)]) == k)
if s_k.check() == sat:
possible_k.append(k)
return possible_k
Which gives me:
>>> solve_sunny_lines(3)
[0, 1, 3]
>>> solve_sunny_lines(4)
[0, 1, 3]
>>> solve_sunny_lines(5)
[0, 1, 3]
>>> solve_sunny_lines(6)
[0, 1, 3]
This is a good hint for conjecturing the general solution . This conjecture can be proven by induction, e.g. using geometrical arguments (there are several solutions discussed at various places, see here for instance).
Question: is there a way to fully automate the resolution of the general case using a deterministic software tool (z3 or other)?
Naïvely, the best I could think of is:
-
Solving specific cases with some SMT tool like detailed above.
-
Formulating a conjecture in the form (*) where is a predicate (which I suppose might be) definable in Presburger arithmetic (since the problem involves natural numbers and no multiplication, but as mentioned in comment there are other difficulties...)
-
Since Presburger arithmetic is complete and decidable, we could (theoretically) algorithmically show (*) to be true.
Statement and context adapted from MathOverflow · Weier
CC BY-SA 4.0 · Formatting adapted; mathematical formulas preserved · Source history
Sources and original status
- MathOverflow Status in source : unanswered at collection
Last activity on the question :
Coverage, sources and method
This count measures imported entries, including distinct variants. It is not a count of all open mathematical questions worldwide. One entry may belong to several fields and sources.
This directory is neither exhaustive nor updated in real time. “Reported open” describes the source classification observed at import; imported entries have not each undergone independent mathematical verification. The 32 explained entries were reviewed separately.
Formal Conjectures: only “research open” statements with no reported formal proof are retained; their tag is checked in a pinned repository revision. Variants remain distinct. A “sorry” placeholder is not sufficient to establish open status.
Erdős: solved or independent problems and entries with a Lean solution are excluded, including “open (Lean)”. Exact matches to the main Formal Conjectures statements are merged.
Open Problem Garden: the open index is checked against the solved index; spam, identified clones and some outdated statuses are excluded. Statements and definition context are attributed to their original pages; formulas are preserved and the content remains under the GFDL. Recognized duplicates across sources are merged; this does not resolve every mathematical equivalence.
OEIS: direct extraction of conjectural comments and formulas, one entry per sequence, excluding mentioned resolutions. MathOverflow and Math Stack Exchange: questions classified as unanswered by their API, excluding closed posts and non-research categories. They remain distinct from problems reported open. This is a partial, dated collection; every entry credits its authors and license.
Documented exclusions account for recent announcements and conflicting statuses. A stronger variant or a special case can remain open after a different statement is settled.
Attribution: The Formal Conjectures Authors; teorth/erdosproblems and contributors; Open Problem Garden and contributors. Each source retains its license.
- Formal Conjectures · 1,924 · Apache-2.0 / CC-BY-4.0
- Erdős Problems (teorth) · 622 · Apache-2.0
- Open Problem Garden · 404 · GFDL (source content); only title/category/link metadata imported
- OEIS · 18,857 · CC BY-SA 4.0
- MathOverflow · 19,035 · CC BY-SA (version on each entry)
- Mathematics Stack Exchange · 35 · CC BY-SA (version on each entry)