Commit f69d910
feat(proofs): Coq binop parity — or/sub/mul/div/mod + comparisons in WokeLang.v (#86)
## Why
`WokeLang.v` (Coq) was **behind the Lean file on binops** — only
`add`/`eq`/`and` — the Lean↔Coq asymmetry flagged in
[`AUDIT.md`](../blob/main/docs/proofs/verification/AUDIT.md) and carried
as a `should` in `debt.a2ml`. This closes it.
## What
Each new operator gets a `has_type` rule, a `step` rule, and **full
`progress` + `preservation` coverage** (mirroring the proven
`T_Add_Int`/`T_And` templates), axiom-free:
| Group | Ops | Result |
|---|---|---|
| logical | `or` | `bool` |
| integer arithmetic | `sub`, `mul` | `Z` |
| integer division | `div`, `mod` | `Z`, **panic to `VOops`** on a zero
divisor (reuses the proven unwrap-of-oops fragment) |
| comparisons | `lt`, `gt`, `le`, `ge` | `Z → bool` |
This matches the Lean file exactly. (`BNeq` stays a deliberate symmetric
gap — neither prover has it; float arithmetic variants remain unmodelled
on both.)
## The interesting bit — `preservation` performance
`preservation` is the AUDIT-flagged brute-force `try solve [...]`
cascade. Naively adding the ops made the file take **>12 minutes** to
typecheck (the new congruence cases `S_BinOp_Left/Right` had no
reconstruction branch, so they fell through to the "nuclear" `repeat
inversion` blocks). Fixed by:
- extending the `first [...]` reconstruction block with the new ops
(both step orderings), and
- adding an early, guarded literal-result closer (`|- has_type _ (ELit
_) _ => inversion; subst; constructor`).
Now every new case dispatches deterministically — **compiles in ~7s**.
## Verified
- `coqc WokeLang.v` → **exit 0** (Coq 8.18.0).
- **No new axioms**: `Print Assumptions` on
`progress`/`preservation`/`type_safety` shows only the pre-existing
`Coq.Reals` pair (`ClassicalDedekindReals.sig_forall_dec` +
`functional_extensionality`).
- Zero `Admitted`/`admit`/`Axiom` in active code.
- `AUDIT.md` updated (binop section → parity).
Draft for review.
https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7
---
_Generated by [Claude
Code](https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent ab94e64 commit f69d910
2 files changed
Lines changed: 345 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
199 | 204 | | |
200 | 205 | | |
201 | 206 | | |
202 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
| |||
0 commit comments