generate_figures.py

Paper IX: Arithmetic Packets, Dyadic Towers, and Local Polynomial Deformation

generate_figures.py

Download original file

This is the original source text. Reading it does not run or verify the program.

Read the typeset paper

Skip source text

1 #!/usr/bin/env python3
2 """Exact arithmetic behind the final Euler visual guide.
3 
4 Numerical coordinates in the figures are either theorem-derived integer bounds
5 or exact residues/valuations of the actual reciprocal coefficients. Floating
6 point is used only by Matplotlib to place those verified coordinates on a page.
7 This is a bounded illustration audit, not a proof of a universal theorem.
8 """
9 from __future__ import annotations
10 
11 from collections import Counter
12 from datetime import datetime, timezone
13 from fractions import Fraction
14 from hashlib import sha256
15 from itertools import product
16 from math import comb, factorial
17 from pathlib import Path
18 import json
19 import platform
20 import time
21 
22 import matplotlib
23 matplotlib.use("Agg")
24 import matplotlib.pyplot as plt
25 from matplotlib.patches import FancyBboxPatch, FancyArrowPatch
26 import numpy as np
27 
28 ROOT = Path(__file__).resolve().parents[1]
29 FIG = ROOT / "figures"
30 FIG.mkdir(parents=True, exist_ok=True)
31 STARTED = datetime.now(timezone.utc).isoformat()
32 T0 = time.monotonic()
33 SCRIPT_HASH = sha256(Path(__file__).read_bytes()).hexdigest()
34 COUNTS = Counter()
35 TEAL, GREEN, GOLD, GRAY = "#164C51", "#668C75", "#A77D40", "#778486"
36 LIGHT = "#E9F0ED"
37 COLORS = [TEAL, GREEN, GOLD, GRAY]
38 plt.rcParams.update({
39     "font.family": "DejaVu Serif", "font.size": 10.5,
40     "axes.labelsize": 10.5, "axes.titlesize": 12,
41     "xtick.labelsize": 9.5, "ytick.labelsize": 9.5,
42     "axes.edgecolor": "#9DAAA6", "axes.labelcolor": TEAL,
43     "text.color": TEAL, "xtick.color": TEAL, "ytick.color": TEAL,
44     "axes.spines.top": False, "axes.spines.right": False,
45     "grid.color": "#DDE5E1", "grid.linewidth": .6,
46     "pdf.fonttype": 42, "ps.fonttype": 42,
47     "figure.facecolor": "white", "axes.facecolor": "white",
48 })
49 
50 
51 def check(condition, kind):
52     assert condition, kind
53     COUNTS[kind] += 1
54 
55 
56 def vi(n):
57     n = abs(int(n))
58     return None if n == 0 else (n & -n).bit_length() - 1
59 
60 
61 def v2(x):
62     x = Fraction(x)
63     return None if x == 0 else vi(x.numerator) - vi(x.denominator)
64 
65 
66 def vf(k):
67     return k - k.bit_count()
68 
69 
70 def coeffs_fraction(N, j, limit):
71     """Hurwitz convolution, over Q, with actual j!-normalized input."""
72     g = [Fraction(factorial(j) * factorial(N*q), factorial(N*q+j))
73          for q in range(limit+1)]
74     c = [Fraction(1)]
75     for n in range(1, limit+1):
76         c.append(-sum(comb(N*n, N*q) * g[q] * c[n-q]
77                       for q in range(1, n+1)))
78     return c
79 
80 
81 def coeffs_independent(N, j, limit):
82     """Independent ordinary-series inversion followed by factorial scaling."""
83     a = [Fraction(factorial(j), factorial(N*q+j))
84          for q in range(limit+1)]
85     b = [Fraction(1)]
86     for n in range(1, limit+1):
87         b.append(-sum(a[q]*b[n-q] for q in range(1, n+1)))
88     return [b[n]*factorial(N*n) for n in range(limit+1)]
89 
90 
91 def coeffs_mod(N, j, limit, bits):
92     """Exact reciprocal coefficients modulo 2^bits, with odd denominators."""
93     modulus = 1 << bits
94     g = []
95     for q in range(limit+1):
96         f = Fraction(factorial(j)*factorial(N*q), factorial(N*q+j))
97         check(f.denominator % 2 == 1, "odd_source_denominator")
98         g.append((f.numerator*pow(f.denominator, -1, modulus)) % modulus)
99     c = [1]
100     for n in range(1, limit+1):
101         c.append(-sum(comb(N*n, N*q)*g[q]*c[n-q]
102                       for q in range(1, n+1)) % modulus)
103     return c
104 
105 
106 def diff(values, n, steps, modulus=None):
107     """Independent exact signed subset expansion of mixed differences."""
108     ans = 0
109     for mask in range(1 << len(steps)):
110         offset = sum(steps[i] for i in range(len(steps)) if mask >> i & 1)
111         sign = (-1)**(len(steps)-mask.bit_count())
112         ans += sign * values[n+offset]
113     return ans if modulus is None else ans % modulus
114 
115 
116 def save(fig, name):
117     fig.savefig(FIG / f"{name}.pdf", bbox_inches="tight",
118                 metadata={"Creator": "Exact Euler figure generator", "CreationDate": None})
119     fig.savefig(FIG / f"{name}.png", dpi=160, bbox_inches="tight")
120     plt.close(fig)
121 
122 
123 def box(ax, x, y, w, h, text, face=LIGHT, fs=11):
124     ax.add_patch(FancyBboxPatch((x, y), w, h,
125                  boxstyle="round,pad=0.018,rounding_size=0.03",
126                  facecolor=face, edgecolor=TEAL, linewidth=.8))
127     ax.text(x+w/2, y+h/2, text, ha="center", va="center", fontsize=fs)
128 
129 
130 # Independent rational checks, then exact finite illustrations at known precision.
131 rat = {j: coeffs_fraction(4, j, 12) for j in range(4)}
132 for j in range(4):
133     other = coeffs_independent(4, j, 12)
134     for n in range(13):
135         check(rat[j][n] == other[n], "independent_rational_inversion")
136 check([rat[j][1] for j in range(4)] ==
137       [Fraction(-1), Fraction(-1,5), Fraction(-1,15), Fraction(-1,35)],
138       "first_row_benchmark")
139 bits = 256
140 modulus = 1 << bits
141 mod = {j: coeffs_mod(4, j, 255, bits) for j in range(4)}
142 for j in range(4):
143     for n in range(13):
144         f = rat[j][n]
145         check(mod[j][n] == (f.numerator*pow(f.denominator, -1, modulus)) % modulus,
146               "rational_modular_crosscheck")
147 b, B, beta = [1,1,4,2], [1,1,5,3], [0,0,3,1]
148 for j in range(4):
149     for n in range(9):
150         for H in range(1,9):
151             check(vi(diff(mod[j],n,[H],modulus)) == vi(H)+b[j],
152                   "sampled_first_difference_exact")
153         for k in range(1,7):
154             for H in range(1,5):
155                 value = vi(diff(mod[j],n,[H]*k,modulus))
156                 lower = k+vf(k)+k*vi(H)+beta[j]
157                 check(value is None or value >= lower, "sampled_factorial_bound")
158                 if j in (0,1):
159                     check(value == lower, "sampled_homogeneous_equality")
160     for k in range(1,5):
161         for steps in product((1,2,3,4), repeat=k):
162             lower = k+vf(k)+sum(vi(H) for H in steps)+beta[j]
163             value = vi(diff(mod[j],0,steps,modulus))
164             check(value is None or value >= lower, "sampled_mixed_factorial_bound")
165             if j in (0,1):
166                 exact = k % 2 == 1 or sum(H % 2 == 0 for H in steps) % 2 == 0
167                 check((value == lower) == exact, "sampled_mixed_parity_rule")
168             if j == 2:
169                 lower2 = 2*k+vf(k)+k//2+sum(vi(H) for H in steps)
170                 check(value is None or value >= lower2, "sampled_address_two_filtration")
171 for k in (1,2,4,8,16):
172     for n in (0,3):
173         for steps in ([1]*k, [2]*k, [1]*(k-1)+[2]):
174             exact = ({1:4,2:6}.get(k,2*k+vf(k)+k//2)
175                      +sum(vi(H) for H in steps))
176             check(vi(diff(mod[2],n,steps,modulus)) == exact,
177                   "sampled_address_two_power_order_exact")
178 
179 # 01. The object and its normalization.
180 fig, ax = plt.subplots(figsize=(7.2,3.6))
181 ax.set(xlim=(0,1),ylim=(0,1)); ax.axis("off")
182 box(ax,.07,.67,.86,.22,
183     r"$G_{N,j}(t)=j!\sum_{n\geq0}t^{Nn}/(Nn+j)!$")
184 box(ax,.07,.32,.86,.22,
185     r"$G_{N,j}(t)^{-1}=\sum_{n\geq0}C_{N,j}(n)t^{Nn}/(Nn)!$")
186 ax.add_patch(FancyArrowPatch((.5,.66),(.5,.55),arrowstyle="-|>",mutation_scale=13,color=TEAL))
187 ax.text(.55,.605,"reciprocal",fontsize=10,va="center")
188 box(ax,.07,.025,.86,.18,
189     r"$E_{Nn}^{(N,j)}=j!C_{N,j}(n)\quad$; row step $H$ = degree step $NH$")
190 ax.add_patch(FancyArrowPatch((.5,.31),(.5,.21),arrowstyle="-|>",mutation_scale=13,color=TEAL))
191 save(fig,"normalization")
192 
193 # 02. Old and strengthened unit-step estimates: theorem-derived integers only.
194 fig, axes = plt.subplots(1,2,figsize=(7.2,3.65),sharey=True)
195 ns, ks = range(13), range(1,13)
196 old = np.array([[min(k,n) for n in ns] for k in ks])
197 new = np.array([[k for n in ns] for k in ks])
198 for ax, data, title in zip(axes,(old,new),(r"Earlier: $\min(k,n)$",r"Threshold free: $k$")):
199     im = ax.imshow(data,origin="lower",aspect="auto",cmap="YlGnBu",vmin=0,vmax=12,
200                    extent=(-.5,12.5,.5,12.5))
201     ax.set_title(title,pad=10); ax.set_xlabel("starting row n")
202     ax.set_xticks((0,4,8,12)); ax.set_yticks((1,4,8,12))
203     ax.plot((0,12),(0,12),color="white",lw=1,ls="--",alpha=.8)
204 axes[0].set_ylabel("difference order k")
205 fig.colorbar(im,ax=axes,shrink=.85,pad=.035,label="proved valuation lower bound")
206 save(fig,"threshold")
207 
208 # 03. A mixed-step signed stencil, with an exact rational example.
209 steps = [1,2,4]
210 stencil = [(sum(steps[i] for i in range(3) if mask >> i & 1),
211             (-1)**(3-mask.bit_count())) for mask in range(8)]
212 check(sorted(x for x,s in stencil) == list(range(8)), "stencil_offsets")
213 stencil_value = diff(rat[0],0,steps)
214 check(v2(stencil_value) == 7, "stencil_exact_valuation")
215 fig, ax = plt.subplots(figsize=(7.2,2.85))
216 for x,s in stencil:
217     ax.plot((x,x),(0,s),color=TEAL if s>0 else GREEN,lw=1.4)
218     ax.scatter((x,),(s,),color=TEAL if s>0 else GREEN,s=90,zorder=3)
219     ax.text(x,s+(.15 if s>0 else -.18),"+1" if s>0 else "−1",ha="center",va="bottom" if s>0 else "top")
220 ax.axhline(0,color=GRAY,lw=.8); ax.set(ylim=(-1.7,1.75),xlim=(-.5,7.5),xticks=range(8),yticks=(-1,0,1))
221 ax.set_xlabel("offset from the starting row"); ax.set_ylabel("signed weight")
222 ax.set_title(r"$\Delta_1\Delta_2\Delta_4$: eight exact signed samples",pad=12)
223 save(fig,"mixed_stencil")
224 
225 # 04. Final common-step Euler congruence exponents at unit step.
226 orders = list(range(1,33))
227 vj01 = [k+vf(k) for k in orders]
228 vj2 = [vf(k)+max(k+4,2*k+k//2+1) for k in orders]
229 vj3 = [k+vf(k)+2 for k in orders]
230 fig, ax = plt.subplots(figsize=(7.2,4.2))
231 ax.plot(orders,vj01,color=TEAL,lw=1.8,label="j = 0, 1: exact")
232 ax.plot(orders,vj3,color=GRAY,lw=1.6,ls="--",label="j = 3: proved lower bound")
233 ax.plot(orders,vj2,color=GREEN,lw=2,label="j = 2: proved lower bound")
234 powers = [1,2,4,8,16,32]
235 ax.scatter(powers,[vj2[k-1] for k in powers],s=44,color=GREEN,edgecolor="white",lw=.7,zorder=4,
236            label="j = 2: exact at powers of two")
237 ax.set(xlim=(0,33),ylim=(0,max(vj2)+8),xlabel="difference order k",ylabel="bits of divisibility for the original Euler coefficient")
238 ax.set_xticks((1,4,8,16,24,32)); ax.grid(axis="y"); ax.legend(loc="upper left",frameon=False,fontsize=9.4)
239 save(fig,"final_exponents")
240 
241 # 05. The address-two envelope, in normalized coefficients.
242 fig, ax = plt.subplots(figsize=(7.2,4.1))
243 base2 = [k+vf(k)+3 for k in orders]
244 pair2 = [2*k+vf(k)+k//2 for k in orders]
245 envelope = [max(x,y) for x,y in zip(base2,pair2)]
246 ax.plot(orders,base2,color=GRAY,lw=1.5,ls="--",label=r"$k+v_2(k!)+3$")
247 ax.plot(orders,pair2,color=GOLD,lw=1.5,ls=":",label=r"$2k+v_2(k!)+\lfloor k/2\rfloor$")
248 ax.plot(orders,envelope,color=GREEN,lw=2.2,label="take the larger bound")
249 ax.scatter(powers,[envelope[k-1] for k in powers],color=GREEN,s=46,zorder=4,edgecolor="white",lw=.7,label="universally exact orders")
250 ax.set(xlim=(0,33),ylim=(0,max(envelope)+8),xlabel="difference order k",ylabel="normalized valuation lower bound")
251 ax.set_xticks((1,2,4,8,16,24,32)); ax.grid(axis="y"); ax.legend(frameon=False,loc="upper left",fontsize=9.4)
252 save(fig,"address_two_envelope")
253 
254 # 06. Mixed cancellation at the first nontrivial even order.
255 mixed_examples = []
256 for steps2 in ([1,1],[1,2],[2,2],[1,4],[2,4],[3,4]):
257     value = diff(rat[0],0,steps2)
258     low = 2+vf(2)+sum(vi(H) for H in steps2)
259     mixed_examples.append({"steps":steps2,"lower":low,"actual":v2(value),"value":str(value)})
260 check(mixed_examples[1]["value"] == "-33728", "mixed_counterexample_value")
261 check(mixed_examples[1]["actual"] == 6, "mixed_counterexample_valuation")
262 fig, ax = plt.subplots(figsize=(7.2,3.65))
263 x = np.arange(len(mixed_examples))
264 ax.bar(x-.16,[e["lower"] for e in mixed_examples],width=.31,color=GRAY,label="factorial baseline V")
265 ax.bar(x+.16,[e["actual"] for e in mixed_examples],width=.31,color=TEAL,label="exact valuation at n = 0, j = 0")
266 ax.set_xticks(x,[str(tuple(e["steps"])) for e in mixed_examples])
267 ax.set(xlabel="the two row steps",ylabel="dyadic valuation",ylim=(0,max(e["actual"] for e in mixed_examples)+1))
268 ax.grid(axis="y"); ax.set_axisbelow(True); ax.legend(frameon=False,fontsize=9.5)
269 save(fig,"mixed_cancellation")
270 
271 # 07. First-difference isometry, theorem lines and sampled exact arithmetic.
272 fig, ax = plt.subplots(figsize=(7.2,3.9))
273 t = list(range(7))
274 for j in range(4):
275     vals = [vi((factorial(j)*diff(mod[j],0,[1<<s],modulus)) % modulus) for s in t]
276     check(vals == [s+B[j] for s in t], "plotted_original_metric")
277     ax.plot(t,[s+B[j] for s in t],color=COLORS[j],lw=1.6,ls="--" if j==1 else "-",label=f"j = {j}, B = {B[j]}")
278     ax.scatter(t,vals,s=35,color=COLORS[j],marker="s" if j==1 else "o",zorder=3)
279 ax.set(xticks=t,xlabel=r"$v_2(H)$",ylabel=r"$v_2(E_{4H}^{(4,j)}-E_0^{(4,j)})$",ylim=(0,12))
280 ax.grid(axis="y"); ax.legend(frameon=False,ncol=2,fontsize=9.5)
281 save(fig,"metric")
282 
283 # 08. Least row periods: theorem-derived exponents.
284 fig, ax = plt.subplots(figsize=(7.2,3.9))
285 r = list(range(1,13))
286 for j in (0,2,3):
287     ax.step(r,[max(0,s-B[j]) for s in r],where="mid",lw=1.8,color=COLORS[j],label=("j = 0, 1" if j==0 else f"j = {j}"))
288 ax.set(xticks=r,xlabel=r"precision r in modulus $2^r$",ylabel=r"$\log_2$(least row period)",ylim=(-.35,11.8))
289 ax.grid(axis="y"); ax.legend(frameon=False,fontsize=10)
290 save(fig,"periods")
291 
292 # 09. Exact permutations of permitted residues modulo 256.
293 residue_data = []
294 fig, axes = plt.subplots(2,2,figsize=(7.2,5.0))
295 for j, ax in enumerate(axes.flat):
296     p = 1 << max(0,8-B[j])
297     es = [(factorial(j)*mod[j][n]) % 256 for n in range(2*p)]
298     image = [((es[n]-factorial(j)) % 256) // (1<<B[j]) for n in range(p)]
299     check(sorted(image) == list(range(p)), "complete_residue_permutation")
300     for n in range(p):
301         check(es[n] == es[n+p], "finite_period_repeat")
302     residue_data.append({"j":j,"modulus":256,"B":B[j],"period":p,
303                          "Euler_residues":es[:p],"scaled_residues":image})
304     ax.scatter(range(p),image,s=12 if p>32 else 30,color=COLORS[j])
305     ax.set_title(f"j = {j}: {p} rows, {p} permitted residues",fontsize=10.5,pad=8)
306     ax.set_xlabel("row n"); ax.set_ylabel("scaled residue")
307     ax.set(xlim=(-.5,p-.5),ylim=(-.5,p-.5))
308     if p<=8: ax.set_xticks(range(p)); ax.set_yticks(range(p))
309     else: ax.set_xticks((0,p//2,p-1)); ax.set_yticks((0,p//2,p-1))
310     ax.grid(alpha=.5)
311 fig.tight_layout(h_pad=1.2,w_pad=1.4)
312 save(fig,"residue_permutations")
313 
314 # 10. A finite metric matrix, quotienting address two by its exact scale.
315 qvals = residue_data[2]["scaled_residues"]
316 distance_in = np.zeros((8,8)); distance_out = np.zeros((8,8))
317 for n in range(8):
318     for m in range(8):
319         if n==m:
320             distance_in[n,m]=distance_out[n,m]=np.nan
321         else:
322             distance_in[n,m] = vi(n-m)
323             distance_out[n,m] = vi(qvals[n]-qvals[m])
324             check(distance_in[n,m]==distance_out[n,m], "finite_scaled_isometry")
325 fig, axes = plt.subplots(1,2,figsize=(7.2,3.5))
326 cmap=plt.get_cmap("YlGnBu").copy(); cmap.set_bad("#F1F3F1")
327 for ax,data,title in zip(axes,(distance_in,distance_out),(r"input: $v_2(n-m)$",r"output: $v_2(y_n-y_m)$")):
328     im=ax.imshow(data,cmap=cmap,vmin=0,vmax=2,origin="lower")
329     ax.set(xticks=range(8),yticks=range(8),xlabel="row m",ylabel="row n")
330     ax.set_title(title,pad=10)
331 fig.colorbar(im,ax=axes,shrink=.8,pad=.04,ticks=(0,1,2),label="shared low-bit precision")
332 save(fig,"isometry_matrices")
333 
334 # 11. Known exact-law shifts at small ranks.
335 bs = {2:[1,2],4:[1,1,4,2],8:[1,1,1,1,4,3,2,2]}
336 fig, axes = plt.subplots(1,2,figsize=(7.2,3.25),sharey=True)
337 for ax, original, title in zip(axes,(False,True),(r"normalized scale $b_{N,j}$",r"Euler scale $B_{N,j}$")):
338     data=np.full((3,8),np.nan)
339     for ri,N in enumerate((2,4,8)):
340         for j,bj in enumerate(bs[N]): data[ri,j]=bj+(vi(factorial(j)) if original else 0)
341     cmap=plt.get_cmap("YlGnBu").copy(); cmap.set_bad("#F5F6F4")
342     ax.imshow(data,origin="upper",vmin=1,vmax=7,cmap=cmap,aspect="auto")
343     for ri in range(3):
344         for j in range(8):
345             if not np.isnan(data[ri,j]):
346                 ax.text(j,ri,str(int(data[ri,j])),ha="center",va="center",color="white" if data[ri,j]>=5 else TEAL,fontsize=11)
347     ax.set(xticks=range(8),yticks=range(3),yticklabels=("N = 2","N = 4","N = 8"),xlabel="address j")
348     ax.set_title(title,pad=10)
349 save(fig,"rank_scales")
350 
351 # 12. Exact rational counterexamples at larger upper-half addresses.
352 counterexamples=[]
353 for N,j,pred,actual in ((16,9,6,7),(32,18,7,6),(32,19,6,7)):
354     c=coeffs_fraction(N,j,2)
355     first=v2(c[1]-c[0]); second=v2(c[2]-c[0])
356     check(second == actual and first+1 == pred, "upper_half_counterexample")
357     counterexamples.append({"N":N,"j":j,"first_valuation":first,
358                             "step_two_valuation":second,"naive_prediction":pred,
359                             "C0":str(c[0]),"C1":str(c[1]),"C2":str(c[2])})
360 
361 # 13. Analytic slopes: certified coefficient bounds, no real growth claim.
362 degrees=list(range(1,65))
363 fig, ax=plt.subplots(figsize=(7.2,4.0))
364 ax.plot(degrees,degrees,color=TEAL,lw=1.8,label="j = 0, 1: exact coefficient valuation")
365 ax.plot(degrees,[max(2*d+d//2,d+3) for d in degrees],color=GREEN,lw=2,
366         label="j = 2: coefficient lower bound")
367 powers2=[4,8,16,32,64]
368 ax.scatter(powers2,[5*d//2 for d in powers2],s=42,color=GREEN,edgecolor="white",lw=.7,zorder=4,
369            label="j = 2: exact along powers of two")
370 ax.plot(degrees,degrees,color=GRAY,lw=1,ls="--",alpha=.8,label="j = 3: proved lower bound")
371 ax.set(xlim=(0,66),ylim=(0,170),xlabel="Taylor degree d",ylabel=r"dyadic valuation of the degree-d coefficient")
372 ax.set_xticks((1,4,8,16,32,48,64)); ax.grid(axis="y"); ax.legend(frameon=False,fontsize=9.2,loc="upper left")
373 save(fig,"analytic_slopes")
374 
375 # Durable exact plotted data, separate from rendering coordinates.
376 data={"scope":"Exact finite illustration data; theorem-derived curves are not numerical evidence for universal proofs.",
377       "coefficient_definition":"C_N,j(n)=(Nn)![t^(Nn)](j! sum_q t^(Nq)/(Nq+j)!)^(-1)",
378       "modular_precision_bits":bits,"modular_rows":255,"rational_crosscheck_rows":12,
379       "assertion_counts":dict(sorted(COUNTS.items())),"total_assertions":sum(COUNTS.values()),
380       "rational_first_rows":{str(j):[str(x) for x in rat[j][:5]] for j in range(4)},
381       "mixed_stencil":{"steps":steps,"offset_weights":stencil,"value":str(stencil_value),"valuation":v2(stencil_value)},
382       "mixed_order_two":mixed_examples,"residue_permutations":residue_data,
383       "upper_half_counterexamples":counterexamples,
384       "theorem_derived_unit_step_exponents":{"orders":orders,"Euler_j01":vj01,"Euler_j2":vj2,"Euler_j3":vj3},
385       "known_exactness":"j0/j1 all homogeneous orders; j2 powers of two; no complete higher-order j3 formula claimed"}
386 data_path=FIG/"exact_figure_data.json"
387 data_path.write_text(json.dumps(data,indent=2)+"\n")
388 outputs=[{"path":str(p.relative_to(ROOT)),"sha256":sha256(p.read_bytes()).hexdigest()}
389          for p in sorted(FIG.glob("*.pdf"))]+[{"path":str(data_path.relative_to(ROOT)),"sha256":sha256(data_path.read_bytes()).hexdigest()}]
390 manifest={
391     "schema_version":1,"claim_id":"Euler-final-visual-exact-illustrations-2026-10-06",
392     "repository":{"commit":"unavailable; isolated publication source snapshot","dirty":True},
393     "command":"python3 sources/generate_figures.py",
394     "environment":{"software":[f"Python {platform.python_version()}",f"Matplotlib {matplotlib.__version__}",f"NumPy {np.__version__}"],"hardware":platform.machine()},
395     "mathematics":{
396         "assertion_tested":"Finite exact coefficients, periods, residue bijections, sample difference valuations, mixed parity, and explicit failed extensions used in the visual guide",
397         "coefficient_domain":"Fraction over Q and exact modular arithmetic Z/2^256 Z; rendering alone uses floating point",
398         "conventions":"v2(0)=infinity, represented by None; original E_{4n}=j! C_j(n); all step differences act on rows",
399         "inputs":[{"path":"sources/generate_figures.py","sha256":SCRIPT_HASH}],
400         "bounds":{"rank_four_modular_rows":255,"precision_bits":256,"independent_rational_rows":12,
401                   "sample_base_rows":[0,8],"sample_homogeneous_orders":[1,6],"sample_homogeneous_steps":[1,4],
402                   "sample_mixed_orders":[1,4],"sample_mixed_step_alphabet":[1,2,3,4],
403                   "power_orders":[1,2,4,8,16],"upper_half_cases":[[16,9],[32,18],[32,19]]},
404         "non_claims":["No bounded run proves a universal congruence or analytic radius.","The theorem-derived curves use separately audited algebraic statements.","These checks do not newly formalize any result in Lean."]},
405     "randomness":{"used":False,"generator":"not used","seed":None},
406     "run":{"started_at":STARTED,"runtime_seconds":round(time.monotonic()-T0,6),"exit_status":0},
407     "outputs":outputs,"checks":[{"name":key,"assertions":value,"result":"PASS"} for key,value in sorted(COUNTS.items())],
408     "result":f"PASS: {sum(COUNTS.values())} exact bounded assertions; 12 vector figures generated",
409     "residual_risks":["This v1 manifest records script input hash but does not impose machine-checkable resource limits.","Plotting-library layout is checked separately by PDF rendering review."]}
410 (FIG/"figure_manifest.json").write_text(json.dumps(manifest,indent=2)+"\n")
411 print(json.dumps({"status":"PASS","assertions":sum(COUNTS.values()),"vector_figures":len(list(FIG.glob('*.pdf'))),"runtime_seconds":manifest['run']['runtime_seconds']},indent=2))

Back to source controls

Other PDFs for this work

Original file and source record

This copy matches the recorded source file. Its publication here does not change the work’s review status.

SHA-256: b0c42986a19c79c7022b5d63c15e205a6e3df2a6accc29f209976fcb3588dd95

Original source on GitHub

Back to Paper IX: Arithmetic Packets, Dyadic Towers, and Local Polynomial Deformation