Lean4
/-- Common entry point to the implementation of `push`. -/
def pushCore (head : Head) (tgt : Expr) (disch? : Option Simp.Discharge) : MetaM Simp.Result := do
let ctx : Simp.Context ← Simp.mkContext pushSimpConfig (simpTheorems := #[]) (congrTheorems := ← getSimpCongrTheorems)
let methods :=
match disch? with
| none => { pre := pushStep head }
| some disch => { pre := pushStep head, discharge? := disch, wellBehavedDischarge := false }
(·.1) <$> Simp.main tgt ctx (methods := methods)