fix: missing whnf at tryLemma?

This commit is contained in:
Leonardo de Moura 2021-08-30 08:33:58 -07:00
parent 79938056ad
commit ce47000e33
2 changed files with 5 additions and 1 deletions

View file

@ -67,7 +67,7 @@ where
let val ← lemma.getValue
let type ← inferType val
let (xs, bis, type) ← forallMetaTelescopeReducing type
let type ← instantiateMVars type
let type ← whnf (← instantiateMVars type)
let lhs := type.appFn!.appArg!
if (← isDefEq lhs e) then
unless (← synthesizeArgs lemma.getName xs bis discharge?) do

View file

@ -0,0 +1,4 @@
open Nat
theorem add_assoc (m n k : Nat) : m + n + k = m + (n + k) :=
Nat.recOn (motive := fun k => m + n + k = m + (n + k)) k rfl (fun k ih => by simp [Nat.add_succ, ih]; done)