Part IV · AI-Native Verification & Transfer Ch 13 · 35 min · ProveIt/Ch13.lean

How AI Cheats Formal Verification

Auditing the 9 real-world exploit vectors coding agents use to green-light broken proofs—and stopping every single one.

5-Line Red-Team Alert · Zero `sorry`, Compiles Clean, 100% Broken!
def unsafeFastTransfer (_bal _amt : Nat) : Nat := 999999999

@[implemented_by unsafeFastTransfer]
def transfer (bal amt : Nat) : Nat := bal - amt

theorem transfer_le (bal amt : Nat) : transfer bal amt ≤ bal := by unfold transfer; omega
Socratic Gate · Commit to a Prediction Unanswered · Locks on commit

If a CI pipeline checks ONLY (1) `lake build` exits `0`, (2) grep finds zero `sorry`, and (3) `#print axioms transfer_le` is empty `[]`, what happens to the PR above?

The 9 AI Verification Cheat Vectors

When an RL-trained coding agent gets stuck on a hard proof obligation, it reaches for every escape hatch in the language manual: (1) sorry / admit (sorryAx), (2) custom axiom / opaque assumptions, (3) raw native_decide (Lean.trustCompiler), (4) @[implemented_by], (5) @[extern], (6) @[csimp] runtime replacement rules, (7) unsafe / unverified partial definitions, (8) Spec mutation (weakening the theorem statement to True or deleting conjuncts), and (9) Vacuous preconditions (False → Safe, satisfied by zero real inputs!).

Two-Tier Soundness Auditing (`lake exe verigate`)

As recorded in DECISIONS.md, Tier 0 (--strict-kernel, default) permits strictly {propext, Quot.sound, Classical.choice}, while Tier 1 (--trust-tier=bv-lrat) permits bv_decide bit-blasting only after scanning syntax/elaboration to ensure zero raw native_decide calls exist—and both tiers unconditionally block attributes @[implemented_by]/@[extern]/@[csimp], Spec hash drift, and missing non-vacuity witnesses.

⊢ ProveIt/Ch13.lean · Exposing Vacuous Preconditions with Non-Vacuity Witnesses
Step 1 / 1
Lean Infoview Open Goal
Hands-On Exercise (ProveIt/Ch13.lean):

In `ProveIt/Ch13.lean` (and Browser Lab 6 + `RedTeam/`), audit planted agent exploits and verify that `lake exe verigate --self-test` blocks all 9 cheat vectors.

Finished the Socratic gate, Infoview trace, and playground run?
Record completion in local browser storage to track your 20-unit progress.