lean-crush

5.1. Choosing an Extension Point🔗

5.1.1. When SMT Lacks Semantics🔗

An unsupported Lean application is normally translated as an uninterpreted symbol. SMT can still use equality congruence, but it cannot reason from the implementation or algebraic properties of that symbol.

Choose the least powerful mechanism that represents the missing semantics:

  1. Use u[f], d[f], @[crush_unfold], or @[crush_defeq] when Lean's own equations are finite and solver-friendly.

  2. Use crush_map when a Lean constant is exactly an existing SMT operator, or crush_map_sort when a monomorphic Lean type is exactly an existing nullary SMT sort.

  3. Use register_lowering term when one stable application head needs a pattern-based encoding, or @[crush_lower f] for a full handler.

  4. Use register_lowering result-type when applications have unstable heads but a stable result-family head. Use @[crush_lower_result T] for a full handler, including dependent function results.

  5. Use @[crush_translate] only when dispatch spans several heads or intentionally overrides head-indexed and built-in translation.

  6. Use register_lowering sort for a parameterized sort, or @[crush_translate_sort] for a full sort handler.

Equation support is the safest starting point because Lean already proves the equations and reconstruction can reuse them. A lowering produces a smaller, theory-aware SMT term, but the author is responsible for showing that the encoding has exactly the Lean operation's semantics.

5.1.2. When Reconstruction Lacks a Proof🔗

First confirm that SMT returns unsat. Then choose according to the reconstruction algorithm:

  • Use with [...] for proof terms needed by one call.

  • Use using for a goal-specific Lean tactic needed by one call.

  • Use @[crush_reconstruct] for reusable lemmas used by core-directed reconstruction.

  • Use register_crush_replay term to decode a custom SMT term appearing in a cvc5 Alethe certificate.

  • Use register_crush_replay rule to prove a custom or unsupported Alethe inference from its replayed premises.

The first three mechanisms operate on the original Lean goal and unsat core. The last two operate on individual certificate terms and steps. An Alethe-only run does not consult @[crush_reconstruct], while core-only reconstruction does not consult replay registrations.