fact: Definition simple_rewrite A {x y : A} (p : x = y) : tactic := fun g=> gT <- goal_type g; r <- T.abstract_from_term x gT; match r with | mSome r => newG <- evar (r y); T.exact (eq_rect y _ newG x (eq_sym p)) g;; ret [m: (m: tt, AnyMetavar Typeₛ _ newG)] | mNone => M.raise SimpleRewriteNoOccurrence end.
imports: Mtac2(Base Tactics ImportedTactics Datatypes List Logic Abstract Sorts) Strings.String