One interval for all exceptional twists: window1 and ultrametric separation#
The cohomological window (11 · The cohomological window) must hold at every point of an interval
\([Y,Y^2]\). The archive finds such an interval in two steps that are easy to compute with: an
ultrametric argument shows that only finitely many twists can be exceptional, and a real-variable
induction (UpperTheory.V.Win.window1, kernel-checked at the archive pin) finds an interval avoiding
all of them. This notebook runs both on the book’s example, tests the quantitative bound of the lemma
on many random instances in exact rational arithmetic, and checks the separation lemma by brute
force.
The lemma#
Given finitely many starting points \(a\), a ratio \(B\ge1\) and \(U>0\), find \([y,2y]\subset[0,U]\) that meets
none of the half-open intervals \([a,Ba)\), with \(y\ge U/(2^{R+2}B^R)\) when there are \(R\) starting
points. The induction: if no start lies in \((U/2B,U]\), take \(y=U/2\) (any \(a\le u\in[y,2y]\) then has
\(Ba\le U/2\le u\)); otherwise delete one such start \(a_0\) and solve the problem below \(U'=U/2B\) — the
new interval lies below \(a_0\), so it avoids \([a_0,Ba_0)\) too. Each deletion costs a factor \(2B\). In
rhlib it reads:
print(inspect.getsource(rhlib.window1))
def window1(starts: list[float], B: float, U: float) -> tuple[float, float]:
"""Return (y, 2y) with [y, 2y] inside [0, U] avoiding every [a, B a), following the
induction of UpperTheory.V.Win.window1:
* if no start a lies in (U/(2B), U], take y = U/2 (then any a <= u in [y, 2y] has
B a <= U/2 <= u, so u is not in [a, B a));
* otherwise delete one such a0 and solve the problem below U' = U/(2B).
Each deletion costs a factor 2B, hence y >= U / (2^(R+2) B^R) ... the archive's bound.
"""
if B < 1 or U <= 0:
raise ValueError("need B >= 1 and U > 0")
live = [a for a in starts if U / (2 * B) < a <= U]
if not live:
return (U / 2, U)
a0 = max(live)
rest = [a for a in starts if a != a0]
return window1(rest, B, U / (2 * B))
The book’s example#
With cohomology cutoff \(C_t=2\), \(\eta=1\) (so \(B=C_t/\eta=2\)), \(X=2^{128}\) and exceptional twists \(2^{16}\) and \(2^{180}\): in base-2 logarithms \(U=128\) and the starts are \(a=\log_2h/C_t\).
ex = fw['example']
Ct, eta = F(ex['Ct']), F(ex['eta'])
B = Ct / eta
U = F(128)
twists_log2 = [F(16), F(180)]
starts = [t / Ct for t in twists_log2]
trace = []
def window1_traced(starts, B, U):
live = [a for a in starts if U / (2 * B) < a <= U]
trace.append((U, sorted(live)))
if not live:
return (U / 2, U)
a0 = max(live)
return window1_traced([a for a in starts if a != a0], B, U / (2 * B))
y, y2 = window1_traced(starts, B, U)
for ceiling, live in trace:
print(f"ceiling {ceiling}: starts in ({ceiling / (2 * B)}, {ceiling}] = {[str(a) for a in live]}")
print(f"interval [y, 2y] = [{y}, {y2}] → [Y, Y²] = [2^{y}, 2^{y2}]")
assert (y, y2) == rhlib.window1([float(a) for a in starts], float(B), float(U))
assert [float(a) for a in starts] == ex['starts'] and [float(y), float(y2)] == ex['interval_log2']
assert ex['X'] == '2^128' and ex['twists'] == ['2^16', '2^180'] and ex['interval'] == [f'2^{y}', f'2^{y2}']
assert rhlib.avoids(y, starts, B)
ceiling 128: starts in (32, 128] = ['90']
ceiling 32: starts in (8, 32] = []
interval [y, 2y] = [16, 32] → [Y, Y²] = [2^16, 2^32]
On \([2^{16},2^{32}]\) the condition “\(h\le x^{C_t}\Rightarrow h\le x^{\eta}\)” holds for both twists at every point. Here \(C_t=2\) and \(\eta=1\) (the values of the example). The first twist, \(2^{16}\), is at most \(x=x^{\eta}\) for every \(x\ge2^{16}\), so the conclusion holds; the second, \(2^{180}\), exceeds \(x^{C_t}\le(2^{32})^2\), so the premise fails. The grid checks this example numerically:
assert (Ct, eta) == (2, 1) and twists_log2 == [16, 180] and (y, y2) == (16, 32) # the values named in the text above
grid = [y + (y2 - y) * F(j, 1600) for j in range(1601)]
for u in grid:
for h in twists_log2: # log2 of the twist
assert (not h <= Ct * u) or h <= eta * u # h <= x^Ct implies h <= x^eta
print(f"checked {len(grid) * len(twists_log2):,} (point, twist) pairs on [2^{y}, 2^{y2}]")
checked 3,202 (point, twist) pairs on [2^16, 2^32]
The quantitative bound, on random instances#
The archive’s bound \(y\ge U/(2^{R+2}B^R)\) is tested on random instances with exact rational data: \(R\le8\) random starts in \((0,U]\), \(B\) from a list of rationals, \(U\) up to \(10^6\). For every instance the returned interval must lie in \([0,U]\), avoid all forbidden intervals, and satisfy the bound.
rng = random.Random(20261120)
N = 20_000
worst_ratio, worst_R = None, None
Bs = [F(1), F(3, 2), F(2), F(3), F(7), F(10)]
for _ in range(N):
R = rng.randint(0, 8)
Bq = rng.choice(Bs)
Uq = F(rng.randint(1, 10**6), rng.randint(1, 50))
st = [Uq * F(rng.randint(1, 10**6), 10**6) for _ in range(R)]
yq, y2q = rhlib.window1(st, Bq, Uq)
assert y2q == 2 * yq and 0 < yq and y2q <= Uq and rhlib.avoids(yq, st, Bq)
ratio = yq / (Uq / (2 ** (R + 2) * Bq ** R))
assert ratio >= 2
if worst_ratio is None or ratio < worst_ratio:
worst_ratio, worst_R = ratio, R
print(f"{N:,} random instances: all intervals valid; smallest y / bound = {float(worst_ratio):.3f} (R = {worst_R})")
20,000 random instances: all intervals valid; smallest y / bound = 2.000 (R = 1)
The induction returns \(y=U/[2(2B)^d]\) after \(d\) deletions. Since \(d\le R\), every run gives at least twice the stated lower bound. The following starts force all \(R\) deletions:
for Bq in (F(1), F(2), F(7)):
for R in (1, 4, 8):
Uq = F(10**6)
st = [Uq / (2 * Bq) ** i * F(1001, 1000) / (2 * Bq) for i in range(R)]
yq, _ = rhlib.window1(st, Bq, Uq)
bound = Uq / (2 ** (R + 2) * Bq ** R)
assert rhlib.avoids(yq, st, Bq) and yq / bound == 2
print(f"B = {str(Bq):>2}, R = {R}: y / bound = {float(yq / bound):.3f}")
B = 1, R = 1: y / bound = 2.000
B = 1, R = 4: y / bound = 2.000
B = 1, R = 8: y / bound = 2.000
B = 2, R = 1: y / bound = 2.000
B = 2, R = 4: y / bound = 2.000
B = 2, R = 8: y / bound = 2.000
B = 7, R = 1: y / bound = 2.000
B = 7, R = 4: y / bound = 2.000
B = 7, R = 8: y / bound = 2.000
In all 20,000 random instances the interval is valid and the smallest ratio of \(y\) to the archive’s bound is 2.000; in the adversarial instances the ratio is exactly \(2\). To see what can be guaranteed by any choice of window, fix \(B>1\) and \(R\ge1\). For a positive start \(a\), the window \([y,2y]\) meets \([a,Ba)\) exactly when \(a/2\le y<Ba\). Put \(L=U/[2(2B)^R]\) and choose starts \(a_i=2(1+\delta)L(2B)^i\) for \(0\le i<R\) and \(\delta>0\). Their forbidden ranges for \(y\) join end to end and cover \([(1+\delta)L,(1+\delta)U/2)\). Since \(y\le U/2\), every valid window has \(y<(1+\delta)L\). Taking \(\delta\) arbitrarily small proves that \(L\) is the best uniform guarantee for \(B>1\). When \(B=1\), all the forbidden intervals are empty and \(y=U/2\) always works, even if the induction deletes starts.
After exponentiation, \([Y,Y^2]\) lies in \([X^{1/J},X]\) with \(J=2^{R+2}B^R=4(2B)^R\): enormous, but fixed before \(X\) and the auxiliary primes are chosen, which is all the argument needs.
Ultrametric separation#
A twist \(1\le h\le Z\) is exceptional for an \(\ell\)-adic centre \(s\) if \(|h-s|_\ell<\ell^{-k}\) with \(k=\lfloor\log_\ell Z\rfloor\), i.e. if \(\ell^{k+1}\mid h-s\). Since \(\ell^{k+1}>Z\), each centre has at most one exceptional twist.
um = fw['ultrametric']
exc = rhlib.ultrametric_exceptions(um['ell'], um['Z'], um['center'])
weak = [h for h in range(1, um['Z'] + 1) if (h - um['center']) % um['ell'] ** 3 == 0]
print(f"ℓ = {um['ell']}, Z = {um['Z']}, centre {um['center']}: exceptional twists {exc};"
f" with ≤ instead of <: {weak}")
assert exc == um['exceptional'] and weak == um['if_mod_27']
ℓ = 3, Z = 80, centre 1: exceptional twists [1]; with ≤ instead of <: [1, 28, 55]
The same holds for every centre, prime and cutoff; a brute-force check over small parameters (the centre only matters modulo \(\ell^{k+1}\)):
count = 0
for ell in (2, 3, 5, 7, 11):
for Z in range(1, 400):
k = 0
while ell ** (k + 1) <= Z:
k += 1
mod = ell ** (k + 1)
assert mod > Z
for s in range(mod):
hits = [h for h in range(1, Z + 1) if (h - s) % mod == 0]
assert len(hits) <= 1
count += 1
print(f"{count:,} (ℓ, Z, centre) triples: never more than one exceptional twist per centre")
1,085,620 (ℓ, Z, centre) triples: never more than one exceptional twist per centre
The integer core of this argument — two integers in \([1,Z]\) congruent modulo some \(m>Z\) are equal —
is proved in this repository’s Lean library (Atlas.Separation.at_most_one_per_centre, quoted in
Ultrametric separation: Atlas/Separation.lean), including the example above and the failure of the weak inequality. Its
transitive axioms, from verification/logs/axioms.json, are propext, Quot.sound.