lean-crush

5.10. Soundness Checklist🔗

Before registering a lowering:

  • Match the complete elaborated argument spine, including type and instance arguments.

  • Check overloaded instances rather than assuming they are canonical.

  • Recurse through ctx.emitTerm and ctx.emitSort.

  • Verify operand sorts and return none for unsupported types or representations.

  • Use ctx.declare for fresh SMT symbols.

  • Preserve Lean's behavior at boundary cases such as division by zero and out-of-bounds indexing.

  • Add a negative regression demonstrating that the encoding cannot prove an arbitrary result.

Under crush.trust "reconstruct", Lean checks the final proof, but an incorrect lowering still causes confusing failures. Under the default trust policy, translation correctness is part of the trusted translation boundary, including custom term and sort handlers. Registration does not supply a kernel-checked proof that a lowering preserves Lean semantics.