- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in Mathlib
For each pair of naturals \((a, b) \ne (0, 0)\), the formulas \(c = (a^2 - b^2)/(a^2 + b^2)\) and \(s = 2ab/(a^2 + b^2)\) yield a rational point on the unit circle. Enumerating such pairs up to a resolution depending on a target maximum angle change yields a finite rational grid on the unit circle.
Given a finite list of candidate worms \(W\) and a finite list of isometries \(I\), a set \(M\) is a \((W, I)\)-approximate Moser set if for every \(w \in W\) there exists \(\varphi \in I\) with \(\varphi (w) \subseteq M\).
Three concrete convex polygons are fixed as benchmark worms:
the isosceles right triangle with legs of length \(1/2\),
the unit square with side \(1/3\),
the right triangle with legs \(1/3\) and \(2/3\).
The initial worm is taken to be the isosceles right triangle; by convention every candidate Moser set in the working set contains an un-shifted copy of it. Its area is exactly \(1/8\).
cleanup is the composition of big-set removal and superset removal. addWormAndCleanup adds a worm and then cleans up.
A point lies in a convex polygon iff it lies in every edge half-space. A convex polygon \(P\) is a subset of \(Q\) iff every vertex of \(P\) lies in \(Q\).
A convex polygon is a non-degenerate polygon in which, for every directed edge \(V_i \to V_{i+1}\), every other vertex lies strictly to the left of the edge. Strictness excludes collinear triples and therefore makes every vertex an extreme point of the convex hull of \(\{ V_i\} \).
The function convexHullRationalPoints returns, from a finite list of rational points, a list of extreme points in counterclockwise order starting at the lexicographically smallest point. ConvexPolygon.ofList upgrades this to an Option ConvexPolygon, returning none when fewer than three extreme points remain.
For a granularity \(\epsilon {\gt} 0\), we form a finite list of direct isometries by pairing each angle from angleGrid with each translation on a rational grid intersected with the LocationRange (Definition 29). The angle resolution is scaled by the distance cutoff so that far-away points are still covered finely.
A (closed, resp. open) half-space is specified by a basepoint \(b \in \mathbb {Q}^2\) and a nonzero inward normal \(n \in \mathbb {Q}^2\); a point \(p\) belongs to the half-space iff \(n \cdot (p - b) \ge 0\) (resp. \({\gt} 0\)).
A line is a basepoint together with a nonzero direction vector. Two nonparallel lines have a unique intersection point, computed by Cramer’s rule.
Let \(\sigma := 4 A_*\). The location range is the square \([-\sigma , \sigma ]^2\), which upper-bounds the positions where a point of a working-set polygon may lie without already exceeding the area threshold (via a triangle formed with the initial worm). The distance cutoff is \(\sigma \cdot \overline{\sqrt{2}}\), where \(\overline{\sqrt{2}} = 1414213562373095/10^{15}\) is a rational upper bound on \(\sqrt2\).
The minimum area in a working set is the minimum of the shoelace areas of its polygons (taken as \(0\) on the empty set).
A set \(M \subseteq \mathbb {R}^2\) is a Moser set if for every worm \(w\) of unit length there exists a direct isometry \(\varphi \) with \(\varphi (w) \subseteq M\).
For \(u, v \in \mathbb {Q}^2\) we define \(u \times v = u_0 v_1 - u_1 v_0\), \(u \cdot v = u_0 v_0 + u_1 v_1\), and \(\lVert v\rVert ^2 = v_0^2 + v_1^2\).
A worm can be scaled by any rational factor; scaling by \(1/\ell \) where \(\ell \) is the approximate length brings the worm to approximately unit length. A unit worm bundles a worm together with a uniform bound ensuring the approximate length tends to \(1\) as \(\epsilon \to 0\).
The area of a convex polygon with vertex list \((V_0, \ldots , V_{n-1})\) is
Given \(s \ge 0\) and \(\epsilon {\gt} 0\), the Newton iteration \(x_{n+1} = (x_n + s/x_n)/2\) produces a rational \(r\) with \(|r - \sqrt{s}| {\lt} \epsilon \). Applied componentwise, this yields a rational approximation distanceApprox of the Euclidean distance between two rational points.
Given distinct points \(p_1, p_2 \in \mathbb {Q}^2\), the half-space strictly (resp. weakly) to the left of the directed segment \(p_1 \to p_2\) uses basepoint \(p_1\) and normal \(R(p_2 - p_1)\).
A working set is a list of convex polygons. Intended invariants:
every polygon in the list contains a copy of the initial worm (Definition 28) under some direct isometry;
every Moser set of area strictly less than \(A_*\) contains a copy of some polygon in the list under some direct isometry.
Invariant 1 is currently a convention maintained by construction; Invariant 2 is the core correctness statement the algorithm preserves.
The convex hull of a worm is a convex polygon (when the worm has at least three non-collinear vertices); it summarises all rigid motions of the worm that embed it into a convex target.
Given an additional worm presented as a convex hull, for each polygon \(p\) in the current working set and for each isometry \(\varphi \) in the discretisation, form the convex hull of \(p\) together with the image under \(\varphi \) of the shrunk hull (to absorb discretisation error). The new working set collects all such unions. This step encodes the requirement that a Moser set must contain this worm in some pose.
Every \((c, s)\) produced by angleGrid satisfies \(c^2 + s^2 = 1\).
The action of a direct isometry on \(\mathbb {Q}^2\) is both injective and surjective.
For all \(v \in \mathbb {Q}^2\), \(\lVert v\rVert ^2 \ge 0\), with strict inequality when \(v \ne 0\).
Any convex polygon containing the initial worm as well as a point outside the location range has area strictly greater than \(A_*\).
If a working set satisfies Invariant 2, so does the result of superset removal.
A finite list of worms ending the iteration with the empty working set can be found by computer search, e.g. starting from the benchmark worms of Definition 28 and augmenting with further worms arising from the enumeration scheme in Moser.Worm.Enumeration (currently stubbed).
There exists a finite list of worms \(W\) and a sequence of working-set updates that, starting from Definition 38 and adding the worms in \(W\) in turn using Definition 46, terminates with the empty working set. Consequently the area of every Moser set is at least \(A_*\):