dalek-ed25519-verified/verification
mrwulf e07f51c7f7 Phase 2, brick 1a: to_bytes canonicity proven (to_bytes_spec, kernel-audited)
The load-bearing brick of the point-level apex equation:
FieldElement51::to_bytes always succeeds and its 32 output bytes denote
EXACTLY the represented residue - bytesVal s = feVal a mod p. Since the
canonical residue determines the bytes, this is simultaneously
canonicity ("output is the canonical encoding") and the injectivity
compress needs ("equal residues iff equal bytes").

- Proofs/ToBytesMath.lean: the context-free ℕ mathematics (METHOD 4) -
  the 5-rung carry telescope (div_rung/q_telescope), the q-trick facts
  (q = (h+19)/2^255 is a bit, fires iff h >= p), q_mod_p (adding 19q and
  discarding bit 255 subtracts pq exactly), carry_pack (the masked-limb
  assembly mod 2^255), five per-limb byte-chunk splits, and bytes_pack
  (the 32-byte little-endian reassembly, closed by one zify +
  linear_combination over the five splits).
- Proofs/ToBytesSpec.lean: the symbolic execution - at ~150 machine ops
  the longest walk in the repo, loop-free: weak reduce (reduce_spec),
  the q pass, the fold + carry pass, 32 byte extractions (the four
  limb-boundary bytes turn disjoint ORs into additions via
  Nat.two_pow_add_eq_or_of_lt), and the trailing top-bit debug-assert
  DISCHARGED (b31 = f4/2^44 < 2^7), not assumed.
- check.sh: ToBytesMath/ToBytesSpec in PROOFS, to_bytes_spec in CERTS
  (exact standard-three audit) - full button green fresh.

Walk lessons (for the control repo, next push): rw index-equations into
their consumers instead of subst (subst eliminates the wrong side or
dies on dependent do-motives); never rw [Nat.mod_eq_of_lt (by omega)]
(metavariable goal reaches omega) - state the bound with show.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 13:10:43 +02:00
..
gen Coherence pass 3: post-apex accuracy sweep, hygiene, guard ladder 2026-07-05 11:48:17 +02:00
Proofs Phase 2, brick 1a: to_bytes canonicity proven (to_bytes_spec, kernel-audited) 2026-07-05 13:10:43 +02:00
check-scalar.sh Coherence pass 3: post-apex accuracy sweep, hygiene, guard ladder 2026-07-05 11:48:17 +02:00
check.sh Phase 2, brick 1a: to_bytes canonicity proven (to_bytes_spec, kernel-audited) 2026-07-05 13:10:43 +02:00
CurveField.llbc Regenerated CurveField.llbc from the reproducibility run 2026-07-04 19:51:05 +02:00
CurveSig.llbc extract.sh: reproducible end-to-end (CurveField merged gen + CurveSig glue) 2026-07-04 19:50:37 +02:00
extract.sh extract.sh: reproducible end-to-end (CurveField merged gen + CurveSig glue) 2026-07-04 19:50:37 +02:00
lean-guard Coherence pass 3: post-apex accuracy sweep, hygiene, guard ladder 2026-07-05 11:48:17 +02:00