You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(proofs): make the formal-verification layer actually type-check (#220)
## Working through the proofs
Installed the toolchains (Idris2 0.8.0, Agda 2.6.3 + stdlib 1.7.3, Lean
4.13.0, Coq 8.18) and ran every proof. **Finding: large parts of the
formal-verification corpus had been committed but never actually run** —
they fail to type-check, while `docs/PROOF-NEEDS.md` and the CI gates
claim they "stand". This PR makes them real.
### Green so far (clean rebuilds)
- **Lean4 trust proofs** — `lake build` 5/5 green (no changes needed;
the `PROOF-NEEDS.md` "88 errors" note was stale — already repaired
upstream).
- **Agda meta-checker** (CI-gated) — `agda MetaChecker.agda` exits 0
after fixing 3 genuine bugs (stuck `min-trust-lb-right` wildcard,
unsound `worst-assoc` `refl`s, `DangerClass`/`DangerLevel` mix-up +
non-exhaustive `max-trust-requires-all`).
- **Idris2 ABI** (CI-gated) — `idris2 --build echidnaabi.ipkg` 19/19
after fixing a wrong module namespace, a missing `Result` ADT, a
closure→`AnyPtr` cast, and real proof bugs in `Gnn`/`AxiomTracker`.
- **verification/proofs/idris2** — `AxiomPolicyOrdering`,
`TrustLevelSoundness` fixed (missing `import Data.Nat`); 7/10 of the
directory green.
### Notable finding (driving remaining work)
A systematic anti-pattern: `LTE m n` facts are written as literal
`LTESucc (… LTEZero)` towers, which has produced **off-by-one count
bugs** (`featureDimPositive`, `ClampTrustBounds.l1lteL2..5`,
`TrustKernelMonotonicity.level4LTELevel5`) and a **paren-balance parse
error** (`ProverKindInjectivity.discriminantBounded`, 113 towers). These
are being replaced with a machine-checked `lteLit` decision-procedure
helper so the counts can't be wrong.
### Still in progress
- `verification/proofs/idris2`: `ClampTrustBounds`,
`TrustKernelMonotonicity` (+ `\/`→`Either`), `ProverKindInjectivity`
(the `lteLit` hardening).
- Coq (`nat.v`, `list.v`, `GroupTheory.v`, `simple_proof.v`),
`proofs/agda/Basic.agda`, `proofs/lean`, `src/idris`.
Draft until the remaining layers are green.
https://claude.ai/code/session_01UAqDQaMwpUqWHUSZekGZWv
---
_Generated by [Claude
Code](https://claude.ai/code/session_01UAqDQaMwpUqWHUSZekGZWv)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments