proof(types): lift type_preservation past τ=int to the int-represented family {int, hex, binary}#53
Merged
Conversation
…d family {int,hex,binary}
The Int-only evaluation model means hex and binary share the same runtime
carrier as int (they ARE int-represented), so an evaluated Int legitimately
inhabits any of the three. Generalise type_preservation accordingly:
- TypedValue gains `hex` / `binary` constructors alongside `int`.
- New `JtvType.isIntRepr` predicate picks out {int, hex, binary}.
- type_preservation is now
(hτ : τ.isIntRepr) → TypedValue (evalDataExpr e σ) τ
proved by `cases τ <;> first | exact .int/.hex/.binary | simp only [isIntRepr] at hτ`.
- type_preservation_int recovers the original `τ = int` statement as a corollary.
`#print axioms` ⇒ both theorems depend on no axioms. Verified locally under the
pinned leanprover/lean4:v4.12.0 toolchain: full `lake build` exit 0, 0
sorry/admit/axiom, 0 True-typed theorems.
float/rational/complex/symbolic remain stated-unproven at the value level
(distinct carriers; each needs its own value model).
Docs synced: PROOF-CAPABILITY-MATRIX (scope + key-theorems row + re-verified
note), ADR-0007 consequence, ADR-0010 §gap-005/§Open, STATE.a2ml.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJmfoz1ZS1Pejy9LLMY742
hyperpolymath
marked this pull request as ready for review
June 21, 2026 02:14
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.
What
Lifts
type_preservation(JtvTypes.lean SECTION 6) fromτ = intto the whole integer-represented family{int, hex, binary}.Under the
Int-only evaluation model,hexandbinaryshare the same runtime carrier asint(they are int-represented — see theJtvTypeconstructor comments), so an evaluatedIntlegitimately inhabits any of the three.Changes (Lean)
TypedValuegainshex/binaryconstructors alongsideint.JtvType.isIntReprpicks out{int, hex, binary}.type_preservationgeneralised fromτ = int → …to:cases τ <;> first | exact TypedValue.{int,hex,binary} | simp only [JtvType.isIntRepr] at hτ.type_preservation_intcorollary recovers the originalτ = intstatement (viasubst+trivial).Verification (local + CI)
Verified locally under the pinned
leanprover/lean4:v4.12.0toolchain:lake buildexit 0 (suite is mathlib-free, zero packages)grep -rnwE 'sorry|admit|axiom'⇒ 0 across all eight libraries0True-typed theorems#print axioms type_preservationand…_int⇒ does not depend on any axiomsproof-regression.ymlre-runslake buildon everyjtv_proofs/**change as the durable check.Honest scope
float/rational/complex/symbolicremainstated-unprovenat the value level — they have distinct runtime carriers (notInt) and each needs its own value model. This PR closes only the int-represented slice ofgap-005.Docs synced
PROOF-CAPABILITY-MATRIX.adoc— scope-of-model rewrite, new key-theorems row, "re-verified 2026-06-21" noteSTATE.a2mlsession history +gap-005status🤖 Generated with Claude Code
Generated by Claude Code