Skip to content

ABI Layer 4: prove the FFI result-code seam is injective + faithful#33

Merged
hyperpolymath merged 4 commits into
mainfrom
claude/new-session-znxgm7
Jun 28, 2026
Merged

ABI Layer 4: prove the FFI result-code seam is injective + faithful#33
hyperpolymath merged 4 commits into
mainfrom
claude/new-session-znxgm7

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Layer 4 (seal the ABI↔FFI seam): proves the FFI result-code encoding (resultToInt) is a sound, lossless wire encoding — decoder intToResult with resultRoundTrip, from which resultToIntInjective is derived. Distinct ABI outcomes never collide on the C wire. Complements the structural abi-ffi-gate.py.

New module *.ABI.FfiSeam (imports Types). Positive + non-vacuity controls.

Testing

Idris2 0.7.0 --build → exit 0, zero warnings. Adversarial rejection confirmed. build/ removed. No believe_me/postulate/sorry.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx


Generated by Claude Code

claude and others added 4 commits June 27, 2026 19:45
Add Oblibeniser.ABI.Semantics, a machine-checked proof of oblibeniser's
headline domain property: operations are reversible.

Models a faithful family of structurally-invertible operations (FlipAll,
XorMask, Rev, Nop, Seq) over a bit-register state (List Bool), and proves
the round-trip law as a real propositional equality:

    reversible : (op : Op) -> (s : State) -> unapply op (apply op s) = s

Also proved: the dual direction (apply . unapply = id, so each op is a
genuine bijection), closure under sequencing, and an unforgeable
IsReversible certificate tied to the ABI Result code. Positive controls
exhibit inhabited witnesses; negative controls machine-refute the bad
case (a wrong inverse). No believe_me / postulate / assert — Integer was
deliberately avoided since its primitive ops do not reduce symbolically;
the bit-register model gives honest, reduction-friendly involutions.

Adversarial check: a deliberately false round-trip (= [True] instead of
[False]) is rejected by idris2, confirming non-vacuity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Add Oblibeniser.ABI.Invariants, a second, deeper machine-checked theorem
over the SAME Layer-2 model (Op/State/apply/invert/unapply). Where Layer 2
proves the per-element round-trip laws, Layer 3 proves the whole collection
is a GROUP under Seq, quotiented by denotational equivalence Equiv:

- Equiv is an equivalence relation and a congruence for Seq;
- Seq is associative; Nop is a two-sided unit;
- every op has a two-sided inverse (reusing reversible / reversibleDual);
- inverses are UNIQUE (cancellation theorem);
- invert is an involution and anti-homomorphism up to Equiv.

Includes a sound+complete decision procedure decAgreeOn for agreement on a
finite probe set, an unforgeable IsGroupInverse certificate tied to the ABI
Result codes with a soundness lemma, positive controls (concrete witnesses
+ inhabited certificate), and negative/non-vacuity controls (Not-equivalences
machine-checked, decision returns No). No believe_me/postulate/assert_total;
%default total; builds with zero warnings; adversarial false proof rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Add Oblibeniser.ABI.FfiSeam proving the resultToInt encoding is sound:
faithful round-trip (intToResult . resultToInt = Just) and injectivity
derived from it, plus positive controls and a machine-checked non-vacuity
control (Ok and Error differ on the wire). Genuine total proofs only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath hyperpolymath marked this pull request as ready for review June 28, 2026 06:39
@hyperpolymath hyperpolymath merged commit 7c5e848 into main Jun 28, 2026
4 checks passed
@hyperpolymath hyperpolymath deleted the claude/new-session-znxgm7 branch June 28, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants