ABI Layer 2: prove operation reversibility (round-trip law) — flagship Idris2 proof#31
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Raises oblibeniser's Idris2 ABI to Layer 2 with its first flagship semantic proof. oblibeniser's headline is making operations reversible and auditable; this discharges the reversible half as a genuine round-trip law: for structurally-invertible operations (mask XOR, global flip, reverse),
unapply (apply x) = x.Mirrors the estate flagship-proof pattern: faithful
Opmodel, the reversibility equality proven, certifier, controls.Changes
src/interface/abi/Oblibeniser/ABI/Semantics.idr—Opwithapply/unapplyand the round-trip reversibility theorem.oblibeniser-abi.ipkg.RSR Quality Checklist
Required
As Applicable
Testing
Verified with Idris2 0.7.0:
idris2 --build oblibeniser-abi.ipkg→ exit 0, zero warnings. Adversarial check: a deliberately-false proof was rejected.build/removed.🤖 Generated with Claude Code
https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx
Generated by Claude Code