feat: add MVarId.eqOfHEq tactic

This commit is contained in:
Leonardo de Moura 2022-10-28 07:52:45 -07:00
parent f75d59047f
commit 279c34ff46

View file

@ -52,6 +52,14 @@ def _root_.Lean.MVarId.heqOfEq (mvarId : MVarId) : MetaM MVarId :=
let some [mvarId] ← observing? do mvarId.apply (mkConst ``heq_of_eq [← mkFreshLevelMVar]) | return mvarId
return mvarId
/--
Try to apply `eq_of_heq`. If successful, then return new goal, otherwise return `mvarId`.
-/
def _root_.Lean.MVarId.eqOfHEq (mvarId : MVarId) : MetaM MVarId :=
mvarId.withContext do
let some [mvarId] ← observing? do mvarId.apply (mkConst ``eq_of_heq [← mkFreshLevelMVar]) | return mvarId
return mvarId
/--
Close given goal using `HEq.refl`.
-/