Skip to content

ABI Layer 2: prove operation reversibility (round-trip law) — flagship Idris2 proof#31

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/new-session-znxgm7
Jun 27, 2026
Merged

ABI Layer 2: prove operation reversibility (round-trip law) — flagship Idris2 proof#31
hyperpolymath merged 1 commit into
mainfrom
claude/new-session-znxgm7

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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 Op model, the reversibility equality proven, certifier, controls.

Changes

  • Adds src/interface/abi/Oblibeniser/ABI/Semantics.idrOp with apply/unapply and the round-trip reversibility theorem.
  • Registers the module in oblibeniser-abi.ipkg.

RSR Quality Checklist

Required

  • Tests pass — ABI builds clean (see Testing)
  • Linter clean — zero warnings
  • No banned language patterns
  • No banned functions — genuine proof
  • SPDX headers present
  • No secrets

As Applicable

  • ABI/FFI changes validated — additive proof; FFI untouched

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

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
@hyperpolymath hyperpolymath marked this pull request as ready for review June 27, 2026 19:48
@hyperpolymath hyperpolymath merged commit e921fd6 into main Jun 27, 2026
15 of 19 checks passed
@hyperpolymath hyperpolymath deleted the claude/new-session-znxgm7 branch June 27, 2026 19:48
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