This note supersedes my earlier submission [58pydx] by providing a Lean file without sorry placeholders.
Sunny lines covering a triangular lattice: only are possible
Problem
A line in the plane is called sunny if it is not parallel to any of the -axis, the -axis, and the line .
Let be an integer. Determine all nonnegative integers such that there exist distinct lines in the plane satisfying:
- for all positive integers with , the point lies on at least one of the lines;
- exactly of the lines are sunny.
Let
Answer
Constructions (existence)
Use the lines for .
Use and .
Use , , , and for .
Impossibility (only these )
Let be the boundary lattice points on the three sides of the convex hull triangle of : Then .
A line not containing an entire side of the triangle intersects the triangle boundary in at most two points, hence contains at most two points of . So if and none of the chosen lines is a side-line, at most points of could be covered, contradicting . Therefore, for , at least one chosen line is a side-line or or .
Deleting this (non-sunny) side-line and translating appropriately reduces a solution for to a solution for with the same number of sunny lines. Hence for , so for all .
A direct check for shows (in particular is impossible), completing the classification.
Lean4 / mathlib
The attached file SunnyLines.lean formalizes the three constructions (for ) and proves their coverage and sunny-count properties without sorry.