lean-crush

3.3. Exposing Definitions🔗

An untranslated function is treated as uninterpreted. That is sound, but its defining equations are unavailable unless they are provided explicitly. Use u[...] to add all equation lemmas of a definition. For recursive definitions, these are usually one constructor-specific equation per defining clause:

def addThree (x : Int) : Int := x + 3 example (x : Int) : addThree x > x := x:Int⊢ addThree x > x All goals completed! 🐙

Use d[...] to add one definitional unfold equation instead. It is best for non-recursive wrappers and definitions whose complete equation set is unnecessary:

def nonnegative (x : Int) : Prop := 0 ≤ x example (x : Int) (h : nonnegative x) : x + 1 > 0 := x:Inth:nonnegative x⊢ x + 1 > 0 All goals completed! 🐙

Both forms also drive proof-producing rewrites before SMT translation. For persistent support, @[crush_unfold] corresponds to u[f] and @[crush_defeq] to d[f]:

@[crush_unfold] def twice (x : Int) : Int := x + x example (x : Int) : twice (x + 1) = twice x + 2 := x:Int⊢ twice (x + 1) = twice x + 2 All goals completed! 🐙

Both attributes are relevance-filtered, so a marked definition contributes nothing to a query that cannot reach it. set_option crush.autoUnfold false disables the attributes, but explicit u[...] and d[...] clauses still apply.