Built with
doc-gen4, running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑Ctrl+↓to navigate,
Ctrl+🖱️to focus.
On Mac, use
Cmdinstead of
Ctrl.
/-
Copyright (c) 2022 Scott Morrison. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison, Newell Jensen
-/
import Lean.Elab.Command
import Lean.Meta.Tactic.Constructor
open Lean Meta Elab Tactic
/--
`fconstructor` is like `constructor`
(it calls `apply` using the first matching constructor of an inductive datatype)
except that it does not reorder goals.
-/
elab "fconstructor" : tactic => withMainContext do
let mvarIds' ← (← getMainGoal).constructor {newGoals := .all}
Term.synthesizeSyntheticMVarsNoPostponing
replaceMainGoal mvarIds'
/--
`econstructor` is like `constructor`
(it calls `apply` using the first matching constructor of an inductive datatype)
except only non-dependent premises are added as new goals.
-/
elab "econstructor" : tactic => withMainContext do
let mvarIds' ← (← getMainGoal).constructor {newGoals := .nonDependentOnly}
Term.synthesizeSyntheticMVarsNoPostponing
replaceMainGoal mvarIds'