Repository navigation
Improve C9, C47 and C49 lower bounds with verification certificates - #392
AndreRoehrig wants to merge 2 commits into
Conversation
WorldianAI
left a comment
There was a problem hiding this comment.
Independent exact replay of the constant-47 part of this PR (C47 > 1.7061645367065): it checks out. I did not look at the C9 or C49 parts.
What I used. From the pinned commit 812a0aa62e5ca32d6c3d09efa98045dca0bc6489 of AndreRoehrig/optimization-constants-certificates I downloaded only certificates/c47.json.gz (394,797 bytes). Its SHA-256 is f22af4467e518a7d485717d13f7354b3dff23d4da26b636961885aa9194cbd20, which matches MANIFEST.sha256 in that commit. I read notes/c47.md and wrote my own verifier from the method described there; I did not run certify_c47.py, Pinho's verify_exact.py or finite_instance.py, or any other script from the repository. My code is at the end of this comment. It is the same kind of check I did for the 11-atom certificate in #401, scaled to 452 atoms.
Results (exact Fraction / integer arithmetic, one run, 6.4 s).
- 452 atoms, all with positive mass and inside the half-open cell
Px x Py; total massm = 528807907325432861/10^17, as stated in the note. - All 3,808 witnesses pass every check: the rectangle of centres lies in the closed cell; for every centre in it the closed square of radius
rcontains the boxB(max(cx1 - bx0, bx1 - cx0) <= r, same iny); and the mass of all periodic copies of the atoms in the closed boxBis strictly larger than4 r^2. The largest radius is 2.7857, below2 min(Px, Py) = 5.494, as the margin of two cells requires. - Exact union area
Aof the rectangles (integer sweep) equals the fraction stated in the note, andq = A/m = 1.7061645367065787...equals the certificate'speriodic_ratioexactly. - Finite instance: with
N = 173185922210941and the statedepsilon, every witness satisfies4((r+epsilon)^2 - r^2) < mass(B) - 4 r^2(smallest strict surplus2.9e-24, largest area increase6.2e-25), andq ((N-4)/N)^2 > 1.7061645367065holds exactly, by a margin of only1.8e-27. It also exceeds Pinho's previous1.705591315040972705. - Cross-check that does not use the rectangles: for 20,000 random points in the cell I computed
M mudirectly from the sortedl_infdistances to the periodic copies (floating point). No sampled point lies in the certified union but outside the level set. The sampled level-set fraction was 0.99815 against 0.99859 for the certified union, which is within about 1.7 standard deviations of sampling noise.
Not checked. I took N and epsilon from the note and verified the inequalities they must satisfy; I did not re-derive where they come from. I took the reduction from a periodic measure to a finite integrable function (the truncation to (N-4)^2 cells and the spreading of each atom over a square of radius epsilon) and the periodic-measure argument itself (Lin, Tomar) from the note and the literature, without re-proving them. I did not examine the search that produced the measure, and did not run Pinho's programs.
I am not the author of this PR. I did this replay with AI assistance (Claude Code, Anthropic). The asterisk decision stays with the maintainer.
My verifier (Python standard library)
"""Independent exact replay of the constant-47 certificate of PR 392 (c47-witness-rectangles-v1).
Written from the method described in notes/c47.md only; none of the repository's scripts was run.
Checks (all in exact rational arithmetic):
* atoms: positive masses, inside the half-open period cell Px x Py; total mass m
* for each of the 3808 witnesses (closed box B, radius r > 0, rectangle of centres R):
- R lies in the closed period cell
- the closed square of radius r about EVERY point of R contains B
- the mass of all periodic copies of the atoms lying in the closed box B is strictly larger than 4 r^2
- finite-instance margin: 4((r+eps)^2 - r^2) < mass(B) - 4 r^2 and r + eps <= 2 min(Px, Py)
* exact union area A of the rectangles, q = A/m (compare with the certificate's periodic_ratio)
* q ((N-4)/N)^2 > the claimed decimal."""
import gzip, json, sys, math, time, bisect
from fractions import Fraction as F
t0 = time.time()
d = json.loads(gzip.decompress(open(sys.argv[1], "rb").read()).decode())
assert d["format"] == "c47-witness-rectangles-v1"
Px, Py = F(d["measure"]["Px"]), F(d["measure"]["Py"])
lam = F(d["measure"]["lam"])
atoms = [(F(x), F(y), F(m)) for x, y, m in d["measure"]["pts"]]
W = d["witnesses"]
claim = F(d["finite_lower_bound"])
print("cell %.6f x %.6f atoms %d witnesses %d claim %s lam=%s" % (float(Px), float(Py), len(atoms), len(W), d["finite_lower_bound"], lam))
assert all(m > 0 and 0 <= x < Px and 0 <= y < Py for x, y, m in atoms), "atoms must be positive and inside the half-open cell"
m_tot = sum(a[2] for a in atoms)
print("total mass m = %s (= %.15f)" % (m_tot, float(m_tot)))
print("m equals 528807907325432861/10^17 (stated in the note):", m_tot == F(528807907325432861, 10 ** 17))
# values taken from the note (and cross-checked against the certificate file below)
N = 173185922210941
eps = F(188903960547114448877706307, 6824118437547498629781332110082048000000000000000000)
# common integer scale for positions (box/atom/period coordinates)
from math import lcm
den = 1
for x, y, m in atoms:
den = lcm(den, x.denominator, y.denominator)
den = lcm(den, Px.denominator, Py.denominator)
for w in W:
for v in w["box"]:
den = lcm(den, F(v).denominator)
print("position scale (lcm of denominators): %d digits" % len(str(den)))
Pxi, Pyi = int(Px * den), int(Py * den)
at_i = [(int(x * den), int(y * den), m) for x, y, m in atoms]
assert all(F(a) * den == int(F(a) * den) for a in (Px, Py))
def mass_in_box(bx0, bx1, by0, by1):
"""sum of masses of all periodic copies of atoms inside the closed box (integer coordinates)."""
tot = F(0)
i0, i1 = bx0 // Pxi - 1, bx1 // Pxi + 1
j0, j1 = by0 // Pyi - 1, by1 // Pyi + 1
for (x, y, m) in at_i:
# copies x + i*Px in [bx0, bx1]
lo = -((x - bx0) // Pxi) if False else None
ilo = -(-(bx0 - x) // Pxi) # ceil((bx0 - x)/Px)
ihi = (bx1 - x) // Pxi # floor((bx1 - x)/Px)
jlo = -(-(by0 - y) // Pyi)
jhi = (by1 - y) // Pyi
if ihi >= ilo and jhi >= jlo:
tot += m * (ihi - ilo + 1) * (jhi - jlo + 1)
return tot
bad = 0
minsurplus_margin = None
rmax = F(0)
rects = []
surplus_min = None
for k, w in enumerate(W):
bx0, bx1, by0, by1 = [F(v) for v in w["box"]]
cx0, cx1, cy0, cy1 = [F(v) for v in w["rectangle"]]
r = F(w["radius"])
ok = bx0 <= bx1 and by0 <= by1 and cx0 <= cx1 and cy0 <= cy1 and r > 0
ok = ok and 0 <= cx0 and cx1 <= Px and 0 <= cy0 and cy1 <= Py # centres inside the closed cell
ok = ok and max(cx1 - bx0, bx1 - cx0) <= r and max(cy1 - by0, by1 - cy0) <= r # square(c, r) contains B for every c in R
mB = mass_in_box(int(bx0 * den), int(bx1 * den), int(by0 * den), int(by1 * den))
sur = mB - 4 * r * r
ok = ok and sur > 0
ok = ok and 4 * ((r + eps) ** 2 - r * r) < sur and (r + eps) <= 2 * min(Px, Py)
if not ok:
bad += 1
if bad <= 5: print("witness", k, "FAILS")
rmax = max(rmax, r)
surplus_min = sur if surplus_min is None else min(surplus_min, sur)
rects.append((cx0, cx1, cy0, cy1))
print("witnesses failing any check:", bad, " largest radius %.6f (2*min cell side = %.6f)" % (float(rmax), float(2 * min(Px, Py))))
print("smallest strict mass surplus: %.3e eps-increase of the largest square area: %.3e" % (float(surplus_min), float(4 * ((rmax + eps) ** 2 - rmax * rmax))))
assert bad == 0
# ---- exact union area of the rectangles (integer sweep) ----
den2 = 1
for a, b, c, e in rects:
den2 = lcm(den2, a.denominator, b.denominator, c.denominator, e.denominator)
R = [(int(a * den2), int(b * den2), int(c * den2), int(e * den2)) for a, b, c, e in rects]
xs = sorted({v for r in R for v in r[:2]})
events = {}
for idx, (a, b, c, e) in enumerate(R):
events.setdefault(a, []).append((1, idx)); events.setdefault(b, []).append((0, idx))
active = set()
area_int = 0
for u, v in zip(xs, xs[1:]):
for kind, idx in events.get(u, []):
if kind == 0: active.discard(idx)
for kind, idx in events.get(u, []):
if kind == 1: active.add(idx)
if not active: continue
ivs = sorted((R[i][2], R[i][3]) for i in active)
length, cs, ce = 0, None, None
for c, e in ivs:
if ce is None or c > ce:
if ce is not None: length += ce - cs
cs, ce = c, e
else:
if e > ce: ce = e
if ce is not None: length += ce - cs
area_int += length * (v - u)
A = F(area_int, den2 * den2)
q = A / m_tot
print("exact union area A = %.15f q = A/m = %.20f" % (float(A), float(q)))
cert_q = F(d["periodic_ratio"])
print("q equals the certificate's periodic_ratio exactly:", q == cert_q)
Aq = F(114371658202011893988080971735571640490902803890362835046463, 12676506002282294014967032053760000000000000000000000000000)
print("A equals the fraction stated in the note exactly:", A == Aq)
fin = q * F(N - 4, N) ** 2
print("finite-instance ratio q*((N-4)/N)^2 = %.20f" % float(fin))
print("finite ratio > claimed %s : %s (margin %.3e)" % (d["finite_lower_bound"], fin > claim, float(fin - claim)))
print("claimed decimal exceeds the previous record 1.705591315040972705 (Pinho round 9):", claim > F("1.705591315040972705"))
print("total time %.1f s" % (time.time() - t0))Numerical cross-check (Python + numpy)
import gzip, json, numpy as np, time
from fractions import Fraction as F
d = json.loads(gzip.decompress(open("c47.json.gz", "rb").read()).decode())
Px, Py = float(F(d["measure"]["Px"])), float(F(d["measure"]["Py"]))
pts = np.array([[float(F(x)), float(F(y)), float(F(m))] for x, y, m in d["measure"]["pts"]])
cp = []
for i in range(-4, 5):
for j in range(-4, 5):
cp.append(np.column_stack([pts[:, 0] + i * Px, pts[:, 1] + j * Py, pts[:, 2]]))
P = np.vstack(cp)
R = np.array([[float(F(v)) for v in w["rectangle"]] for w in d["witnesses"]])
rng = np.random.default_rng(2026)
N = 20000
X = rng.random((N, 2)) * [Px, Py]
inlev = 0; bad = 0; t0 = time.time()
for s in range(0, N, 250):
xb = X[s:s + 250]
dist = np.maximum(np.abs(xb[:, None, 0] - P[None, :, 0]), np.abs(xb[:, None, 1] - P[None, :, 1]))
order = np.argsort(dist, axis=1)
ds = np.take_along_axis(dist, order, axis=1)
cum = np.cumsum(P[:, 2][order], axis=1)
lev = (cum / (4 * np.maximum(ds, 1e-12) ** 2)).max(axis=1) >= 1 - 1e-12
inU = ((xb[:, None, 0] >= R[None, :, 0] - 1e-12) & (xb[:, None, 0] <= R[None, :, 1] + 1e-12) &
(xb[:, None, 1] >= R[None, :, 2] - 1e-12) & (xb[:, None, 1] <= R[None, :, 3] + 1e-12)).any(axis=1)
inlev += int(lev.sum()); bad += int((inU & ~lev).sum())
print("level-set fraction %.5f (certified union fraction 0.99859...)" % (inlev / N))
print("points in the certified union but NOT in the level set (must be 0):", bad, " time %.0f s" % (time.time() - t0))
This PR proposes three computer-assisted lower bounds. Each decimal in the last column is certified by a finite construction.
The README and the three constant pages record the new bounds with verification asterisks. The pages give the finite parameters and, for C47 and C49, the limiting values. All three verifiers and the SHA-256 manifest passed at the pinned certificate commit. The repository's page checker reports zero errors and zero warnings.
OpenAI Codex performed the searches, implemented the verification programs, and prepared the text. André Röhrig personally reviewed the mathematical arguments, references, and supporting material.