Skip to content

proof(types): lift type_preservation past τ=int to the int-represented family {int, hex, binary}#53

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

proof(types): lift type_preservation past τ=int to the int-represented family {int, hex, binary}#53
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-albattani-ubS9r

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Lifts type_preservation (JtvTypes.lean SECTION 6) from τ = int to the whole integer-represented family {int, hex, binary}.

Under the Int-only evaluation model, hex and binary share the same runtime carrier as int (they are int-represented — see the JtvType constructor comments), so an evaluated Int legitimately inhabits any of the three.

Changes (Lean)

  • TypedValue gains hex / binary constructors alongside int.
  • New predicate JtvType.isIntRepr picks out {int, hex, binary}.
  • type_preservation generalised from τ = int → … to:
    (hτ : τ.isIntRepr) → TypedValue (evalDataExpr e σ) τ
    proved by cases τ <;> first | exact TypedValue.{int,hex,binary} | simp only [JtvType.isIntRepr] at hτ.
  • type_preservation_int corollary recovers the original τ = int statement (via subst + trivial).

Verification (local + CI)

Verified locally under the pinned leanprover/lean4:v4.12.0 toolchain:

  • full lake build exit 0 (suite is mathlib-free, zero packages)
  • grep -rnwE 'sorry|admit|axiom'0 across all eight libraries
  • 0 True-typed theorems
  • #print axioms type_preservation and …_intdoes not depend on any axioms

proof-regression.yml re-runs lake build on every jtv_proofs/** change as the durable check.

Honest scope

float / rational / complex / symbolic remain stated-unproven at the value level — they have distinct runtime carriers (not Int) and each needs its own value model. This PR closes only the int-represented slice of gap-005.

Docs synced

🤖 Generated with Claude Code


Generated by Claude Code

…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
hyperpolymath marked this pull request as ready for review June 21, 2026 02:14
@hyperpolymath
hyperpolymath merged commit 3311ad9 into main Jun 21, 2026
22 of 23 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-albattani-ubS9r branch June 21, 2026 02:15
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