Unit circles through three of n points
Show that n points in the plane have only o(n²) unit circles passing through three of them; the best construction gives n^{3/2}.

| 1 | # Why the exact count is complete |
| 2 | |
| 3 | Let a,b,c be distinct noncollinear rational points. Put u=b-a, v=c-a, |
| 4 | D=u_x v_y-u_y v_x, U=u dot u and V=v dot v. The center a+d of their |
| 5 | circumcircle is characterized by |
| 6 | |
| 7 | 2 u dot d = U, 2 v dot d = V. |
| 8 | |
| 9 | Since D is nonzero, the unique solution is |
| 10 | |
| 11 | d_x = (U v_y - V u_y)/(2D), |
| 12 | d_y = (u_x V - v_x U)/(2D). |
| 13 | |
| 14 | Every operation is rational. The code computes these expressions with Fraction |
| 15 | and retains the center exactly when d_x^2+d_y^2=1. The equations imply that b |
| 16 | and c also have squared distance one from the center. Every retained center |
| 17 | therefore witnesses a genuine unit circle through three points (soundness). |
| 18 | |
| 19 | Conversely, any circle counted by the problem has three distinct input points. |
| 20 | They are noncollinear: a line meets a circle in at most two points. Their triple |
| 21 | is enumerated, its unique circumcenter is the desired center, and the exact |
| 22 | radius test passes (completeness). In particular, a circle through three rational |
| 23 | points has a rational center; rational arithmetic loses no circle of such an input. |
| 24 | |
| 25 | A unit circle is uniquely determined by its center. Reduced Fraction pairs have |
| 26 | exact equality and hashing. Storing centers in a set counts each circle once, |
| 27 | even with four or more incident points. The witness list checks every point |
| 28 | against each retained center using exact squared distance. |
| 29 | |
| 30 | Enumeration takes binomial(n,3) triples, followed by at most n(n-1)/3 centers |
| 31 | against n points: O(n^3) rational arithmetic operations, with bit cost depending |
| 32 | on input sizes. The input caps are operational limits. The pair bound used for |
| 33 | validation follows because each unordered point pair lies on at most two unit |
| 34 | circles, and each counted circle consumes at least three pair-circle incidences. |
| 35 | |
| 36 | This proves an enumeration method, not every implementation detail; the independent |
| 37 | oracle and hostile tests give additional implementation evidence. It proves no |
| 38 | maximum over configurations. Restricting submissions to rational coordinates |
| 39 | cannot resolve the stated problem for arbitrary real points. |