Geometric incidence, transcript privacy, and private references · Chapter 23 of 25

22. Reproducible finite verification

Finite enumeration checks the examples and catches concrete specification errors. It does not replace the proofs for arbitrary finite parameters or validate an implementation.

The following standalone Python program uses only the standard library. Run it with Python 3. It verifies uniform permutation actions, an ambiguity counterexample, exhaustive small calibration, the balanced construction, the public section, and the fractional SAT counterexample.

# BEGIN REPRODUCIBLE CHECK
from itertools import permutations, product
from collections import Counter, defaultdict
import json
import math

# Uniform S4 is transitive and uniformizing, with six masks per input/output pair.
perms4 = list(permutations(range(4)))
for u in range(4):
    assert Counter(phi[u] for phi in perms4) == {0: 6, 1: 6, 2: 6, 3: 6}

# Unknown naming map defeats ordinary separation in the binary example.
ambiguous = defaultdict(list)
for value in range(2):
    for phi in permutations(range(2)):
        ambiguous[phi[value]].append((value, phi))
assert len(ambiguous) == 2
assert all(len(preimages) == 2 for preimages in ambiguous.values())

# Exhaustive three-color calibration: two known colors and one data symbol.
# The data facet is identity on three admissible symbols.
case_count = 0
raw_signatures = set()
for value in range(3):
    for phi in permutations(range(3)):
        raw = (phi[0], phi[1], phi[value])
        raw_signatures.add(raw)
        public_counts = Counter()
        for masks in product(range(3), repeat=3):
            transcript = tuple((raw[t] + masks[t]) % 3 for t in range(3))
            decoded = tuple((transcript[t] - masks[t]) % 3 for t in range(3))
            unused_name = next(iter(set(range(3)) - set(decoded[:2])))
            recovered_phi = decoded[:2] + (unused_name,)
            recovered_value = recovered_phi.index(decoded[2])
            assert recovered_phi == phi
            assert recovered_value == value
            public_counts[transcript] += 1
            case_count += 1
        # Every credential has exactly the same uniform public distribution.
        assert len(public_counts) == 27
        assert set(public_counts.values()) == {1}
assert len(raw_signatures) == 18
assert case_count == 486

# Forty triples and three balanced coordinate facets.
ground = [
    (a, b, c)
    for a, b, c in product(range(4), repeat=3)
    if (c-a) % 4 in (0, 1)
    or ((c-a) % 4 == 2 and (b-a) % 4 in (0, 1))
]
assert len(ground) == len(set(ground)) == 40
for coordinate in range(3):
    assert Counter(row[coordinate] for row in ground) == {
        0: 10, 1: 10, 2: 10, 3: 10
    }
live = ground[:36]
uncalibrated = set()
calibrated = set()
for row in live:
    for phi in perms4:
        names = tuple(phi[color] for color in row)
        uncalibrated.add(names)
        calibrated.add(phi[:3] + names)
assert len(uncalibrated) == 64
assert len(calibrated) == 864

# A public section: one fixed candidate explains every response triple.
fixed_names = live[0]
for response in product(range(4), repeat=3):
    masks = tuple((response[t] - fixed_names[t]) % 4 for t in range(3))
    assert tuple((fixed_names[t] + masks[t]) % 4 for t in range(3)) == response

# Reusing a mask exposes the difference between two private names.
for u1, u2, mask in product(range(4), repeat=3):
    s1, s2 = (u1 + mask) % 4, (u2 + mask) % 4
    assert (s1 - s2) % 4 == (u1 - u2) % 4

# Four unsatisfiable binary clauses have a feasible fractional relaxation.
clauses = (
    lambda a, b: a + b,
    lambda a, b: a + (1-b),
    lambda a, b: (1-a) + b,
    lambda a, b: (1-a) + (1-b),
)
assert not any(
    all(clause(a, b) >= 1 for clause in clauses)
    for a, b in product((0, 1), repeat=2)
)
assert all(clause(0.5, 0.5) >= 1 for clause in clauses)

print(json.dumps({
    "calibration_cases": case_count,
    "binary_ambiguity_preimages_per_output": 2,
    "ground_symbols": len(ground),
    "balanced_cell_size": 10,
    "uncalibrated_signatures": len(uncalibrated),
    "calibrated_signatures": len(calibrated),
    "cyclic_public_section_outputs": 64,
    "data_rounds": 300,
    "calibration_rounds": 3,
    "mask_bits": 606,
    "full_credential_entropy_bits": round(100*math.log2(36)+math.log2(24), 4),
    "checks": "passed"
}, indent=2))
# END REPRODUCIBLE CHECK

Expected results include 486 exhaustive calibration cases, 40 distinct ground symbols, balanced cells of size ten, 64 uncalibrated one-position signatures, and 864 calibrated signatures. Every three-color credential gives the same distribution across all 27 possible public response triples.