Skip to content

proof(interp): denotational correspondence harness for eval_data_expr (PROOF-2 / gap-001)#55

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-albattani-ubS9r
Jun 21, 2026
Merged

proof(interp): denotational correspondence harness for eval_data_expr (PROOF-2 / gap-001)#55
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-albattani-ubS9r

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Establishes a denotational correspondence between the Lean model and the running Rust interpreter — the first real wiring for PROOF-2 / gap-001 (proofs validate models, not the implementation).

Bridges Lean evalDataExpr (jtv_proofs/JtvCore.lean) ↔ Rust eval_data_expr (crates/jtv-core/src/interpreter.rs) over the integer fragment the model covers: lit | var | add | neg over σ : String → Int.

Harness (mod denotational_correspondence in interpreter.rs)

  • denot — re-encodes the four Lean rules exactly, in i128.
  • interpreter_matches_denotational_model_on_int_fragmentexhaustively enumerates every height-≤2 integer-fragment expression (7 leaves → 4039 exprs) across 3 states (~12k cases) and asserts interpreter == denot on all of them. Turns "the interpreter matches the model" from a claim into a checked property.
  • overflow_is_the_correspondence_boundary — pins that Value::Int is i64 with checked_add/checked_neg, so it errors at the i64 edge, never wraps; since Lean ℤ is unbounded, correspondence holds exactly within i64 range.
  • shared_golden_corpus_matches_lean — 7 concrete (expr, σ, value) points mirrored on both sides: pinned by rfl in JtvCore.lean (5 new examples using State.empty[x ↦ v]) and by assertion in Rust.

Honest bound

Integer fragment only (strings / float / rational / complex / calls / lists / tuples are outside the model); within i64 range; exhaustive-up-to-depth, not a Lean-mechanised refinement of the Rust evaluator (that is the deeper PROOF-2 rung). Documented in-code and in the matrix.

Verification (local)

  • cargo test --workspace green (lib 142 → 145, +3 new)
  • cargo fmt --all --check clean; cargo clippy --workspace --all-targets clean (-D warnings)
  • full lake build exit 0; 0 sorry/admit/axiom; 0 True-typed theorems

Docs

PROOF-CAPABILITY-MATRIX.adocinterpreter_correctness row updated (now JtvCore + interpreter.rs, still honestly partial), new "Interpreter ↔ denotational-model correspondence" section, outstanding-work bullet. gap-001 marked partial in STATE.a2ml.

🤖 Generated with Claude Code


Generated by Claude Code

… (PROOF-2 / gap-001)

Ties the Lean denotational model `evalDataExpr` (JtvCore.lean) to the Rust
interpreter `eval_data_expr` over the integer fragment the model covers
(lit | var | add | neg over σ : String → Int).

crates/jtv-core/src/interpreter.rs `mod denotational_correspondence`:
- `denot` re-encodes the four Lean rules in i128.
- `interpreter_matches_denotational_model_on_int_fragment` exhaustively checks
  every height-≤2 integer-fragment expression (7 leaves → 4039 exprs) across
  3 states (~12k cases): interpreter == denot on all.
- `overflow_is_the_correspondence_boundary` pins that `Value::Int` is i64 with
  checked_add/checked_neg → it errors at the i64 edge, never wraps (Lean ℤ is
  unbounded, so correspondence holds exactly within i64 range).
- `shared_golden_corpus_matches_lean` mirrors 7 concrete (expr, σ, value)
  points that are ALSO pinned by `rfl` in JtvCore.lean (cross-side anchor).

JtvCore.lean gains 5 golden `example`s (State.empty[x ↦ v] updates, all rfl).

Honest bound: integer fragment only; within i64 range; exhaustive-up-to-depth,
not a Lean-mechanised refinement of the Rust evaluator (the deeper PROOF-2 rung).

Verified locally: cargo test (145 lib + full workspace green), fmt + clippy -D
clean, full lake build exit 0, 0 sorry/admit/axiom, 0 True-typed theorems.

Docs: PROOF-CAPABILITY-MATRIX (interpreter_correctness row + new correspondence
section + outstanding bullet), gap-001 marked partial in STATE.a2ml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJmfoz1ZS1Pejy9LLMY742
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 21, 2026 06:52
@hyperpolymath
hyperpolymath merged commit e6b756e into main Jun 21, 2026
23 of 24 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-albattani-ubS9r branch June 21, 2026 06:52
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