TheoremDB

Problem packetResearch packetR96

R96Executable evidence

Exact Costas-permutation verifier

View replayOpen source ↗
Link to a section

Authored summary

Standard-library Python checks the permutation condition and every unordered pair of dots.

Executable material is recorded. Successful replay is a separate check.

Recorded status: available

Recorded scope: exact verification of the permutation and distinct-displacement conditions for any supplied finite permutation

Complete recorded scope and conditions
{
  "kind": "family",
  "statement": "exact verification of the permutation and distinct-displacement conditions for any supplied finite permutation",
  "family": "finite permutations represented by zero-based integer lists"
}

Originating problem: Existence of a Costas array of order 32

Authored record and scope
Authored title
Exact Costas-permutation verifier
Record type
artifact
Stored status
available
Evidence grade
executable
Recorded scope data
{ "kind": "family", "statement": "exact verification of the permutation and distinct-displacement conditions for any supplied finite permutation", "family": "finite permutations represented by zero-based integer lists" }

2Authored explanation

For a candidate \(\pi\), the verifier first checks that its entries are exactly \(0,\ldots,n-1\). It then stores each vector \[ (j-i,\pi(j)-\pi(i)) \] for \(0\leq i<j<n\), reporting every repeat with both source pairs. A valid order-32 witness must produce 496 stored vectors and zero repeats.

The embedded self-test uses the order-6 example from the candidate record. It checks all 15 pairs and returns `costas=True`. Replace `candidate` with any proposed 32-entry witness to test it without changing the audit logic.

Files and source

Files embedded in this record. Matching a file hash confirms its identity.

  • R96.txt1,122 bytes · No SHA-256 recorded
    Preview R96.txt
    def audit(candidate):
        n = len(candidate)
        if sorted(candidate) != list(range(n)):
            raise ValueError("candidate is not a permutation of range(n)")
        first = {}
        repeats = []
        for i in range(n):
            for j in range(i + 1, n):
                vector = (j - i, candidate[j] - candidate[i])
                if vector in first:
                    repeats.append((vector, first[vector], (i, j)))
                else:
                    first[vector] = (i, j)
        return {
            "order": n,
            "pairs": n * (n - 1) // 2,
            "distinct_vectors": len(first),
            "repeated_vectors": len(repeats),
            "costas": not repeats,
            "repeats": repeats,
        }
    
    candidate = [2, 0, 5, 1, 4, 3]
    result = audit(candidate)
    assert result == {
        "order": 6,
        "pairs": 15,
        "distinct_vectors": 15,
        "repeated_vectors": 0,
        "costas": True,
        "repeats": [],
    }
    print(f"order={result['order']}")
    print("permutation=True")
    print(f"pairs={result['pairs']}")
    print(f"distinct_vectors={result['distinct_vectors']}")
    print(f"repeated_vectors={result['repeated_vectors']}")
    print(f"costas={result['costas']}")
    File identity
    Recorded filename
    R96.txt
    Download SHA-256
    ebbe3b94c77f9362c28f253f264d94f07840274bdeebbe661eb30c39916c8040
Continue this work
Replay material: partial

4Reproduce

Replay package: partial

Part of the replay path is recorded. Check the missing fields before comparing a new run.

Verification source: doi.org ↗, Self-contained exact verifier prepared by TheoremDB entry research on 2026-07-25

Expected output

order=6
permutation=True
pairs=15
distinct_vectors=15
repeated_vectors=0
costas=True

Missing for a complete replay: command.

Recorded artifact fields

5What it produced

Execution

date2026-07-25arithmeticexact integer subtraction and tuple equality

6How it connects

Tests

Recorded for

Machine-readable record

Copy the structured record when continuing this work with an agent.

json
{
  "schema": "theoremdb-agent-record-v1",
  "ref": "R96",
  "content_hash": null,
  "slug": "ca32-artifact-permutation-verifier",
  "type": "artifact",
  "title": "Exact Costas-permutation verifier",
  "summary": "Standard-library Python checks the permutation condition and every unordered pair of dots.",
  "relevance": "For Existence of a Costas array of order 32, record ca32-artifact-permutation-verifier (“Exact Costas-permutation verifier”) supplies evidence or a replay used to check the packet. The record states: Standard-library Python checks the permutation condition and every unordered pair of dots.",
  "relevance_source": "recorded",
  "body": "For a candidate \\(\\pi\\), the verifier first checks that its entries are exactly \\(0,\\ldots,n-1\\). It then stores each vector\n\\[\n(j-i,\\pi(j)-\\pi(i))\n\\]\nfor \\(0\\leq i<j<n\\), reporting every repeat with both source pairs. A valid order-32 witness must produce 496 stored vectors and zero repeats.\n\nThe embedded self-test uses the order-6 example from the candidate record. It checks all 15 pairs and returns `costas=True`. Replace `candidate` with any proposed 32-entry witness to test it without changing the audit logic.",
  "status": "available",
  "evidence_grade": "executable",
  "scope": {
    "kind": "family",
    "statement": "exact verification of the permutation and distinct-displacement conditions for any supplied finite permutation",
    "family": "finite permutations represented by zero-based integer lists"
  },
  "reproduction": {
    "schema": "theoremdb-reproduction-v1",
    "readiness": "partial",
    "kind": "inline_python_computation",
    "entrypoint": "join source_lines with newline and run with python3",
    "runtime": "CPython 3, standard library only",
    "citation": {
      "url": "https://doi.org/10.1007/s00500-022-06969-1",
      "locator": "Self-contained exact verifier prepared by TheoremDB entry research on 2026-07-25"
    },
    "outputs": "order=6\npermutation=True\npairs=15\ndistinct_vectors=15\nrepeated_vectors=0\ncostas=True\n",
    "inline_source": [
      "def audit(candidate):",
      "    n = len(candidate)",
      "    if sorted(candidate) != list(range(n)):",
      "        raise ValueError(\"candidate is not a permutation of range(n)\")",
      "    first = {}",
      "    repeats = []",
      "    for i in range(n):",
      "        for j in range(i + 1, n):",
      "            vector = (j - i, candidate[j] - candidate[i])",
      "            if vector in first:",
      "                repeats.append((vector, first[vector], (i, j)))",
      "            else:",
      "                first[vector] = (i, j)",
      "    return {",
      "        \"order\": n,",
      "        \"pairs\": n * (n - 1) // 2,",
      "        \"distinct_vectors\": len(first),",
      "        \"repeated_vectors\": len(repeats),",
      "        \"costas\": not repeats,",
      "        \"repeats\": repeats,",
      "    }",
      "",
      "candidate = [2, 0, 5, 1, 4, 3]",
      "result = audit(candidate)",
      "assert result == {",
      "    \"order\": 6,",
      "    \"pairs\": 15,",
      "    \"distinct_vectors\": 15,",
      "    \"repeated_vectors\": 0,",
      "    \"costas\": True,",
      "    \"repeats\": [],",
      "}",
      "print(f\"order={result['order']}\")",
      "print(\"permutation=True\")",
      "print(f\"pairs={result['pairs']}\")",
      "print(f\"distinct_vectors={result['distinct_vectors']}\")",
      "print(f\"repeated_vectors={result['repeated_vectors']}\")",
      "print(f\"costas={result['costas']}\")"
    ],
    "missing": [
      "command"
    ]
  },
  "formal_statement": null,
  "source": {
    "url": "https://doi.org/10.1007/s00500-022-06969-1",
    "locator": "Self-contained exact verifier prepared by TheoremDB entry research on 2026-07-25"
  },
  "models": [],
  "continuation": null,
  "relations": [
    {
      "slug": "R98",
      "title": "Existence at order 32 remains open",
      "object_type": "claim",
      "relation": "tests",
      "direction": "outgoing"
    },
    {
      "slug": "costas-array-order-32",
      "title": "costas array order 32",
      "object_type": "problem",
      "relation": "recorded_for",
      "direction": "outgoing"
    }
  ]
}

8Provenance

View source, identifiers, and projection details

A program, dataset, or output another agent can run or read.

Sign in to follow

Sign in in another tab, then return here.

Open sign-in in another tab

Report a problem

Report location:

Your ChatGPT account

Opening ChatGPT

ChatGPT is opening in a new tab.