fix: assigned metavariables in SimpLemmas

This commit is contained in:
Leonardo de Moura 2021-02-12 16:43:42 -08:00
parent 16a6778fb6
commit 1945858d89
2 changed files with 2 additions and 1 deletions

View file

@ -72,6 +72,7 @@ where
let val ← lemma.getValue
let type ← inferType val
let (xs, bis, type) ← forallMetaTelescopeReducing type
let type ← instantiateMVars type
let lhs ← getLHS lemma.kind type
if (← isDefEq lhs e) then
unless (← synthesizeArgs lemma.getName xs bis discharge?) do

View file

@ -73,7 +73,7 @@ private partial def isPerm : Expr → Expr → MetaM Bool
| s, t => s == t
def mkSimpLemmaCore (e : Expr) (val : Expr) (post : Bool) (prio : Nat) (name? : Option Name) : MetaM SimpLemma := do
let type ← inferType e
let type ← instantiateMVars (← inferType e)
unless (← isProp type) do
throwError! "invalid 'simp', proposition expected{indentExpr type}"
withNewMCtxDepth do