From 3cc68fb0585fa78baf121707c8a3154081f4515c Mon Sep 17 00:00:00 2001 From: Nick Petalas Date: Wed, 11 Nov 2026 13:31:01 +0000 Subject: [PATCH] feat(research): separate fixed P120 patterns from rank 15 --- research/p120-char3-rank31-window/FACTOR.json | 1 + research/p120-char3-rank31-window/NOTICE | 14 + research/p120-char3-rank31-window/PROOF.md | 113 ++++++++ research/p120-char3-rank31-window/README.md | 102 ++++++++ .../p120-char3-rank31-window/SOURCES.json | 18 ++ research/p120-char3-rank31-window/TASK.json | 81 ++++++ research/p120-char3-rank31-window/VERIFY.json | 36 +++ research/p120-char3-rank31-window/verify.py | 244 ++++++++++++++++++ 8 files changed, 609 insertions(+) create mode 100644 research/p120-char3-rank31-window/FACTOR.json create mode 100644 research/p120-char3-rank31-window/NOTICE create mode 100644 research/p120-char3-rank31-window/PROOF.md create mode 100644 research/p120-char3-rank31-window/README.md create mode 100644 research/p120-char3-rank31-window/SOURCES.json create mode 100644 research/p120-char3-rank31-window/TASK.json create mode 100644 research/p120-char3-rank31-window/VERIFY.json create mode 100644 research/p120-char3-rank31-window/verify.py diff --git a/research/p120-char3-rank31-window/FACTOR.json b/research/p120-char3-rank31-window/FACTOR.json new file mode 100644 index 0000000000..2371a01245 --- /dev/null +++ b/research/p120-char3-rank31-window/FACTOR.json @@ -0,0 +1 @@ +{"schema":"p120-f3-rank-factorization/1","field_order":3,"rank":31,"vertex_order":"ascending integers v in [0,512) with bit_count(v) mod 4 = 3","left":[[1,1,1,0,0,0,0,0,2,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,2],[1,1,0,1,0,0,0,0,2,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,2],[1,0,1,1,0,0,0,0,2,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0],[0,1,1,1,0,0,0,0,2,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0],[1,1,0,0,1,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],"minor_rows":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16,20,21,22,23,26,35,36,38,51,52,57,59,60,61,62,63],"minor_columns":[0,1,2,3,4,5,8,9,10,11,17,18,19,20,21,31,32,33,34,35,36,37,52,53,54,64,65,66,67,70,80],"space":"span(x_i+x_8-1, x_i*x_j+1-x_8 : 0<=i<8, 0<=i> i) & 1 for i in range(9)] + row = [(x[i] + x[8] - 1) % 3 for i in range(8)] + row += [(x[i] * x[j] + 1 - x[8]) % 3 + for i in range(8) for j in range(i + 1, 8)] + rows.append(row) + return rows + + +def obstruction_checks(data, ports): + features = feature_rows(ports) + coordinates = data["left_in_space"] + for i in range(ORDER): + for j in range(RANK): + value = sum(features[i][t] * coordinates[t][j] for t in range(36)) % 3 + require(value == data["left"][i][j], "factor outside fixed space") + forced = [[sum(row[t] * c[t] for t in range(36)) % 3 + for c in data["forced_coefficients"]] for row in features] + constraint_dets = [] + equations = 0 + for j, vertex in enumerate(data["forced_vertices"]): + index = ports.index(vertex) + for i in range(ORDER): + orthogonal = (ports[i] & vertex).bit_count() % 2 == 0 + if orthogonal or i == index: + require(forced[i][j] == int(i == index), "illegal forced column") + equations += 1 + chosen = data["constraint_minor_rows"][j] + require(all(i == index or (ports[i] & vertex).bit_count() % 2 == 0 + for i in chosen), "minor uses an unconstrained row") + det = determinant([features[i] for i in chosen]) + require(det != 0, "forced column not unique") + constraint_dets.append(det) + det = determinant([forced[i] for i in data["forced_minor_rows"]]) + require(det != 0, "dependent forced columns") + return {"forced_columns": len(data["forced_vertices"]), + "forced_equations": equations, "forced_independence_det": det, + "uniqueness_determinants": constraint_dets, + "factor_membership_entries": ORDER * RANK} + + +def rejects(call, *args): + try: + call(*args) + except ValueError: + return 1 + raise ValueError("negative control was accepted") + + +def controls(data, matrix, ports): + count = 0 + changed = [row[:] for row in matrix] + changed[0][0] = 0 + count += rejects(mask_counts, changed, ports) + orthogonal = next(j for j in range(ORDER) + if (ports[0] & ports[j]).bit_count() % 2 == 0) + changed = [row[:] for row in matrix] + changed[0][orthogonal] = 1 + count += rejects(mask_counts, changed, ports) + changed = [row[:] for row in matrix] + changed[0][0] = 3 + count += rejects(mask_counts, changed, ports) + changed = dict(data) + changed["minor_rows"] = [data["minor_rows"][0]] * RANK + count += rejects(validate_artifact, changed) + changed = dict(data) + changed["left"] = [row[:-1] for row in data["left"]] + count += rejects(validate_artifact, changed) + changed = dict(data) + changed["field_order"] = True + count += rejects(validate_artifact, changed) + changed = dict(data) + changed["left"] = [[0] * RANK for _ in range(ORDER)] + count += rejects(rank_checks, changed, matrix) + require(determinant([[1, 0], [0, 1]]) == 1, "identity determinant") + require(determinant([[0, 1], [1, 0]]) == 2, "swap determinant") + require(determinant([[1, 2], [2, 1]]) == 0, "singular determinant") + changed = dict(data) + changed["left_in_space"] = [[0] * RANK for _ in range(36)] + count += rejects(obstruction_checks, changed, ports) + changed = dict(data) + changed["forced_coefficients"] = [[0] * 36 for _ in range(16)] + count += rejects(obstruction_checks, changed, ports) + changed = dict(data) + changed["forced_minor_rows"] = [data["forced_minor_rows"][0]] * 16 + count += rejects(obstruction_checks, changed, ports) + changed = dict(data) + indices = [row[:] for row in data["constraint_minor_rows"]] + indices[0] = [indices[0][0]] * 36 + changed["constraint_minor_rows"] = indices + count += rejects(obstruction_checks, changed, ports) + return count + + +def main(): + started = time.monotonic() + with (PACKAGE / "FACTOR.json").open("rb") as stream: + raw = stream.read(MAX_ARTIFACT_BYTES + 1) + require(len(raw) <= MAX_ARTIFACT_BYTES, "artifact size") + data = json.loads(raw) + validate_artifact(data) + ports = vertices() + require(len(ports) == ORDER, "port count") + matrix = product(data["left"], data["right"]) + diagonal, forced = mask_counts(matrix, ports) + dets = rank_checks(data, matrix) + obstruction = obstruction_checks(data, ports) + rejected = controls(data, matrix, ports) + # Receipt is generated from the actual checked artifact and package sources. + names = ("README.md", "PROOF.md", "NOTICE", "TASK.json", "SOURCES.json", + "VERIFY.json", "verify.py", "FACTOR.json") + hashes = {name: hashlib.sha256((PACKAGE / name).read_bytes()).hexdigest() + for name in names} + receipt = {"claim_type": "finite certificate with scoped proof", "field": 3, "rank": RANK, + "fixed_space_obstruction": obstruction, + "ports": len(ports), "product_entries": sum(map(len, matrix)), + "diagonal_entries": diagonal, "forced_zero_entries": forced, + "determinants": dets, "rejected_controls": rejected, + "matrix_sha256": hashlib.sha256(bytes(x for row in matrix for x in row)).hexdigest(), + "sources_sha256": hashes} + print(json.dumps(receipt, sort_keys=True)) + print("PASS_P120_CHAR3_RANK31 no_new_kappa") + print("elapsed_seconds=%.6f" % (time.monotonic() - started)) + + +if __name__ == "__main__": + main()