Sundog syndrome certificate — soundness + lossiness core (Lean 4 / mathlib v4.30.0)
ALL theorems PROVED, kernel-checked + axiom-clean (propext/Classical.choice/Quot.sound only).
lossiness-by-algebra: syndrome ⟂ secret; |F|^k bodies per syndrome.
soundness: accept ⟹ Safe; no accepted body is unsafe; reject ⟹ ¬Safe under a sound lb.
two concrete sound bounds: supportLb (τ=0) and the non-degenerate column-weight bound
colWeightLb (reject_sound_colweight, rejects at τ>0; loose global worst-column divisor).
OUT OF SCOPE for Lean: the ISD/SIS one-wayness — an imported hardness assumption, NOT a theorem.
TRUST SURFACE = the Scheme fields (esp. hHG) + Safe; everything else is machine-checked.
Hamming weight = number of nonzero coordinates (the error weight).
Equations
Instances For
THE TRUST SURFACE — a reviewer audits these definitions; the rest is machine-checked. #
A syndrome-certificate scheme. Load-bearing definitional content: hHG (the code lies in
ker H) and the meaning of τ (the safe decoding radius).
- n : ℕ
Block length: the number of coordinates of a body.
- k : ℕ
Message dimension: the number of secret symbols.
- m : ℕ
Syndrome length: the number of parity checks.
Generator matrix: its rows span the safe code
C = range (· ᵥ* G).- τ : ℕ
Safe decoding radius: bodies within this Hamming radius of the code are safe.
The dual-pair law: every codeword has zero syndrome.
Instances For
The body y = sG + e: secret message s, sparse error e.
Equations
- Sundog.Certificate.body S s e = Matrix.vecMul s S.G + e
Instances For
Safety predicate (semantic): some same-syndrome witness has weight ≤ τ.
The planted e is a label, never referenced here.
Equations
Instances For
The verifier (cheap, three-valued) #
A cheap verifier: a forward witness search + a sound lower bound. The witness spec is
bundled in (clean); the lower-bound spec is deferred to reject_sound.
Forward witness search: optionally produce a same-syndrome light witness for a body.
A sound lower bound on the minimum same-syndrome weight, read off the syndrome.
- witness_sound (y e' : Fin S.n → F) : self.witnessOpt y = some e' → S.H.mulVec e' = S.H.mulVec y ∧ wt e' ≤ S.τ
Soundness of the witness search: any returned witness is genuinely same-syndrome and light.
Instances For
accept if a light witness is exhibited; reject if the cheap bound rules out every light witness; quarantine otherwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
CORE — clean, by-construction; formalize first. #
Lossiness by algebra. syndrome(sG+e) = syndrome(e): independent of the secret s.
H (sG + e) = H(sG) + He = 0 + He since codewords have zero syndrome (hHG).
Secret indistinguishability. With e fixed, the syndrome separates no two secrets —
the fiber is the whole message space (the content of "s is gone").
|F|ᵏ-to-one. The shadow loses k·log|F| bits.
Accept-soundness (the by-construction core). accept ⟹ Safe.
The only way to accept is via an exhibited witness, which is a proof of Safe.
Spoof impossibility (corollary): no accepted body is unsafe.
Reject-soundness, and a concrete sound lower bound #
The cheap lower bound never exceeds any same-syndrome witness weight.
Equations
Instances For
Reject-soundness. If the cheap bound is sound (LbSound) and the verifier rejects, the
body is unsafe: a light witness forces lb ≤ wt e' ≤ τ, contradicting the τ < lb that fired
the reject.
A concrete cheap sound lower bound: a nonzero syndrome forces error weight ≥ 1 (because
H 0 = 0, so any witness for a nonzero syndrome is itself nonzero). Cheap (one zero-test) and
provably sound. HONEST LIMIT: it only lets the verifier reject at τ = 0 (the degenerate
cheap-reject branch, RISK-1 in the prototype note). The non-degenerate column-weight bound
wt e ≥ ⌈hammingNorm (H y) / maxColWeight H⌉ is the documented next target.
Instances For
Unconditional reject-soundness for the concrete supportLb verifier (no hypothesis).
Column-weight bound — a NON-DEGENERATE concrete sound bound (rejects at τ > 0). #
Stronger than `supportLb`: it bounds error weight below by (syndrome weight / worst column
weight of `H`). Honest caveat: loose (a global worst-column divisor) — a soundness/coverage
win over `supportLb`, not a tightness win.
Support of a vector: where it is nonzero (hammingNorm counts exactly this).
Equations
- Sundog.Certificate.vsupp v = {i : Fin n | v i ≠ 0}
Instances For
hammingNorm is the cardinality of the support.
Worst-case column weight of M: the most nonzero entries in any single column.
Equations
- Sundog.Certificate.colBound M = Finset.univ.sup fun (j : Fin b) => {i : Fin a | M i j ≠ 0}.card
Instances For
Support inclusion: support(M *ᵥ e) ⊆ ⋃_{j ∈ support e} support(col j). A product coordinate
is nonzero only if some term M i j * e j is — i.e. both factors are.
Key lemma. A heavy syndrome forces a heavy error — each error coordinate lights up at most
colBound M rows: hammingNorm (M *ᵥ e) ≤ colBound M * hammingNorm e.
Concrete non-degenerate bound: syndrome weight / worst column weight of H. Cheap (one
hammingNorm zero-test + one division; colBound S.H amortized once per scheme). Unlike
supportLb it can exceed 1, so reject fires at τ > 0. Floor division is the SOUND
direction (it only under-estimates weight); colBound = 0 ⟹ H = 0 ⟹ syndrome = 0, sound.
Equations
Instances For
colWeightLb never exceeds any same-syndrome witness weight (soundness).
colWeightLb is LbSound for any verifier that adopts it.
Unconditional, non-degenerate reject-soundness for the column-weight verifier.