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:
-
Use
u[f],d[f],@[crush_unfold], or@[crush_defeq]when Lean's own equations are finite and solver-friendly. -
Use
crush_mapwhen a Lean constant is exactly an existing SMT operator, orcrush_map_sortwhen a monomorphic Lean type is exactly an existing nullary SMT sort. -
Use
register_lowering termwhen one stable application head needs a pattern-based encoding, or@[crush_lower f]for a full handler. -
Use
register_lowering result-typewhen applications have unstable heads but a stable result-family head. Use@[crush_lower_result T]for a full handler, including dependent function results. -
Use
@[crush_translate]only when dispatch spans several heads or intentionally overrides head-indexed and built-in translation. -
Use
register_lowering sortfor 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
usingfor a goal-specific Lean tactic needed by one call. -
Use
@[crush_reconstruct]for reusable lemmas used by core-directed reconstruction. -
Use
register_crush_replay termto decode a custom SMT term appearing in a cvc5 Alethe certificate. -
Use
register_crush_replay ruleto 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.