Skip to content

feat(proofs): Tier 1 — comparisons (lt/gt/le/ge) + div/mod with panic#81

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/sleepy-carson-bREoV
Jun 14, 2026
Merged

feat(proofs): Tier 1 — comparisons (lt/gt/le/ge) + div/mod with panic#81
hyperpolymath merged 1 commit into
mainfrom
claude/sleepy-carson-bREoV

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Continues extending the verified WokeLang type-safety proofs (machine-checked under Lean 4.30.0 by the lean-proofs CI gate; sorry-free, no axioms, theorem statements unchanged).

Tier 1 — operators added

Each with a HasType rule + Step rule(s) and full progress/preservation coverage:

  • Ordering comparisons lt, gt, le, ge — integer → bool, computed via decide (n₁ < n₂) etc. (no by_cases needed).
  • Integer div / mod with divide-by-zero PANIC — a zero divisor steps to error (reusing the proven unwrap-of-oops panic fragment). progress splits on n₂ = 0 via by_cases; preservation types the resulting error at any type via tError.

With this, integer arithmetic (add/sub/mul/div/mod), all comparisons (eq/lt/gt/le/ge), and logical (and/or) are complete.

Verification

$ lean docs/proofs/verification/WokeLang.lean   # exit 0, sorry-free

Remaining Tier 1

Float arithmetic variants (sub/mul/div on float, mirroring add) and array typing/evaluation — documented in AUDIT.md.

https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7


Generated by Claude Code

Extends the verified type safety (machine-checked under Lean 4.30.0 by the
lean-proofs CI gate; sorry-free, no axioms; theorem statements unchanged).

- Ordering comparisons `lt`/`gt`/`le`/`ge` (integer → bool, computed via
  `decide (n₁ < n₂)` etc.) — HasType + Step + full progress/preservation.
- Integer `div`/`mod` with divide-by-zero PANIC: a zero divisor steps to
  `error` (reusing the proven unwrap-of-oops panic fragment); progress splits
  on `n₂ = 0` via `by_cases`, preservation types the `error` via `tError`.

Integer arithmetic (add/sub/mul/div/mod), all comparisons (eq/lt/gt/le/ge),
and logical (and/or) are now complete. Remaining Tier 1: float variants + arrays.

https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 14, 2026 10:55
@hyperpolymath
hyperpolymath merged commit b244755 into main Jun 14, 2026
13 of 16 checks passed
@hyperpolymath
hyperpolymath deleted the claude/sleepy-carson-bREoV branch June 14, 2026 10:55
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