You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import Lean
open Lean Elab.Tactic Lean.Meta
syntax (name := assertTrival) "assert_trivial ": tactic
elab_rules : tactic
| `(tactic| assert_trivial) => withMainContext dolet fvarIds := (← getLCtx).getFVarIds
guard (fvarIds.size > 0)
let fvarId := fvarIds[0]!
let ty ← elabTerm (← `(True)) none
let e ← elabTerm (← `(True.intro)) none
let _ ← liftMetaTactic fun mvarId => dolet result ← mvarId.assertAfter fvarId (Name.mkSimple "inserted_by_assert_trivial") ty e
pure [result.mvarId]
pure ()
variable {p : Prop}
theoremfoo : p :=
by assert_trivial
sorry/- at the `sorry`, the context is: p : Prop inserted_by_assert_trivial : True foo : p ⊢ pThat `foo` hypothesis should not be there.-/
dwrensha
changed the title
MVarId.assertAfter incorrectly adds auxDecls to context
MVarId.assertAfter incorrectly upgrades recursive auxDecl to kind "default".
Dec 17, 2022
The text was updated successfully, but these errors were encountered: