From Boolean certificate replay to matrix-level code distance #
The general bridge from upstream Reflect/Certified.lean is preserved without its concrete
code instances. Assignments are read as vectors over ZMod 2, Boolean parity becomes the
matrix dot product, and the count of true bits becomes Hamming weight. Separation supplies
a dual witness for every vector outside the check row space. Encoder completeness then
turns any lighter logical operator into a satisfying assignment.
no_light_logical_of_unsat rules out such operators. le_minWeight_of_unsat packages this
as a distance bound and composes with unsat_of_checkSteps. Support rows must be nonempty,
duplicate-free, within range, and agree with the matrices; these conditions are explicit.
No concrete CNFs, solver runs, or generated replay datasets are imported.
The two readings: assignments and code vectors #
Bridge 1: the support size is exactly the count #
Bridge 2: XOR dot products over a support list and dotProduct #
dotS is parity: the XOR dot product is false if and only if the number of true entries is
even.
This step does not need the support list to have no duplicates, since the XOR and the count each take multiplicities into account.
The sum of indicators is the count: summing the indicator function over a support list equals the count of the assignment.
This is where hrn (no duplicates) is used: dotS counts multiplicities, while Finset does
not.
Bridge 2: dotS reports false if and only if the vector read out is orthogonal to the
support
vector.
hr requires the indices of the support list to lie within the code length (the encoder's output
satisfies this) and hrn requires no duplicates.
Building a satisfying assignment from a kernel vector and a pairing witness #
Concatenate a kernel vector in the first n bits and a pairing witness in the next n bits
into
one assignment.
From the second block on the bound t < 2n is used, and positions beyond it are false, since
Assign is ℕ → Bool and must be a total function.
Equations
Instances For
The first n bits of the assignment read back as the kernel vector itself.
The next n bits of the assignment read back as the pairing witness.
The all-ones support list reads out as the all-ones vector.
General form: a replay verdict implies a code-level lower bound #
The interface for arbitrary binary parity-check matrices. The encoder-side input (the
Rker/Rpair support
lists, n, k), the code-level objects (M₁/M₂), the row correspondence between them and three
assembly facts are all taken as hypotheses, and the conclusion is a code-level proposition.
Turn a bound in List.all form into a pointwise form. The quantifier shape ∀ r ∈ L, … is
not one
the kernel can decide directly, so the three encoder-side facts are first written with all and
then converted into theorem hypotheses here.
The certificate is the lower bound (general form): if the formula produced by the encoder at
(Rker, Rpair, n, k) is unsatisfiable, then the corresponding code has no logical operator of
weight $\le k$.
The row-correspondence, index bounds and duplicate-free hypotheses connect the Boolean encoder inputs to the matrix model. No solver output is assumed sound.
An unsatisfiable encoding gives a matrix-level distance lower bound.
Combine this with unsat_of_checkSteps to consume a kernel-checked RUP certificate.