2.3. First Proofs
A bare crush introduces leading binders and reads every local proposition.
It is particularly effective for arithmetic constraints and equality
congruence:
example (x y : Int)
(hxy : x ≤ y) (hyx : y ≤ x) : x = y := x:Inty:Inthxy:x ≤ yhyx:y ≤ x⊢ x = y
All goals completed! 🐙
example (f : Int → Int) (a b : Int)
(h : a = b) : f a = f b := f:Int → Inta:Intb:Inth:a = b⊢ f a = f b
All goals completed! 🐙
Quantified facts and higher-order values are supported:
example (g : Int → Int) (x : Int)
(step : ∀ z, g z = z + 1) :
g (g x) = x + 2 := g:Int → Intx:Intstep:∀ (z : Int), g z = z + 1⊢ g (g x) = x + 2
All goals completed! 🐙
example (applyAtOne : (Int → Int) → Int)
(h : ∀ f, applyAtOne f = f 1) :
applyAtOne (fun x => x + 1) = 2 := applyAtOne:(Int → Int) → Inth:∀ (f : Int → Int), applyAtOne f = f 1⊢ (applyAtOne fun x => x + 1) = 2
All goals completed! 🐙
The default higher-order strategy translates these examples to first-order SMT by monomorphizing, lambda-lifting, and defunctionalizing function values.