Skip to content

Replace fabricated ABI proofs with machine-checked Idris2 proofs#24

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/youthful-fermat-90bhhu
Jun 23, 2026
Merged

Replace fabricated ABI proofs with machine-checked Idris2 proofs#24
hyperpolymath merged 1 commit into
mainfrom
claude/youthful-fermat-90bhhu

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What & why

The three "Safety Proofs" in src/abi/Foreign.idr (stabilityBounded, positionalDeterministic, paradoxMonotonic) were not proofs — each fabricated its evidence with cast () / cast Refl over an IO action (e.g. calling an FFI function twice and coercing Refl : x = x onto the two distinct results). This PR replaces them with genuine, self-contained Idris2 modules that are machine-checked under Idris 2 v0.8.0 — no believe_me / assert_total / cast / postulate.

The language's satirical "100% production-ready, formally verified" self-presentation in README / WHITEPAPER is intentional and is left untouched. This PR only makes the underlying proof artifacts real and honest — the dissembling stays in the marketing, not in the substrate.

The proofs (all check ✅)

Property Module
Stability score ∈ [0, 100] src/abi/Stability.idr
Positional-operator determinism src/abi/Positional.idr
Paradox-factor monotonicity (partial) src/abi/Paradox.idr
$ ./verification/check-proofs.sh
idris2: Idris 2, version 0.8.0-fd405085b
checking Stability    ... ok
checking Positional   ... ok
checking Paradox      ... ok
checking Foreign      ... ok
all proofs check.

The honest finding: monotonicity is false, not just unproven

Trying to prove "paradox detection is monotonic with complexity" honestly is what surfaced that it is false of the implementation: error_lang_detect_paradoxes (ffi/zig/src/main.zig) gates scope_leakage on isPrime(line_count), which is non-monotone — line 7 is prime → active, line 8 is composite → inactive, although 8 > 7. Paradox.idr proves the two threshold-gated factors that are monotone (superpositionMonotone, temporalMonotone) and retracts the blanket claim. Non-monotone scope leakage is intentional — it is the pedagogical point of the paradox — but the proof now says so out loud instead of hiding behind cast Refl.

Also in this PR

  • Foreign.idr reduced to an honest, self-contained ABI binding layer (asserts no theorems).
  • src/abi/error-lang-abi.ipkg + verification/check-proofs.sh to reproduce the checks.
  • PROOF-NEEDS.md rewritten as an honest ledger: what is proved, what is retracted, the toolchain, and open conformance obligations (incl. that the Zig column % 2 and ReScript (line*31+column) mod 4 positional rules disagree).

Verification status — run, not assumed

  • Idris2 0.8.0 built from source via Chez Scheme; all four src/abi modules check green.
  • ⚠️ Deno installed from GitHub, but the runtime's JSR std deps (jsr.io) are blocked by this environment's network policy — runtime not executed.
  • Zig 0.13.0 unreachable here (ziglang.org 403 / GitHub release 404 / mirror 403) — FFI tests not run.
  • ReScript compiler does not build as configured (return is not valid ReScript at VM.res:407; two-argument dict<string, int> at Types.res:233) — reported, not fixed in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM


Generated by Claude Code

The three "Safety Proofs" in src/abi/Foreign.idr (stabilityBounded,
positionalDeterministic, paradoxMonotonic) were not proofs: each fabricated
its evidence with cast ()/cast Refl over an IO action. Replace them with
genuine, self-contained Idris2 modules, machine-checked under Idris 2 v0.8.0
(no believe_me / assert_total / cast / postulate):

- Stability.idr  : stability score is bounded in [0,100] (clamp model of
                   compiler/src/Types.res calculateStability).
- Positional.idr : positional-operator behaviour is deterministic over the
                   pure model of the Zig FFI (a genuine Refl, not IO cast Refl).
- Paradox.idr    : the two threshold-gated factors are monotone; the blanket
                   "paradox detection monotonic" claim is RETRACTED -- proving
                   it honestly surfaced that scope_leakage is prime-gated and
                   therefore non-monotone (line 7 prime, line 8 not).

Foreign.idr is reduced to an honest, self-contained ABI binding layer.
Add error-lang-abi.ipkg and verification/check-proofs.sh (idris2 --check all
four modules). Rewrite PROOF-NEEDS.md to record what is proved, what is
retracted, the toolchain, and open conformance obligations.

The language's satirical "100% production-ready / formally verified"
self-presentation in README/WHITEPAPER is intentional and left intact; this
change only makes the underlying proof artifacts real and honest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195yA45jSSP7YDPwJSpw4bM
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 23, 2026 16:47
@hyperpolymath
hyperpolymath merged commit ac3340f into main Jun 23, 2026
5 of 6 checks passed
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.

1 participant