Lean4
/-- Shortcut for calling `solveByElim`. -/
def solveByElim (orig : MVarId) (goals : Array MVarId) (use : Array Expr) (required : Array Expr) (depth) := do
let cfg : SolveByElimConfig := { maxDepth := depth, exfalso := true, symm := true, intro := false }
let cfg :=
if !required.isEmpty then
cfg.testSolutions
(fun _ => do
let r ← instantiateMVars (.mvar orig)
pure <| required.all fun e => e.occurs r)
else cfg
let cfg := cfg.synthInstance
_ ← SolveByElim.solveByElim cfg (use.toList.map pure) (fun _ => return (← getLocalHyps).toList) goals.toList