File: .lake/packages/lean4/src/lean/Lean/Elab/Tactic/ElabTerm.lean

full_name: Lean.Elab.Tactic.runTermElab.go
code: /--
Runs a term elaborator inside a tactic.

This function ensures that term elaboration fails when backtracking,
i.e., in `first| tac term | other`.
-/
def runTermElab (k : TermElabM α) (mayPostpone := false) : TacticM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Tactic.runTermElab
code: /--
Runs a term elaborator inside a tactic.

This function ensures that term elaboration fails when backtracking,
i.e., in `first| tac term | other`.
-/
def runTermElab (k : TermElabM α) (mayPostpone := false) : TacticM α 
goal: Lean.Elab.Tactic.TacticM α

full_name: Lean.Elab.Tactic.elabTerm
code: /-- Elaborate `stx` in the current `MVarContext`. If given, the `expectedType` will be used to help
elaboration but not enforced (use `elabTermEnsuringType` to enforce an expected type). -/
def elabTerm (stx : Syntax) (expectedType? : Option Expr) (mayPostpone := false) : TacticM Expr 
goal: Lean.Elab.Tactic.TacticM Lean.Expr

full_name: Lean.Elab.Tactic.elabTermEnsuringType
code: /-- Elaborate `stx` in the current `MVarContext`. If given, the `expectedType` will be used to help
elaboration and then a `TypeMismatchError` will be thrown if the elaborated type doesn't match.  -/
def elabTermEnsuringType (stx : Syntax) (expectedType? : Option Expr) (mayPostpone := false) : TacticM Expr 
goal: Lean.Elab.Tactic.TacticM Lean.Expr

full_name: Lean.Elab.Tactic.closeMainGoalUsing
code: /-- Try to close main goal using `x target`, where `target` is the type of the main goal.  -/
def closeMainGoalUsing (x : Expr → TacticM Expr) (checkUnassigned := true) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.logUnassignedAndAbort
code: def logUnassignedAndAbort (mvarIds : Array MVarId) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.filterOldMVars
code: def filterOldMVars (mvarIds : Array MVarId) (mvarCounterSaved : Nat) : MetaM (Array MVarId) 
goal: Lean.MetaM (Array Lean.MVarId)

full_name: Lean.Elab.Tactic.evalExact
code: @[builtin_tactic «exact»] def evalExact : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.sortMVarIdArrayByIndex
code: def sortMVarIdArrayByIndex [MonadMCtx m] [Monad m] (mvarIds : Array MVarId) : m (Array MVarId) 
goal: m (Array Lean.MVarId)

full_name: Lean.Elab.Tactic.sortMVarIdsByIndex
code: def sortMVarIdsByIndex [MonadMCtx m] [Monad m] (mvarIds : List MVarId) : m (List MVarId) 
goal: m (List Lean.MVarId)

full_name: Lean.Elab.Tactic.withCollectingNewGoalsFrom.go
code: /--
  Execute `k`, and collect new "holes" in the resulting expression.
-/
def withCollectingNewGoalsFrom (k : TacticM Expr) (tagSuffix : Name) (allowNaturalHoles := false) : TacticM (Expr × List MVarId) 
goal: Lean.Elab.Tactic.TacticM (Lean.Expr × List Lean.MVarId)

full_name: Lean.Elab.Tactic.withCollectingNewGoalsFrom
code: /--
  Execute `k`, and collect new "holes" in the resulting expression.
-/
def withCollectingNewGoalsFrom (k : TacticM Expr) (tagSuffix : Name) (allowNaturalHoles := false) : TacticM (Expr × List MVarId) 
goal: Lean.Elab.Tactic.TacticM (Lean.Expr × List Lean.MVarId)

full_name: Lean.Elab.Tactic.elabTermWithHoles
code: /-- Elaborates `stx` and collects the `MVarId`s of any holes that were created during elaboration.

With `allowNaturalHoles := false` (the default), any new natural holes (`_`) which cannot
be synthesized during elaboration cause `elabTermWithHoles` to fail. (Natural goals appearing in
`stx` which were created prior to elaboration are permitted.)

Unnamed `MVarId`s are renamed to share the main goal's tag. If multiple unnamed goals are
encountered, `tagSuffix` is appended to the main goal's tag along with a numerical index.

Note:
* Previously-created `MVarId`s which appear in `stx` are not returned.
* All parts of `elabTermWithHoles` operate at the current `MCtxDepth`, and therefore may assign
metavariables.
* When `allowNaturalHoles := true`, `stx` is elaborated under `withAssignableSyntheticOpaque`,
meaning that `.syntheticOpaque` metavariables might be assigned during elaboration. This is a
consequence of the implementation. -/
def elabTermWithHoles (stx : Syntax) (expectedType? : Option Expr) (tagSuffix : Name) (allowNaturalHoles := false) : TacticM (Expr × List MVarId) 
goal: Lean.Elab.Tactic.TacticM (Lean.Expr × List Lean.MVarId)

full_name: Lean.Elab.Tactic.refineCore
code: /-- If `allowNaturalHoles == true`, then we allow the resultant expression to contain unassigned "natural" metavariables.
   Recall that "natutal" metavariables are created for explicit holes `_` and implicit arguments. They are meant to be
   filled by typing constraints.
   "Synthetic" metavariables are meant to be filled by tactics and are usually created using the synthetic hole notation `?<hole-name>`. -/
def refineCore (stx : Syntax) (tagSuffix : Name) (allowNaturalHoles : Bool) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.evalRefine
code: @[builtin_tactic «refine»] def evalRefine : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalRefine'
code: @[builtin_tactic «refine'»] def evalRefine' : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalSpecialize
code: @[builtin_tactic «specialize»] def evalSpecialize : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.elabTermForApply
code: /--
   Given a tactic
   ```
   apply f
   ```
   we want the `apply` tactic to create all metavariables. The following
   definition will return `@f` for `f`. That is, it will **not** create
   metavariables for implicit arguments.
   A similar method is also used in Lean 3.
   This method is useful when applying lemmas such as:
   ```
   theorem infLeRight {s t : Set α} : s ⊓ t ≤ t
   ```
   where `s ≤ t` here is defined as
   ```
   ∀ {x : α}, x ∈ s → x ∈ t
   ```
-/
def elabTermForApply (stx : Syntax) (mayPostpone := true) : TacticM Expr 
goal: Lean.Elab.Tactic.TacticM Lean.Expr

full_name: Lean.Elab.Tactic.getFVarId
code: def getFVarId (id : Syntax) : TacticM FVarId 
goal: Lean.Elab.Tactic.TacticM Lean.FVarId

full_name: Lean.Elab.Tactic.getFVarIds
code: def getFVarIds (ids : Array Syntax) : TacticM (Array FVarId) 
goal: Lean.Elab.Tactic.TacticM (Array Lean.FVarId)

full_name: Lean.Elab.Tactic.evalApplyLikeTactic
code: def evalApplyLikeTactic (tac : MVarId → Expr → MetaM (List MVarId)) (e : Syntax) : TacticM Unit 
goal: Lean.Elab.Tactic.TacticM Unit

full_name: Lean.Elab.Tactic.evalApply
code: @[builtin_tactic Lean.Parser.Tactic.apply] def evalApply : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalConstructor
code: @[builtin_tactic Lean.Parser.Tactic.constructor] def evalConstructor : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalWithReducible
code: @[builtin_tactic Lean.Parser.Tactic.withReducible] def evalWithReducible : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalWithReducibleAndInstances
code: @[builtin_tactic Lean.Parser.Tactic.withReducibleAndInstances] def evalWithReducibleAndInstances : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.evalWithUnfoldingAll
code: @[builtin_tactic Lean.Parser.Tactic.withUnfoldingAll] def evalWithUnfoldingAll : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: Lean.Elab.Tactic.elabAsFVar
code: /--
  Elaborate `stx`. If it is a free variable, return it. Otherwise, assert it, and return the free variable.
  Note that, the main goal is updated when `Meta.assert` is used in the second case. -/
def elabAsFVar (stx : Syntax) (userName? : Option Name := none) : TacticM FVarId 
goal: Lean.Elab.Tactic.TacticM Lean.FVarId

full_name: Lean.Elab.Tactic.evalRename
code: @[builtin_tactic Lean.Parser.Tactic.rename] def evalRename : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.ElabTerm.0.Lean.Elab.Tactic.preprocessPropToDecide
code: /--
   Make sure `expectedType` does not contain free and metavariables.
   It applies zeta and zetaDelta-reduction to eliminate let-free-vars.
-/
private def preprocessPropToDecide (expectedType : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Tactic.evalDecide
code: @[builtin_tactic Lean.Parser.Tactic.decide] def evalDecide : Tactic 
goal: Lean.Elab.Tactic.Tactic

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Tactic.ElabTerm.0.Lean.Elab.Tactic.mkNativeAuxDecl
code: private def mkNativeAuxDecl (baseName : Name) (type value : Expr) : TermElabM Name 
goal: Lean.Elab.TermElabM Lean.Name

full_name: Lean.Elab.Tactic.evalNativeDecide
code: @[builtin_tactic Lean.Parser.Tactic.nativeDecide] def evalNativeDecide : Tactic 
goal: Lean.Elab.Tactic.Tactic