File: .lake/packages/lean4/src/lean/Lean/Elab/Term.lean

full_name: Lean.Elab.Term.SavedContext.macroStack
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: Lean.Elab.MacroStack

full_name: Lean.Elab.Term.SavedContext.levelNames
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: List Lean.Name

full_name: Lean.Elab.Term.SavedContext.openDecls
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: List Lean.OpenDecl

full_name: Lean.Elab.Term.SavedContext
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: Type

full_name: Lean.Elab.Term.SavedContext.errToSorry
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: Bool

full_name: Lean.Elab.Term.SavedContext.options
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: Lean.Options

full_name: Lean.Elab.Term.SavedContext.declName?
code: /-- Saved context for postponed terms and tactics to be executed. -/
structure SavedContext where
  declName?  : Option Name
  options    : Options
  openDecls  : List OpenDecl
  macroStack : MacroStack
  errToSorry : Bool
  levelNames : List Name
goal: Option Lean.Name

full_name: Lean.Elab.Term.SyntheticMVarKind
code: /-- We use synthetic metavariables as placeholders for pending elaboration steps. -/
inductive SyntheticMVarKind where
  /--
  Use typeclass resolution to synthesize value for metavariable.
  If `extraErrorMsg?` is `some msg`, `msg` contains additional information to include in error messages
  regarding type class synthesis failure.
  -/
  | typeClass (extraErrorMsg? : Option MessageData)
  /-- Use coercion to synthesize value for the metavariable.
  if `f?` is `some f`, we produce an application type mismatch error message.
  Otherwise, if `header?` is `some header`, we generate the error `(header ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)`
  Otherwise, we generate the error `("type mismatch" ++ e ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)` -/
  | coe (header? : Option String) (expectedType : Expr) (e : Expr) (f? : Option Expr)
  /-- Use tactic to synthesize value for metavariable. -/
  | tactic (tacticCode : Syntax) (ctx : SavedContext)
  /-- Metavariable represents a hole whose elaboration has been postponed. -/
  | postponed (ctx : SavedContext)
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.SyntheticMVarKind.tactic
code: /-- We use synthetic metavariables as placeholders for pending elaboration steps. -/
inductive SyntheticMVarKind where
  /--
  Use typeclass resolution to synthesize value for metavariable.
  If `extraErrorMsg?` is `some msg`, `msg` contains additional information to include in error messages
  regarding type class synthesis failure.
  -/
  | typeClass (extraErrorMsg? : Option MessageData)
  /-- Use coercion to synthesize value for the metavariable.
  if `f?` is `some f`, we produce an application type mismatch error message.
  Otherwise, if `header?` is `some header`, we generate the error `(header ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)`
  Otherwise, we generate the error `("type mismatch" ++ e ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)` -/
  | coe (header? : Option String) (expectedType : Expr) (e : Expr) (f? : Option Expr)
  /-- Use tactic to synthesize value for metavariable. -/
  | tactic (tacticCode : Syntax) (ctx : SavedContext)
  /-- Metavariable represents a hole whose elaboration has been postponed. -/
  | postponed (ctx : SavedContext)
  deriving Inhabited
goal: Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.SyntheticMVarKind.typeClass
code: /-- We use synthetic metavariables as placeholders for pending elaboration steps. -/
inductive SyntheticMVarKind where
  /--
  Use typeclass resolution to synthesize value for metavariable.
  If `extraErrorMsg?` is `some msg`, `msg` contains additional information to include in error messages
  regarding type class synthesis failure.
  -/
  | typeClass (extraErrorMsg? : Option MessageData)
  /-- Use coercion to synthesize value for the metavariable.
  if `f?` is `some f`, we produce an application type mismatch error message.
  Otherwise, if `header?` is `some header`, we generate the error `(header ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)`
  Otherwise, we generate the error `("type mismatch" ++ e ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)` -/
  | coe (header? : Option String) (expectedType : Expr) (e : Expr) (f? : Option Expr)
  /-- Use tactic to synthesize value for metavariable. -/
  | tactic (tacticCode : Syntax) (ctx : SavedContext)
  /-- Metavariable represents a hole whose elaboration has been postponed. -/
  | postponed (ctx : SavedContext)
  deriving Inhabited
goal: Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.SyntheticMVarKind.postponed
code: /-- We use synthetic metavariables as placeholders for pending elaboration steps. -/
inductive SyntheticMVarKind where
  /--
  Use typeclass resolution to synthesize value for metavariable.
  If `extraErrorMsg?` is `some msg`, `msg` contains additional information to include in error messages
  regarding type class synthesis failure.
  -/
  | typeClass (extraErrorMsg? : Option MessageData)
  /-- Use coercion to synthesize value for the metavariable.
  if `f?` is `some f`, we produce an application type mismatch error message.
  Otherwise, if `header?` is `some header`, we generate the error `(header ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)`
  Otherwise, we generate the error `("type mismatch" ++ e ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)` -/
  | coe (header? : Option String) (expectedType : Expr) (e : Expr) (f? : Option Expr)
  /-- Use tactic to synthesize value for metavariable. -/
  | tactic (tacticCode : Syntax) (ctx : SavedContext)
  /-- Metavariable represents a hole whose elaboration has been postponed. -/
  | postponed (ctx : SavedContext)
  deriving Inhabited
goal: Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.SyntheticMVarKind.coe
code: /-- We use synthetic metavariables as placeholders for pending elaboration steps. -/
inductive SyntheticMVarKind where
  /--
  Use typeclass resolution to synthesize value for metavariable.
  If `extraErrorMsg?` is `some msg`, `msg` contains additional information to include in error messages
  regarding type class synthesis failure.
  -/
  | typeClass (extraErrorMsg? : Option MessageData)
  /-- Use coercion to synthesize value for the metavariable.
  if `f?` is `some f`, we produce an application type mismatch error message.
  Otherwise, if `header?` is `some header`, we generate the error `(header ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)`
  Otherwise, we generate the error `("type mismatch" ++ e ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)` -/
  | coe (header? : Option String) (expectedType : Expr) (e : Expr) (f? : Option Expr)
  /-- Use tactic to synthesize value for metavariable. -/
  | tactic (tacticCode : Syntax) (ctx : SavedContext)
  /-- Metavariable represents a hole whose elaboration has been postponed. -/
  | postponed (ctx : SavedContext)
  deriving Inhabited
goal: Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.instInhabitedSyntheticMVarKind
code: /-- We use synthetic metavariables as placeholders for pending elaboration steps. -/
inductive SyntheticMVarKind where
  /--
  Use typeclass resolution to synthesize value for metavariable.
  If `extraErrorMsg?` is `some msg`, `msg` contains additional information to include in error messages
  regarding type class synthesis failure.
  -/
  | typeClass (extraErrorMsg? : Option MessageData)
  /-- Use coercion to synthesize value for the metavariable.
  if `f?` is `some f`, we produce an application type mismatch error message.
  Otherwise, if `header?` is `some header`, we generate the error `(header ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)`
  Otherwise, we generate the error `("type mismatch" ++ e ++ "has type" ++ eType ++ "but it is expected to have type" ++ expectedType)` -/
  | coe (header? : Option String) (expectedType : Expr) (e : Expr) (f? : Option Expr)
  /-- Use tactic to synthesize value for metavariable. -/
  | tactic (tacticCode : Syntax) (ctx : SavedContext)
  /-- Metavariable represents a hole whose elaboration has been postponed. -/
  | postponed (ctx : SavedContext)
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.extraMsgToMsg
code: /--
Convert an "extra" optional error message into a message `"\n{msg}"` (if `some msg`) and `MessageData.nil` (if `none`)
-/
def extraMsgToMsg (extraErrorMsg? : Option MessageData) : MessageData 
goal: Lean.MessageData

full_name: Lean.Elab.Term.instToStringSyntheticMVarKind
code: instance : ToString SyntheticMVarKind 
goal: ToString Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.SyntheticMVarDecl.kind
code: structure SyntheticMVarDecl where
  stx : Syntax
  kind : SyntheticMVarKind
  deriving Inhabited
goal: Lean.Elab.Term.SyntheticMVarKind

full_name: Lean.Elab.Term.instInhabitedSyntheticMVarDecl
code: structure SyntheticMVarDecl where
  stx : Syntax
  kind : SyntheticMVarKind
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.SyntheticMVarDecl

full_name: Lean.Elab.Term.SyntheticMVarDecl.stx
code: structure SyntheticMVarDecl where
  stx : Syntax
  kind : SyntheticMVarKind
  deriving Inhabited
goal: Lean.Syntax

full_name: Lean.Elab.Term.SyntheticMVarDecl
code: structure SyntheticMVarDecl where
  stx : Syntax
  kind : SyntheticMVarKind
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.MVarErrorKind
code: /--
  We can optionally associate an error context with a metavariable (see `MVarErrorInfo`).
  We have three different kinds of error context.
-/
inductive MVarErrorKind where
  /-- Metavariable for implicit arguments. `ctx` is the parent application. -/
  | implicitArg (ctx : Expr)
  /-- Metavariable for explicit holes provided by the user (e.g., `_` and `?m`) -/
  | hole
  /-- "Custom", `msgData` stores the additional error messages. -/
  | custom (msgData : MessageData)
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.MVarErrorKind.implicitArg
code: /--
  We can optionally associate an error context with a metavariable (see `MVarErrorInfo`).
  We have three different kinds of error context.
-/
inductive MVarErrorKind where
  /-- Metavariable for implicit arguments. `ctx` is the parent application. -/
  | implicitArg (ctx : Expr)
  /-- Metavariable for explicit holes provided by the user (e.g., `_` and `?m`) -/
  | hole
  /-- "Custom", `msgData` stores the additional error messages. -/
  | custom (msgData : MessageData)
  deriving Inhabited
goal: Lean.Elab.Term.MVarErrorKind

full_name: Lean.Elab.Term.MVarErrorKind.custom
code: /--
  We can optionally associate an error context with a metavariable (see `MVarErrorInfo`).
  We have three different kinds of error context.
-/
inductive MVarErrorKind where
  /-- Metavariable for implicit arguments. `ctx` is the parent application. -/
  | implicitArg (ctx : Expr)
  /-- Metavariable for explicit holes provided by the user (e.g., `_` and `?m`) -/
  | hole
  /-- "Custom", `msgData` stores the additional error messages. -/
  | custom (msgData : MessageData)
  deriving Inhabited
goal: Lean.Elab.Term.MVarErrorKind

full_name: Lean.Elab.Term.instInhabitedMVarErrorKind
code: /--
  We can optionally associate an error context with a metavariable (see `MVarErrorInfo`).
  We have three different kinds of error context.
-/
inductive MVarErrorKind where
  /-- Metavariable for implicit arguments. `ctx` is the parent application. -/
  | implicitArg (ctx : Expr)
  /-- Metavariable for explicit holes provided by the user (e.g., `_` and `?m`) -/
  | hole
  /-- "Custom", `msgData` stores the additional error messages. -/
  | custom (msgData : MessageData)
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.MVarErrorKind

full_name: Lean.Elab.Term.MVarErrorKind.hole
code: /--
  We can optionally associate an error context with a metavariable (see `MVarErrorInfo`).
  We have three different kinds of error context.
-/
inductive MVarErrorKind where
  /-- Metavariable for implicit arguments. `ctx` is the parent application. -/
  | implicitArg (ctx : Expr)
  /-- Metavariable for explicit holes provided by the user (e.g., `_` and `?m`) -/
  | hole
  /-- "Custom", `msgData` stores the additional error messages. -/
  | custom (msgData : MessageData)
  deriving Inhabited
goal: Lean.Elab.Term.MVarErrorKind

full_name: Lean.Elab.Term.instToStringMVarErrorKind
code: instance : ToString MVarErrorKind 
goal: ToString Lean.Elab.Term.MVarErrorKind

full_name: Lean.Elab.Term.MVarErrorInfo.ref
code: /--
  We can optionally associate an error context with metavariables.
-/
structure MVarErrorInfo where
  mvarId    : MVarId
  ref       : Syntax
  kind      : MVarErrorKind
  deriving Inhabited
goal: Lean.Syntax

full_name: Lean.Elab.Term.MVarErrorInfo
code: /--
  We can optionally associate an error context with metavariables.
-/
structure MVarErrorInfo where
  mvarId    : MVarId
  ref       : Syntax
  kind      : MVarErrorKind
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.MVarErrorInfo.mvarId
code: /--
  We can optionally associate an error context with metavariables.
-/
structure MVarErrorInfo where
  mvarId    : MVarId
  ref       : Syntax
  kind      : MVarErrorKind
  deriving Inhabited
goal: Lean.MVarId

full_name: Lean.Elab.Term.MVarErrorInfo.kind
code: /--
  We can optionally associate an error context with metavariables.
-/
structure MVarErrorInfo where
  mvarId    : MVarId
  ref       : Syntax
  kind      : MVarErrorKind
  deriving Inhabited
goal: Lean.Elab.Term.MVarErrorKind

full_name: Lean.Elab.Term.instInhabitedMVarErrorInfo
code: /--
  We can optionally associate an error context with metavariables.
-/
structure MVarErrorInfo where
  mvarId    : MVarId
  ref       : Syntax
  kind      : MVarErrorKind
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.MVarErrorInfo

full_name: Lean.Elab.Term.instInhabitedLetRecToLift
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.LetRecToLift

full_name: Lean.Elab.Term.LetRecToLift.lctx
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.LocalContext

full_name: Lean.Elab.Term.LetRecToLift.shortDeclName
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.Name

full_name: Lean.Elab.Term.LetRecToLift.mvarId
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.MVarId

full_name: Lean.Elab.Term.LetRecToLift.termination
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.Elab.WF.TerminationHints

full_name: Lean.Elab.Term.LetRecToLift.ref
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.Syntax

full_name: Lean.Elab.Term.LetRecToLift.fvarId
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.FVarId

full_name: Lean.Elab.Term.LetRecToLift.attrs
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Array Lean.Elab.Attribute

full_name: Lean.Elab.Term.LetRecToLift
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.LetRecToLift.localInstances
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.LocalInstances

full_name: Lean.Elab.Term.LetRecToLift.type
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.Expr

full_name: Lean.Elab.Term.LetRecToLift.val
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.Expr

full_name: Lean.Elab.Term.LetRecToLift.declName
code: /--
  Nested `let rec` expressions are eagerly lifted by the elaborator.
  We store the information necessary for performing the lifting here.
-/
structure LetRecToLift where
  ref            : Syntax
  fvarId         : FVarId
  attrs          : Array Attribute
  shortDeclName  : Name
  declName       : Name
  lctx           : LocalContext
  localInstances : LocalInstances
  type           : Expr
  val            : Expr
  mvarId         : MVarId
  termination    : WF.TerminationHints
  deriving Inhabited
goal: Lean.Name

full_name: Lean.Elab.Term.State.pendingMVars
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: List Lean.MVarId

full_name: Lean.Elab.Term.State.mvarErrorInfos
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: List Lean.Elab.Term.MVarErrorInfo

full_name: Lean.Elab.Term.State.levelNames
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: List Lean.Name

full_name: Lean.Elab.Term.State.mvarArgNames
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: Lean.MVarIdMap Lean.Name

full_name: Lean.Elab.Term.State.syntheticMVars
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: Lean.MVarIdMap Lean.Elab.Term.SyntheticMVarDecl

full_name: Lean.Elab.Term.instInhabitedState
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: Inhabited Lean.Elab.Term.State

full_name: Lean.Elab.Term.State
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Term.State.letRecsToLift
code: /--
  State of the `TermElabM` monad.
-/
structure State where
  levelNames        : List Name       := []
  syntheticMVars    : MVarIdMap SyntheticMVarDecl := {}
  pendingMVars      : List MVarId := {}
  /-- List of errors associated to a metavariable that are shown to the user if the metavariable could not be fully instantiated -/
  mvarErrorInfos    : List MVarErrorInfo := []
  /--
    `mvarArgNames` stores the argument names associated to metavariables.
    These are used in combination with `mvarErrorInfos` for throwing errors about metavariables that could not be fully instantiated.
    For example when elaborating `List _`, the argument name of the placeholder will be `α`.

    While elaborating an application, `mvarArgNames` is set for each metavariable argument, using the available argument name.
    This may happen before or after the `mvarErrorInfos` is set for the same metavariable.

    We used to store the argument names in `mvarErrorInfos`, updating the `MVarErrorInfos` to add the argument name when it is available,
    but this doesn't work if the argument name is available _before_ the `mvarErrorInfos` is set for that metavariable.
  -/
  mvarArgNames      : MVarIdMap Name := {}
  letRecsToLift     : List LetRecToLift := []
  deriving Inhabited
goal: List Lean.Elab.Term.LetRecToLift

full_name: Lean.Elab.Term.SavedState.meta
code: /--
  Backtrackable state for the `TermElabM` monad.
-/
structure SavedState where
  meta   : Meta.SavedState
  «elab» : State
  deriving Nonempty
goal: Lean.Meta.SavedState

full_name: Lean.Elab.Term.instNonemptySavedState
code: /--
  Backtrackable state for the `TermElabM` monad.
-/
structure SavedState where
  meta   : Meta.SavedState
  «elab» : State
  deriving Nonempty
goal: Nonempty Lean.Elab.Term.SavedState

full_name: Lean.Elab.Term.SavedState
code: /--
  Backtrackable state for the `TermElabM` monad.
-/
structure SavedState where
  meta   : Meta.SavedState
  «elab» : State
  deriving Nonempty
goal: Type

full_name: Lean.Elab.Term.SavedState.elab
code: /--
  Backtrackable state for the `TermElabM` monad.
-/
structure SavedState where
  meta   : Meta.SavedState
  «elab» : State
  deriving Nonempty
goal: Lean.Elab.Term.State

full_name: Lean.Elab.Tactic.State
code: /--
  State of the `TacticM` monad.
-/
structure State where
  goals : List MVarId
  deriving Inhabited
goal: Type

full_name: Lean.Elab.Tactic.instInhabitedState
code: /--
  State of the `TacticM` monad.
-/
structure State where
  goals : List MVarId
  deriving Inhabited
goal: Inhabited Lean.Elab.Tactic.State

full_name: Lean.Elab.Tactic.State.goals
code: /--
  State of the `TacticM` monad.
-/
structure State where
  goals : List MVarId
  deriving Inhabited
goal: List Lean.MVarId

full_name: Lean.Elab.Tactic.Snapshot.core
code: /--
  Snapshots are used to implement the `save` tactic.
  This tactic caches the state of the system, and allows us to "replay"
  expensive proofs efficiently. This is only relevant implementing the
  LSP server.
-/
structure Snapshot where
  core   : Core.State
  meta   : Meta.State
  term   : Term.State
  tactic : Tactic.State
  stx    : Syntax
goal: Lean.Core.State

full_name: Lean.Elab.Tactic.Snapshot.tactic
code: /--
  Snapshots are used to implement the `save` tactic.
  This tactic caches the state of the system, and allows us to "replay"
  expensive proofs efficiently. This is only relevant implementing the
  LSP server.
-/
structure Snapshot where
  core   : Core.State
  meta   : Meta.State
  term   : Term.State
  tactic : Tactic.State
  stx    : Syntax
goal: Lean.Elab.Tactic.State

full_name: Lean.Elab.Tactic.Snapshot
code: /--
  Snapshots are used to implement the `save` tactic.
  This tactic caches the state of the system, and allows us to "replay"
  expensive proofs efficiently. This is only relevant implementing the
  LSP server.
-/
structure Snapshot where
  core   : Core.State
  meta   : Meta.State
  term   : Term.State
  tactic : Tactic.State
  stx    : Syntax
goal: Type

full_name: Lean.Elab.Tactic.Snapshot.meta
code: /--
  Snapshots are used to implement the `save` tactic.
  This tactic caches the state of the system, and allows us to "replay"
  expensive proofs efficiently. This is only relevant implementing the
  LSP server.
-/
structure Snapshot where
  core   : Core.State
  meta   : Meta.State
  term   : Term.State
  tactic : Tactic.State
  stx    : Syntax
goal: Lean.Meta.State

full_name: Lean.Elab.Tactic.Snapshot.term
code: /--
  Snapshots are used to implement the `save` tactic.
  This tactic caches the state of the system, and allows us to "replay"
  expensive proofs efficiently. This is only relevant implementing the
  LSP server.
-/
structure Snapshot where
  core   : Core.State
  meta   : Meta.State
  term   : Term.State
  tactic : Tactic.State
  stx    : Syntax
goal: Lean.Elab.Term.State

full_name: Lean.Elab.Tactic.Snapshot.stx
code: /--
  Snapshots are used to implement the `save` tactic.
  This tactic caches the state of the system, and allows us to "replay"
  expensive proofs efficiently. This is only relevant implementing the
  LSP server.
-/
structure Snapshot where
  core   : Core.State
  meta   : Meta.State
  term   : Term.State
  tactic : Tactic.State
  stx    : Syntax
goal: Lean.Syntax

full_name: Lean.Elab.Tactic.CacheKey.pos
code: /--
  Key for the cache used to implement the `save` tactic.
-/
structure CacheKey where
  mvarId : MVarId -- TODO: should include all goals
  pos    : String.Pos
  deriving BEq, Hashable, Inhabited
goal: String.Pos

full_name: Lean.Elab.Tactic.instHashableCacheKey
code: /--
  Key for the cache used to implement the `save` tactic.
-/
structure CacheKey where
  mvarId : MVarId -- TODO: should include all goals
  pos    : String.Pos
  deriving BEq, Hashable, Inhabited
goal: Hashable Lean.Elab.Tactic.CacheKey

full_name: Lean.Elab.Tactic.instInhabitedCacheKey
code: /--
  Key for the cache used to implement the `save` tactic.
-/
structure CacheKey where
  mvarId : MVarId -- TODO: should include all goals
  pos    : String.Pos
  deriving BEq, Hashable, Inhabited
goal: Inhabited Lean.Elab.Tactic.CacheKey

full_name: Lean.Elab.Tactic.instBEqCacheKey
code: /--
  Key for the cache used to implement the `save` tactic.
-/
structure CacheKey where
  mvarId : MVarId -- TODO: should include all goals
  pos    : String.Pos
  deriving BEq, Hashable, Inhabited
goal: BEq Lean.Elab.Tactic.CacheKey

full_name: Lean.Elab.Tactic.CacheKey.mvarId
code: /--
  Key for the cache used to implement the `save` tactic.
-/
structure CacheKey where
  mvarId : MVarId -- TODO: should include all goals
  pos    : String.Pos
  deriving BEq, Hashable, Inhabited
goal: Lean.MVarId

full_name: Lean.Elab.Tactic.CacheKey
code: /--
  Key for the cache used to implement the `save` tactic.
-/
structure CacheKey where
  mvarId : MVarId -- TODO: should include all goals
  pos    : String.Pos
  deriving BEq, Hashable, Inhabited
goal: Type

full_name: Lean.Elab.Tactic.Cache.post
code: /--
  Cache for the `save` tactic.
-/
structure Cache where
   pre  : PHashMap CacheKey Snapshot := {}
   post : PHashMap CacheKey Snapshot := {}
   deriving Inhabited
goal: Lean.PHashMap Lean.Elab.Tactic.CacheKey Lean.Elab.Tactic.Snapshot

full_name: Lean.Elab.Tactic.instInhabitedCache
code: /--
  Cache for the `save` tactic.
-/
structure Cache where
   pre  : PHashMap CacheKey Snapshot := {}
   post : PHashMap CacheKey Snapshot := {}
   deriving Inhabited
goal: Inhabited Lean.Elab.Tactic.Cache

full_name: Lean.Elab.Tactic.Cache.pre
code: /--
  Cache for the `save` tactic.
-/
structure Cache where
   pre  : PHashMap CacheKey Snapshot := {}
   post : PHashMap CacheKey Snapshot := {}
   deriving Inhabited
goal: Lean.PHashMap Lean.Elab.Tactic.CacheKey Lean.Elab.Tactic.Snapshot

full_name: Lean.Elab.Tactic.Cache
code: /--
  Cache for the `save` tactic.
-/
structure Cache where
   pre  : PHashMap CacheKey Snapshot := {}
   post : PHashMap CacheKey Snapshot := {}
   deriving Inhabited
goal: Type

full_name: Lean.Elab.Tactic.SavedState.term
code: structure SavedState where
  term   : Term.SavedState
  tactic : State
goal: Lean.Elab.Term.SavedState

full_name: Lean.Elab.Tactic.SavedState.tactic
code: structure SavedState where
  term   : Term.SavedState
  tactic : State
goal: Lean.Elab.Tactic.State

full_name: Lean.Elab.Tactic.SavedState
code: structure SavedState where
  term   : Term.SavedState
  tactic : State
goal: Type

full_name: Lean.Elab.Tactic.TacticFinished.state?
code: /-- State after finishing execution of a tactic. -/
structure TacticFinished where
  /-- Reusable state, if no fatal exception occurred. -/
  state? : Option SavedState
deriving Inhabited
goal: Option Lean.Elab.Tactic.SavedState

full_name: Lean.Elab.Tactic.TacticFinished
code: /-- State after finishing execution of a tactic. -/
structure TacticFinished where
  /-- Reusable state, if no fatal exception occurred. -/
  state? : Option SavedState
deriving Inhabited
goal: Type

full_name: Lean.Elab.Tactic.instInhabitedTacticFinished
code: /-- State after finishing execution of a tactic. -/
structure TacticFinished where
  /-- Reusable state, if no fatal exception occurred. -/
  state? : Option SavedState
deriving Inhabited
goal: Inhabited Lean.Elab.Tactic.TacticFinished

full_name: Lean.Elab.Tactic.instInhabitedTacticParsedSnapshotData
code: /-- Snapshot just before execution of a tactic. -/
structure TacticParsedSnapshotData extends Language.Snapshot where
  /-- Syntax tree of the tactic, stored and compared for incremental reuse. -/
  stx      : Syntax
  /-- Task for state after tactic execution. -/
  finished : Task TacticFinished
deriving Inhabited
goal: Inhabited Lean.Elab.Tactic.TacticParsedSnapshotData

full_name: Lean.Elab.Tactic.TacticParsedSnapshotData.stx
code: /-- Snapshot just before execution of a tactic. -/
structure TacticParsedSnapshotData extends Language.Snapshot where
  /-- Syntax tree of the tactic, stored and compared for incremental reuse. -/
  stx      : Syntax
  /-- Task for state after tactic execution. -/
  finished : Task TacticFinished
deriving Inhabited
goal: Lean.Syntax

full_name: Lean.Elab.Tactic.TacticParsedSnapshotData
code: /-- Snapshot just before execution of a tactic. -/
structure TacticParsedSnapshotData extends Language.Snapshot where
  /-- Syntax tree of the tactic, stored and compared for incremental reuse. -/
  stx      : Syntax
  /-- Task for state after tactic execution. -/
  finished : Task TacticFinished
deriving Inhabited
goal: Type

full_name: Lean.Elab.Tactic.TacticParsedSnapshotData.finished
code: /-- Snapshot just before execution of a tactic. -/
structure TacticParsedSnapshotData extends Language.Snapshot where
  /-- Syntax tree of the tactic, stored and compared for incremental reuse. -/
  stx      : Syntax
  /-- Task for state after tactic execution. -/
  finished : Task TacticFinished
deriving Inhabited
goal: Task Lean.Elab.Tactic.TacticFinished

full_name: Lean.Elab.Tactic.TacticParsedSnapshot
code: /-- State after execution of a single synchronous tactic step. -/
inductive TacticParsedSnapshot where
  | mk (data : TacticParsedSnapshotData) (next : Array (SnapshotTask TacticParsedSnapshot))
deriving Inhabited
goal: Type

full_name: Lean.Elab.Tactic.instInhabitedTacticParsedSnapshot
code: /-- State after execution of a single synchronous tactic step. -/
inductive TacticParsedSnapshot where
  | mk (data : TacticParsedSnapshotData) (next : Array (SnapshotTask TacticParsedSnapshot))
deriving Inhabited
goal: Inhabited Lean.Elab.Tactic.TacticParsedSnapshot

full_name: Lean.Elab.Tactic.TacticParsedSnapshot.mk
code: /-- State after execution of a single synchronous tactic step. -/
inductive TacticParsedSnapshot where
  | mk (data : TacticParsedSnapshotData) (next : Array (SnapshotTask TacticParsedSnapshot))
deriving Inhabited
goal: Lean.Elab.Tactic.TacticParsedSnapshot

full_name: Lean.Elab.Tactic.TacticParsedSnapshot.data
code: abbrev TacticParsedSnapshot.data : TacticParsedSnapshot → TacticParsedSnapshotData
  
goal: Lean.Elab.Tactic.TacticParsedSnapshot → Lean.Elab.Tactic.TacticParsedSnapshotData

full_name: Lean.Elab.Tactic.TacticParsedSnapshot.next
code: /-- Potential, potentially parallel, follow-up tactic executions. -/
-- In the first, non-parallel version, each task will depend on its predecessor
abbrev TacticParsedSnapshot.next : TacticParsedSnapshot → Array (SnapshotTask TacticParsedSnapshot)
  
goal: Lean.Elab.Tactic.TacticParsedSnapshot → Array (Lean.Language.SnapshotTask Lean.Elab.Tactic.TacticParsedSnapshot)

full_name: Lean.Elab.Tactic.instToSnapshotTreeTacticParsedSnapshot.go
code: partial instance : ToSnapshotTree TacticParsedSnapshot 
goal: Lean.Elab.Tactic.TacticParsedSnapshot → Lean.Language.SnapshotTree

full_name: Lean.Elab.Tactic.instToSnapshotTreeTacticParsedSnapshot
code: partial instance : ToSnapshotTree TacticParsedSnapshot 
goal: Lean.Language.ToSnapshotTree Lean.Elab.Tactic.TacticParsedSnapshot

full_name: Lean.Elab.Term.Context.auxDeclToFullName
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Lean.FVarIdMap Lean.Name

full_name: Lean.Elab.Term.Context.autoBoundImplicitForbidden
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Lean.Name → Bool

full_name: Lean.Elab.Term.Context.macroStack
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Lean.Elab.MacroStack

full_name: Lean.Elab.Term.Context.sectionFVars
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Lean.NameMap Lean.Expr

full_name: Lean.Elab.Term.Context.declName?
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Option Lean.Name

full_name: Lean.Elab.Term.Context.implicitLambda
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.holesAsSyntheticOpaque
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.sectionVars
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Lean.NameMap Lean.Name

full_name: Lean.Elab.Term.Context.heedElabAsElim
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.inPattern
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.saveRecAppSyntax
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.isNoncomputableSection
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.tacticCache?
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Option (IO.Ref Lean.Elab.Tactic.Cache)

full_name: Lean.Elab.Term.Context.mayPostpone
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.tacSnap?
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Option (Lean.Language.SnapshotBundle Lean.Elab.Tactic.TacticParsedSnapshot)

full_name: Lean.Elab.Term.Context
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Type

full_name: Lean.Elab.Term.Context.ignoreTCFailures
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.errToSorry
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.autoBoundImplicit
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Bool

full_name: Lean.Elab.Term.Context.autoBoundImplicits
code: structure Context where
  declName? : Option Name := none
  /--
    Map `.auxDecl` local declarations used to encode recursive declarations to their full-names.
  -/
  auxDeclToFullName : FVarIdMap Name  := {}
  macroStack        : MacroStack      := []
  /--
     When `mayPostpone == true`, an elaboration function may interrupt its execution by throwing `Exception.postpone`.
     The function `elabTerm` catches this exception and creates fresh synthetic metavariable `?m`, stores `?m` in
     the list of pending synthetic metavariables, and returns `?m`. -/
  mayPostpone : Bool := true
  /--
     When `errToSorry` is set to true, the method `elabTerm` catches
     exceptions and converts them into synthetic `sorry`s.
     The implementation of choice nodes and overloaded symbols rely on the fact
     that when `errToSorry` is set to false for an elaboration function `F`, then
     `errToSorry` remains `false` for all elaboration functions invoked by `F`.
     That is, it is safe to transition `errToSorry` from `true` to `false`, but
     we must not set `errToSorry` to `true` when it is currently set to `false`. -/
  errToSorry : Bool := true
  /--
     When `autoBoundImplicit` is set to true, instead of producing
     an "unknown identifier" error for unbound variables, we generate an
     internal exception. This exception is caught at `elabBinders` and
     `elabTypeWithUnboldImplicit`. Both methods add implicit declarations
     for the unbound variable and try again. -/
  autoBoundImplicit  : Bool            := false
  autoBoundImplicits : PArray Expr := {}
  /--
    A name `n` is only eligible to be an auto implicit name if `autoBoundImplicitForbidden n = false`.
    We use this predicate to disallow `f` to be considered an auto implicit name in a definition such
    as
    ```
    def f : f → Bool := fun _ => true
    ```
  -/
  autoBoundImplicitForbidden : Name → Bool := fun _ => false
  /-- Map from user name to internal unique name -/
  sectionVars        : NameMap Name    := {}
  /-- Map from internal name to fvar -/
  sectionFVars       : NameMap Expr    := {}
  /-- Enable/disable implicit lambdas feature. -/
  implicitLambda     : Bool            := true
  /-- Heed `elab_as_elim` attribute. -/
  heedElabAsElim     : Bool            := true
  /-- Noncomputable sections automatically add the `noncomputable` modifier to any declaration we cannot generate code for. -/
  isNoncomputableSection : Bool        := false
  /-- When `true` we skip TC failures. We use this option when processing patterns. -/
  ignoreTCFailures : Bool := false
  /-- `true` when elaborating patterns. It affects how we elaborate named holes. -/
  inPattern        : Bool := false
  /-- Cache for the `save` tactic. It is only `some` in the LSP server. -/
  tacticCache?     : Option (IO.Ref Tactic.Cache) := none
  /--
  Snapshot for incremental processing of current tactic, if any.

  Invariant: if the bundle's `old?` is set, then the state *up to the start* of the tactic is
  unchanged, i.e. reuse is possible.
  -/
  tacSnap?         : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot) := none
  /--
  If `true`, we store in the `Expr` the `Syntax` for recursive applications (i.e., applications
  of free variables tagged with `isAuxDecl`). We store the `Syntax` using `mkRecAppWithSyntax`.
  We use the `Syntax` object to produce better error messages at `Structural.lean` and `WF.lean`. -/
  saveRecAppSyntax : Bool := true
  /--
  If `holesAsSyntheticOpaque` is `true`, then we mark metavariables associated
  with `_`s as `syntheticOpaque` if they do not occur in patterns.
  This option is useful when elaborating terms in tactics such as `refine'` where
  we want holes there to become new goals. See issue #1681, we have
  `refine' (fun x => _)
  -/
  holesAsSyntheticOpaque : Bool := false
goal: Lean.PArray Lean.Expr

full_name: Lean.Elab.Term.TermElabM
code: abbrev TermElabM 
goal: Type

full_name: Lean.Elab.Term.TermElab
code: abbrev TermElab  
goal: Type

full_name: Lean.Elab.Term.instMonadTermElabM
code: @[always_inline]
instance : Monad TermElabM 
goal: Monad Lean.Elab.TermElabM

full_name: Lean.Elab.Term.instInhabitedTermElabM
code: instance : Inhabited (TermElabM α) 
goal: Inhabited (Lean.Elab.TermElabM α)

full_name: Lean.Elab.Term.saveState
code: protected def saveState : TermElabM SavedState 
goal: Lean.Elab.TermElabM Lean.Elab.Term.SavedState

full_name: Lean.Elab.Term.SavedState.restore
code: def SavedState.restore (s : SavedState) (restoreInfo : Bool := false) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.withRestoreOrSaveFull
code: /--
Like `Meta.withRestoreOrSaveFull` for `TermElabM`, but also takes a `tacSnap?` that
* when running `act`, is set as `Context.tacSnap?`
* otherwise (i.e. on restore) is used to update the new snapshot promise to the old task's
  value.
This extra restore step is necessary because while `reusableResult?` can be used to replay any
effects on `State`, `Context.tacSnap?` is not part of it but changed via an `IO` side effect, so
it needs to be replayed separately.

We use an explicit parameter instead of accessing `Context.tacSnap?` directly because this prevents
`withRestoreOrSaveFull` and `withReader` from being used in the wrong order.
-/
@[specialize]
def withRestoreOrSaveFull (reusableResult? : Option (α × SavedState))
    (tacSnap? : Option (Language.SnapshotBundle Tactic.TacticParsedSnapshot)) (act : TermElabM α) :
    TermElabM (α × SavedState) 
goal: Lean.Elab.TermElabM (α × Lean.Elab.Term.SavedState)

full_name: Lean.Elab.Term.instMonadBacktrackSavedStateTermElabM
code: instance : MonadBacktrack SavedState TermElabM 
goal: Lean.MonadBacktrack Lean.Elab.Term.SavedState Lean.Elab.TermElabM

full_name: Lean.Elab.Term.withReuseContext
code: /--
Incremental elaboration helper. Avoids leakage of data from outside syntax via the monadic context
when running `act` on `stx` by
* setting `stx` as the `ref` and
* deactivating `suppressElabErrors` if `stx` is `missing`-free, which also helps with not hiding
  useful errors in this part of the input. Note that if `stx` has `missing`, this should always be
  true for the outer syntax as well, so taking the old value of `suppressElabErrors` into account
  should not introduce data leakage.

This combinator should always be used when narrowing reuse to a syntax subtree, usually (in the case
of tactics, to be generalized) via `withNarrowed(Arg)TacticReuse`.
-/
def withReuseContext [Monad m] [MonadWithReaderOf Core.Context m] (stx : Syntax) (act : m α) :
    m α 
goal: m α

full_name: Lean.Elab.Term.withNarrowedTacticReuse
code: /--
Manages reuse information for nested tactics by `split`ting given syntax into an outer and inner
part. `act` is then run on the inner part but with reuse information adjusted as following:
* If the old (from `tacSnap?`'s `SyntaxGuarded.stx`) and new (from `stx`) outer syntax are not
  identical according to `Syntax.eqWithInfo`, reuse is disabled.
* Otherwise, the old syntax as stored in `tacSnap?` is updated to the old *inner* syntax.
* In any case, `withReuseContext` is used on the new inner syntax to further prepare the monadic
  context.

For any tactic that participates in reuse, `withNarrowedTacticReuse` should be applied to the
tactic's syntax and `act` should be used to do recursive tactic evaluation of nested parts.
-/
def withNarrowedTacticReuse [Monad m] [MonadWithReaderOf Core.Context m]
    [MonadWithReaderOf Context m] [MonadOptions m] (split : Syntax → Syntax × Syntax)
    (act : Syntax → m α) (stx : Syntax) : m α 
goal: m α

full_name: Lean.Elab.Term.withNarrowedArgTacticReuse
code: /--
A variant of `withNarrowedTacticReuse` that uses `stx[argIdx]` as the inner syntax and all `stx`
child nodes before that as the outer syntax, i.e. reuse is disabled if there was any change before
`argIdx`.

NOTE: child nodes after `argIdx` are not tested (which would almost always disable reuse as they are
necessarily shifted by changes at `argIdx`) so it must be ensured that the result of `arg` does not
depend on them (i.e. they should not be inspected beforehand).
-/
def withNarrowedArgTacticReuse [Monad m] [MonadWithReaderOf Core.Context m] [MonadWithReaderOf Context m]
    [MonadOptions m] (argIdx : Nat) (act : Syntax → m α) (stx : Syntax) : m α 
goal: m α

full_name: Lean.Elab.Term.withoutTacticIncrementality
code: /--
Disables incremental tactic reuse *and* reporting for `act` if `cond` is true by setting `tacSnap?`
to `none`. This should be done for tactic blocks that are run multiple times as otherwise the
reported progress will jump back and forth (and partial reuse for these kinds of tact blocks is
similarly questionable).
-/
def withoutTacticIncrementality [Monad m] [MonadWithReaderOf Context m] [MonadOptions m]
    (cond : Bool) (act : m α) : m α 
goal: m α

full_name: Lean.Elab.Term.withoutTacticReuse
code: /-- Disables incremental tactic reuse for `act` if `cond` is true. -/
def withoutTacticReuse [Monad m] [MonadWithReaderOf Context m] [MonadOptions m]
    (cond : Bool) (act : m α) : m α 
goal: m α

full_name: Lean.Elab.Term.TermElabResult
code: abbrev TermElabResult (α : Type) 
goal: Type

full_name: Lean.Elab.Term.observing
code: /--
  Execute `x`, save resulting expression and new state.
  We remove any `Info` created by `x`.
  The info nodes are committed when we execute `applyResult`.
  We use `observing` to implement overloaded notation and decls.
  We want to save `Info` nodes for the chosen alternative.
-/
def observing (x : TermElabM α) : TermElabM (TermElabResult α) 
goal: Lean.Elab.TermElabM (Lean.Elab.Term.TermElabResult α)

full_name: Lean.Elab.Term.applyResult
code: /--
  Apply the result/exception and state captured with `observing`.
  We use this method to implement overloaded notation and symbols. -/
def applyResult (result : TermElabResult α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.commitIfDidNotPostpone
code: /--
  Execute `x`, but keep state modifications only if `x` did not postpone.
  This method is useful to implement elaboration functions that cannot decide whether
  they need to postpone or not without updating the state. -/
def commitIfDidNotPostpone (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.getLevelNames
code: /--
  Return the universe level names explicitly provided by the user.
-/
def getLevelNames : TermElabM (List Name) 
goal: Lean.Elab.TermElabM (List Lean.Name)

full_name: Lean.Elab.Term.getFVarLocalDecl!
code: /--
  Given a free variable `fvar`, return its declaration.
  This function panics if `fvar` is not a free variable.
-/
def getFVarLocalDecl! (fvar : Expr) : TermElabM LocalDecl 
goal: Lean.Elab.TermElabM Lean.LocalDecl

full_name: Lean.Elab.Term.instAddErrorMessageContextTermElabM
code: instance : AddErrorMessageContext TermElabM 
goal: Lean.AddErrorMessageContext Lean.Elab.TermElabM

full_name: Lean.Elab.Term.withoutSavingRecAppSyntax
code: /--
  Execute `x` without storing `Syntax` for recursive applications. See `saveRecAppSyntax` field at `Context`.
-/
def withoutSavingRecAppSyntax (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.mkTermElabAttributeUnsafe
code: unsafe def mkTermElabAttributeUnsafe (ref : Name) : IO (KeyedDeclsAttribute TermElab) 
goal: IO (Lean.KeyedDeclsAttribute Lean.Elab.Term.TermElab)

full_name: Lean.Elab.Term.mkTermElabAttribute
code: @[implemented_by mkTermElabAttributeUnsafe]
opaque mkTermElabAttribute (ref : Name) : IO (KeyedDeclsAttribute TermElab)
goal: IO (Lean.KeyedDeclsAttribute Lean.Elab.Term.TermElab)

full_name: Lean.Elab.Term.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.3501
code: builtin_initialize termElabAttribute : KeyedDeclsAttribute TermElab ← mkTermElabAttribute decl_name%
goal: IO (Lean.KeyedDeclsAttribute Lean.Elab.Term.TermElab)

full_name: Lean.Elab.Term.termElabAttribute
code: builtin_initialize termElabAttribute : KeyedDeclsAttribute TermElab ← mkTermElabAttribute decl_name%
goal: Lean.KeyedDeclsAttribute Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.LVal.fieldIdx
code: /--
  Auxiliary datatype for presenting a Lean lvalue modifier.
  We represent an unelaborated lvalue as a `Syntax` (or `Expr`) and `List LVal`.
  Example: `a.foo.1` is represented as the `Syntax` `a` and the list
  `[LVal.fieldName "foo", LVal.fieldIdx 1]`.
-/
inductive LVal where
  | fieldIdx  (ref : Syntax) (i : Nat)
  /-- Field `suffix?` is for producing better error messages because `x.y` may be a field access or a hierarchical/composite name.
  `ref` is the syntax object representing the field. `fullRef` includes the LHS. -/
  | fieldName (ref : Syntax) (name : String) (suffix? : Option Name) (fullRef : Syntax)
goal: Lean.Elab.Term.LVal

full_name: Lean.Elab.Term.LVal.fieldName
code: /--
  Auxiliary datatype for presenting a Lean lvalue modifier.
  We represent an unelaborated lvalue as a `Syntax` (or `Expr`) and `List LVal`.
  Example: `a.foo.1` is represented as the `Syntax` `a` and the list
  `[LVal.fieldName "foo", LVal.fieldIdx 1]`.
-/
inductive LVal where
  | fieldIdx  (ref : Syntax) (i : Nat)
  /-- Field `suffix?` is for producing better error messages because `x.y` may be a field access or a hierarchical/composite name.
  `ref` is the syntax object representing the field. `fullRef` includes the LHS. -/
  | fieldName (ref : Syntax) (name : String) (suffix? : Option Name) (fullRef : Syntax)
goal: Lean.Elab.Term.LVal

full_name: Lean.Elab.Term.LVal
code: /--
  Auxiliary datatype for presenting a Lean lvalue modifier.
  We represent an unelaborated lvalue as a `Syntax` (or `Expr`) and `List LVal`.
  Example: `a.foo.1` is represented as the `Syntax` `a` and the list
  `[LVal.fieldName "foo", LVal.fieldIdx 1]`.
-/
inductive LVal where
  | fieldIdx  (ref : Syntax) (i : Nat)
  /-- Field `suffix?` is for producing better error messages because `x.y` may be a field access or a hierarchical/composite name.
  `ref` is the syntax object representing the field. `fullRef` includes the LHS. -/
  | fieldName (ref : Syntax) (name : String) (suffix? : Option Name) (fullRef : Syntax)
goal: Type

full_name: Lean.Elab.Term.LVal.getRef
code: def LVal.getRef : LVal → Syntax
  
goal: Lean.Elab.Term.LVal → Lean.Syntax

full_name: Lean.Elab.Term.LVal.isFieldName
code: def LVal.isFieldName : LVal → Bool
  
goal: Lean.Elab.Term.LVal → Bool

full_name: Lean.Elab.Term.instToStringLVal
code: instance : ToString LVal 
goal: ToString Lean.Elab.Term.LVal

full_name: Lean.Elab.Term.getDeclName?
code: /-- Return the name of the declaration being elaborated if available. -/
def getDeclName? : TermElabM (Option Name) 
goal: Lean.Elab.TermElabM (Option Lean.Name)

full_name: Lean.Elab.Term.getLetRecsToLift
code: /-- Return the list of nested `let rec` declarations that need to be lifted. -/
def getLetRecsToLift : TermElabM (List LetRecToLift) 
goal: Lean.Elab.TermElabM (List Lean.Elab.Term.LetRecToLift)

full_name: Lean.Elab.Term.getMVarDecl
code: /-- Return the declaration of the given metavariable -/
def getMVarDecl (mvarId : MVarId) : TermElabM MetavarDecl 
goal: Lean.Elab.TermElabM Lean.MetavarDecl

full_name: Lean.Elab.Term.instMonadParentDeclTermElabM
code: instance : MonadParentDecl TermElabM 
goal: Lean.Elab.MonadParentDecl Lean.Elab.TermElabM

full_name: Lean.Elab.Term.withDeclName
code: /-- Execute `withSaveParentDeclInfoContext x` with `declName? := name`. See `getDeclName?`. -/
def withDeclName (name : Name) (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.setLevelNames
code: /-- Update the universe level parameter names. -/
def setLevelNames (levelNames : List Name) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.withLevelNames
code: /-- Execute `x` using `levelNames` as the universe level parameter names. See `getLevelNames`. -/
def withLevelNames (levelNames : List Name) (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withAuxDecl
code: /--
  Declare an auxiliary local declaration `shortDeclName : type` for elaborating recursive declaration `declName`,
  update the mapping `auxDeclToFullName`, and then execute `k`.
-/
def withAuxDecl (shortDeclName : Name) (type : Expr) (declName : Name) (k : Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withoutErrToSorryImp
code: def withoutErrToSorryImp (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withoutErrToSorry
code: /--
  Execute `x` without converting errors (i.e., exceptions) to `sorry` applications.
  Recall that when `errToSorry = true`, the method `elabTerm` catches exceptions and converts them into `sorry` applications.
-/
def withoutErrToSorry [MonadFunctorT TermElabM m] : m α → m α 
goal: m α → m α

full_name: Lean.Elab.Term.withoutHeedElabAsElimImp
code: def withoutHeedElabAsElimImp (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withoutHeedElabAsElim
code: /--
  Execute `x` without heeding the `elab_as_elim` attribute. Useful when there is
  no expected type (so `elabAppArgs` would fail), but expect that the user wants
  to use such constants.
-/
def withoutHeedElabAsElim [MonadFunctorT TermElabM m] : m α → m α 
goal: m α → m α

full_name: Lean.Elab.Term.withoutModifyingElabMetaStateWithInfo
code: /--
  Execute `x` but discard changes performed at `Term.State` and `Meta.State`.
  Recall that the `Environment` and `InfoState` are at `Core.State`. Thus, any updates to it will
  be preserved. This method is useful for performing computations where all
  metavariable must be resolved or discarded.
  The `InfoTree`s are not discarded, however, and wrapped in `InfoTree.Context`
  to store their metavariable context. -/
def withoutModifyingElabMetaStateWithInfo (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.withoutModifyingStateWithInfoAndMessagesImpl
code: /--
  Execute `x` but discard changes performed to the state.
  However, the info trees and messages are not discarded. -/
private def withoutModifyingStateWithInfoAndMessagesImpl (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.throwErrorIfErrors
code: /-- For testing `TermElabM` methods. The #eval command will sign the error. -/
def throwErrorIfErrors : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.traceAtCmdPos
code: def traceAtCmdPos (cls : Name) (msg : Unit → MessageData) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.ppGoal
code: def ppGoal (mvarId : MVarId) : TermElabM Format 
goal: Lean.Elab.TermElabM Lean.Format

full_name: Lean.Elab.Term.liftLevelM
code: def liftLevelM (x : LevelElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.elabLevel
code: def elabLevel (stx : Syntax) : TermElabM Level 
goal: Lean.Elab.TermElabM Lean.Level

full_name: Lean.Elab.Term.withPushMacroExpansionStack
code: /-- Elaborate `x` with `stx` on the macro stack -/
def withPushMacroExpansionStack (beforeStx afterStx : Syntax) (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withMacroExpansion
code: /-- Elaborate `x` with `stx` on the macro stack and produce macro expansion info -/
def withMacroExpansion (beforeStx afterStx : Syntax) (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.registerSyntheticMVar
code: /--
  Add the given metavariable to the list of pending synthetic metavariables.
  The method `synthesizeSyntheticMVars` is used to process the metavariables on this list. -/
def registerSyntheticMVar (stx : Syntax) (mvarId : MVarId) (kind : SyntheticMVarKind) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerSyntheticMVarWithCurrRef
code: def registerSyntheticMVarWithCurrRef (mvarId : MVarId) (kind : SyntheticMVarKind) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerMVarErrorInfo
code: def registerMVarErrorInfo (mvarErrorInfo : MVarErrorInfo) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerMVarErrorHoleInfo
code: def registerMVarErrorHoleInfo (mvarId : MVarId) (ref : Syntax) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerMVarErrorImplicitArgInfo
code: def registerMVarErrorImplicitArgInfo (mvarId : MVarId) (ref : Syntax) (app : Expr) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerMVarErrorCustomInfo
code: def registerMVarErrorCustomInfo (mvarId : MVarId) (ref : Syntax) (msgData : MessageData) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerCustomErrorIfMVar
code: def registerCustomErrorIfMVar (e : Expr) (ref : Syntax) (msgData : MessageData) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.registerMVarArgName
code: def registerMVarArgName (mvarId : MVarId) (argName : Name) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.throwMVarError
code: /--
  Auxiliary method for reporting errors of the form "... contains metavariables ...".
  This kind of error is thrown, for example, at `Match.lean` where elaboration
  cannot continue if there are metavariables in patterns.
  We only want to log it if we haven't logged any errors so far. -/
def throwMVarError (m : MessageData) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.MVarErrorInfo.logError
code: def MVarErrorInfo.logError (mvarErrorInfo : MVarErrorInfo) (extraMsg? : Option MessageData) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.MVarErrorInfo.logError.addArgName
code: def MVarErrorInfo.logError (mvarErrorInfo : MVarErrorInfo) (extraMsg? : Option MessageData) : TermElabM Unit 
goal: Lean.Elab.TermElabM Lean.MessageData

full_name: Lean.Elab.Term.MVarErrorInfo.logError.appendExtra
code: def MVarErrorInfo.logError (mvarErrorInfo : MVarErrorInfo) (extraMsg? : Option MessageData) : TermElabM Unit 
goal: Lean.MessageData

full_name: Lean.Elab.Term.logUnassignedUsingErrorInfos
code: /--
  Try to log errors for the unassigned metavariables `pendingMVarIds`.

  Return `true` if there were "unfilled holes", and we should "abort" declaration.
  TODO: try to fill "all" holes using synthetic "sorry's"

  Remark: We only log the "unfilled holes" as new errors if no error has been logged so far. -/
def logUnassignedUsingErrorInfos (pendingMVarIds : Array MVarId) (extraMsg? : Option MessageData := none) : TermElabM Bool 
goal: Lean.Elab.TermElabM Bool

full_name: Lean.Elab.Term.ensureNoUnassignedMVars
code: /-- Ensure metavariables registered using `registerMVarErrorInfos` (and used in the given declaration) have been assigned. -/
def ensureNoUnassignedMVars (decl : Declaration) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.withoutPostponing
code: /--
  Execute `x` without allowing it to postpone elaboration tasks.
  That is, `tryPostpone` is a noop. -/
def withoutPostponing (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.mkExplicitBinder
code: /-- Creates syntax for `(` <ident> `:` <type> `)` -/
def mkExplicitBinder (ident : Syntax) (type : Syntax) : Syntax 
goal: Lean.Syntax

full_name: Lean.Elab.Term.levelMVarToParam
code: /--
  Convert unassigned universe level metavariables into parameters.
  The new parameter names are fresh names of the form `u_i` with regard to `ctx.levelNames`, which is updated with the new names. -/
def levelMVarToParam (e : Expr) (except : LMVarId → Bool := fun _ => false) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.mkFreshBinderName
code: /--
  Auxiliary method for creating fresh binder names.
  Do not confuse with the method for creating fresh free/meta variable ids. -/
def mkFreshBinderName [Monad m] [MonadQuotation m] : m Name 
goal: m Lean.Name

full_name: Lean.Elab.Term.mkFreshIdent
code: /--
  Auxiliary method for creating a `Syntax.ident` containing
  a fresh name. This method is intended for creating fresh binder names.
  It is just a thin layer on top of `mkFreshUserName`. -/
def mkFreshIdent [Monad m] [MonadQuotation m] (ref : Syntax) (canonical := false) : m Ident 
goal: m Lean.Ident

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.applyAttributesCore
code: private def applyAttributesCore
    (declName : Name) (attrs : Array Attribute)
    (applicationTime? : Option AttributeApplicationTime) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.applyAttributesAt
code: /-- Apply given attributes **at** a given application time -/
def applyAttributesAt (declName : Name) (attrs : Array Attribute) (applicationTime : AttributeApplicationTime) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.applyAttributes
code: def applyAttributes (declName : Name) (attrs : Array Attribute) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.mkTypeMismatchError
code: def mkTypeMismatchError (header? : Option String) (e : Expr) (eType : Expr) (expectedType : Expr) : TermElabM MessageData 
goal: Lean.Elab.TermElabM Lean.MessageData

full_name: Lean.Elab.Term.throwTypeMismatchError
code: def throwTypeMismatchError (header? : Option String) (expectedType : Expr) (eType : Expr) (e : Expr)
    (f? : Option Expr := none) (_extraMsg? : Option MessageData := none) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withoutMacroStackAtErr
code: def withoutMacroStackAtErr (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.ContainsPendingMVar.M
code: abbrev M 
goal: Type

full_name: Lean.Elab.Term.ContainsPendingMVar.visit
code: /-- See `containsPostponedTerm` -/
partial def visit (e : Expr) : M Unit 
goal: Lean.Elab.Term.ContainsPendingMVar.M Unit

full_name: Lean.Elab.Term.containsPendingMVar
code: /-- Return `true` if `e` contains a pending metavariable. Remark: it also visits let-declarations. -/
def containsPendingMVar (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Elab.Term.synthesizeInstMVarCore
code: /--
  Try to synthesize metavariable using type class resolution.
  This method assumes the local context and local instances of `instMVar` coincide
  with the current local context and local instances.
  Return `true` if the instance was synthesized successfully, and `false` if
  the instance contains unassigned metavariables that are blocking the type class
  resolution procedure. Throw an exception if resolution or assignment irrevocably fails.

  If `extraErrorMsg?` is not none, it contains additional information that should be attached
  to type class synthesis failures.
-/
def synthesizeInstMVarCore (instMVar : MVarId) (maxResultSize? : Option Nat := none) (extraErrorMsg? : Option MessageData := none): TermElabM Bool 
goal: Lean.Elab.TermElabM Bool

full_name: Lean.Elab.Term.mkCoe
code: def mkCoe (expectedType : Expr) (e : Expr) (f? : Option Expr := none) (errorMsgHeader? : Option String := none) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.ensureHasType
code: /--
If `expectedType?` is `some t`, then ensures `t` and `eType` are definitionally equal by inserting a coercion if necessary.

Argument `f?` is used only for generating error messages when inserting coercions fails.
-/
def ensureHasType (expectedType? : Option Expr) (e : Expr)
    (errorMsgHeader? : Option String := none) (f? : Option Expr := none) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.mkSyntheticSorryFor
code: /--
  Create a synthetic sorry for the given expected type. If `expectedType? = none`, then a fresh
  metavariable is created to represent the type.
-/
private def mkSyntheticSorryFor (expectedType? : Option Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.exceptionToSorry
code: /--
  Log the given exception, and create a synthetic sorry for representing the failed
  elaboration step with exception `ex`.
-/
def exceptionToSorry (ex : Exception) (expectedType? : Option Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.tryPostpone
code: /-- If `mayPostpone == true`, throw `Expection.postpone`. -/
def tryPostpone : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.isMVarApp
code: /-- Return `true` if `e` reduces (by unfolding only `[reducible]` declarations) to `?m ...` -/
def isMVarApp (e : Expr) : TermElabM Bool 
goal: Lean.Elab.TermElabM Bool

full_name: Lean.Elab.Term.tryPostponeIfMVar
code: /-- If `mayPostpone == true` and `e`'s head is a metavariable, throw `Exception.postpone`. -/
def tryPostponeIfMVar (e : Expr) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.tryPostponeIfNoneOrMVar
code: /-- If `e? = some e`, then `tryPostponeIfMVar e`, otherwise it is just `tryPostpone`. -/
def tryPostponeIfNoneOrMVar (e? : Option Expr) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.tryPostponeIfHasMVars?
code: /--
  Throws `Exception.postpone`, if `expectedType?` contains unassigned metavariables.
  It is a noop if `mayPostpone == false`.
-/
def tryPostponeIfHasMVars? (expectedType? : Option Expr) : TermElabM (Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr)

full_name: Lean.Elab.Term.tryPostponeIfHasMVars
code: /--
  Throws `Exception.postpone`, if `expectedType?` contains unassigned metavariables.
  If `mayPostpone == false`, it throws error `msg`.
-/
def tryPostponeIfHasMVars (expectedType? : Option Expr) (msg : String) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.withExpectedType
code: def withExpectedType (expectedType? : Option Expr) (x : Expr → TermElabM Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.saveContext
code: /--
  Save relevant context for term elaboration postponement.
-/
def saveContext : TermElabM SavedContext 
goal: Lean.Elab.TermElabM Lean.Elab.Term.SavedContext

full_name: Lean.Elab.Term.withSavedContext
code: /--
  Execute `x` with the context saved using `saveContext`.
-/
def withSavedContext (savedCtx : SavedContext) (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.postponeElabTermCore
code: /--
Delay the elaboration of `stx`, and return a fresh metavariable that works a placeholder.
Remark: the caller is responsible for making sure the info tree is properly updated.
This method is used only at `elabUsingElabFnsAux`.
-/
private def postponeElabTermCore (stx : Syntax) (expectedType? : Option Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.getSyntheticMVarDecl?
code: def getSyntheticMVarDecl? (mvarId : MVarId) : TermElabM (Option SyntheticMVarDecl) 
goal: Lean.Elab.TermElabM (Option Lean.Elab.Term.SyntheticMVarDecl)

full_name: Lean.Elab.Term.mkSaveInfoAnnotation
code: /--
  Create an auxiliary annotation to make sure we create an `Info` even if `e` is a metavariable.
  See `mkTermInfo`.

  We use this function because some elaboration functions elaborate subterms that may not be immediately
  part of the resulting term. Example:
  ```
  let_mvar% ?m := b; wait_if_type_mvar% ?m; body
  ```
  If the type of `b` is not known, then `wait_if_type_mvar% ?m; body` is postponed and just returns a fresh
  metavariable `?n`. The elaborator for
  ```
  let_mvar% ?m := b; wait_if_type_mvar% ?m; body
  ```
  returns `mkSaveInfoAnnotation ?n` to make sure the info nodes created when elaborating `b` are "saved".
  This is a bit hackish, but elaborators like `let_mvar%` are rare.
-/
def mkSaveInfoAnnotation (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Elab.Term.isSaveInfoAnnotation?
code: def isSaveInfoAnnotation? (e : Expr) : Option Expr 
goal: Option Lean.Expr

full_name: Lean.Elab.Term.removeSaveInfoAnnotation
code: partial def removeSaveInfoAnnotation (e : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Elab.Term.isTacticOrPostponedHole?
code: /--
  Return `some mvarId` if `e` corresponds to a hole that is going to be filled "later" by executing a tactic or resuming elaboration.

  We do not save `ofTermInfo` for this kind of node in the `InfoTree`.
-/
def isTacticOrPostponedHole? (e : Expr) : TermElabM (Option MVarId) 
goal: Lean.Elab.TermElabM (Option Lean.MVarId)

full_name: Lean.Elab.Term.mkTermInfo
code: def mkTermInfo (elaborator : Name) (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) (isBinder := false) : TermElabM (Sum Info MVarId) 
goal: Lean.Elab.TermElabM (Lean.Elab.Info ⊕ Lean.MVarId)

full_name: Lean.Elab.Term.addTermInfo
code: /--
Pushes a new leaf node to the info tree associating the expression `e` to the syntax `stx`.
As a result, when the user hovers over `stx` they will see the type of `e`, and if `e`
is a constant they will see the constant's doc string.

* `expectedType?`: the expected type of `e` at the point of elaboration, if available
* `lctx?`: the local context in which to interpret `e` (otherwise it will use `← getLCtx`)
* `elaborator`: a declaration name used as an alternative target for go-to-definition
* `isBinder`: if true, this will be treated as defining `e` (which should be a local constant)
  for the purpose of go-to-definition on local variables
* `force`: In patterns, the effect of `addTermInfo` is usually suppressed and replaced
  by a `patternWithRef?` annotation which will be turned into a term info on the
  post-match-elaboration expression. This flag overrides that behavior and adds the term
  info immediately. (See https://github.com/leanprover/lean4/pull/1664.)
-/
def addTermInfo (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none)
    (lctx? : Option LocalContext := none) (elaborator := Name.anonymous)
    (isBinder := false) (force := false) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.addTermInfo'
code: def addTermInfo' (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) (elaborator := Name.anonymous) (isBinder := false) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.withInfoContext'
code: def withInfoContext' (stx : Syntax) (x : TermElabM Expr) (mkInfo : Expr → TermElabM (Sum Info MVarId)) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.postponeElabTerm
code: /--
Postpone the elaboration of `stx`, return a metavariable that acts as a placeholder, and
ensures the info tree is updated and a hole id is introduced.
When `stx` is elaborated, new info nodes are created and attached to the new hole id in the info tree.
-/
def postponeElabTerm (stx : Syntax) (expectedType? : Option Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.elabUsingElabFnsAux
code: /--
  Helper function for `elabTerm` that tries the registered elaboration functions for `stxNode` kind until it finds one that supports the syntax or
  an error is found. -/
private def elabUsingElabFnsAux (s : SavedState) (stx : Syntax) (expectedType? : Option Expr) (catchExPostpone : Bool)
    : List (KeyedDeclsAttribute.AttributeEntry TermElab) → TermElabM Expr
  
goal: List (Lean.KeyedDeclsAttribute.AttributeEntry Lean.Elab.Term.TermElab) → Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.elabUsingElabFns
code: private def elabUsingElabFns (stx : Syntax) (expectedType? : Option Expr) (catchExPostpone : Bool) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.instMonadMacroAdapterTermElabM
code: instance : MonadMacroAdapter TermElabM 
goal: Lean.Elab.MonadMacroAdapter Lean.Elab.TermElabM

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isExplicit
code: private def isExplicit (stx : Syntax) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isExplicitApp
code: private def isExplicitApp (stx : Syntax) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isLambdaWithImplicit
code: /--
  Return true if `stx` is a lambda abstraction containing a `{}` or `[]` binder annotation.
  Example: `fun {α} (a : α) => a` -/
private def isLambdaWithImplicit (stx : Syntax) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.dropTermParens
code: private partial def dropTermParens : Syntax → Syntax 
goal: Lean.Syntax → Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isHole
code: private def isHole (stx : Syntax) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isTacticBlock
code: private def isTacticBlock (stx : Syntax) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isNoImplicitLambda
code: private def isNoImplicitLambda (stx : Syntax) : Bool 
goal: Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.isTypeAscription
code: private def isTypeAscription (stx : Syntax) : Bool 
goal: Bool

full_name: Lean.Elab.Term.hasNoImplicitLambdaAnnotation
code: def hasNoImplicitLambdaAnnotation (type : Expr) : Bool 
goal: Bool

full_name: Lean.Elab.Term.mkNoImplicitLambdaAnnotation
code: def mkNoImplicitLambdaAnnotation (type : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Elab.Term.blockImplicitLambda
code: /-- Block usage of implicit lambdas if `stx` is `@f` or `@f arg1 ...` or `fun` with an implicit binder annotation. -/
def blockImplicitLambda (stx : Syntax) : Bool 
goal: Bool

full_name: Lean.Elab.Term.resolveLocalName.go
code: def resolveLocalName (n : Name) : TermElabM (Option (Expr × List String)) 
goal: Option Lean.LocalDecl

full_name: Lean.Elab.Term.resolveLocalName
code: def resolveLocalName (n : Name) : TermElabM (Option (Expr × List String)) 
goal: Lean.Elab.TermElabM (Option (Lean.Expr × List String))

full_name: Lean.Elab.Term.resolveLocalName.loop
code: def resolveLocalName (n : Name) : TermElabM (Option (Expr × List String)) 
goal: Lean.Elab.TermElabM (Option (Lean.Expr × List String))

full_name: Lean.Elab.Term.isLocalIdent?
code: /-- Return true iff `stx` is a `Syntax.ident`, and it is a local variable. -/
def isLocalIdent? (stx : Syntax) : TermElabM (Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr)

full_name: Lean.Elab.Term.UseImplicitLambdaResult.no
code: inductive UseImplicitLambdaResult where
  | no
  | yes (expectedType : Expr)
  | postpone
goal: Lean.Elab.Term.UseImplicitLambdaResult

full_name: Lean.Elab.Term.UseImplicitLambdaResult
code: inductive UseImplicitLambdaResult where
  | no
  | yes (expectedType : Expr)
  | postpone
goal: Type

full_name: Lean.Elab.Term.UseImplicitLambdaResult.postpone
code: inductive UseImplicitLambdaResult where
  | no
  | yes (expectedType : Expr)
  | postpone
goal: Lean.Elab.Term.UseImplicitLambdaResult

full_name: Lean.Elab.Term.UseImplicitLambdaResult.yes
code: inductive UseImplicitLambdaResult where
  | no
  | yes (expectedType : Expr)
  | postpone
goal: Lean.Elab.Term.UseImplicitLambdaResult

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.useImplicitLambda
code: /--
  Return normalized expected type if it is of the form `{a : α} → β` or `[a : α] → β` and
  `blockImplicitLambda stx` is not true, else return `none`.

  Remark: implicit lambdas are not triggered by the strict implicit binder annotation `{{a : α}} → β`
-/
private def useImplicitLambda (stx : Syntax) (expectedType? : Option Expr) : TermElabM UseImplicitLambdaResult 
goal: Lean.Elab.TermElabM Lean.Elab.Term.UseImplicitLambdaResult

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.decorateErrorMessageWithLambdaImplicitVars
code: private def decorateErrorMessageWithLambdaImplicitVars (ex : Exception) (impFVars : Array Expr) : TermElabM Exception 
goal: Lean.Elab.TermElabM Lean.Exception

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.elabImplicitLambdaAux
code: private def elabImplicitLambdaAux (stx : Syntax) (catchExPostpone : Bool) (expectedType : Expr) (impFVars : Array Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.elabImplicitLambda
code: private partial def elabImplicitLambda (stx : Syntax) (catchExPostpone : Bool) (type : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.elabImplicitLambda.loop
code: private partial def elabImplicitLambda (stx : Syntax) (catchExPostpone : Bool) (type : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.elabTermAux
code: /-- Main loop for `elabTerm` -/
private partial def elabTermAux (expectedType? : Option Expr) (catchExPostpone : Bool) (implicitLambda : Bool) : Syntax → TermElabM Expr
  
goal: Lean.Syntax → Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.addDotCompletionInfo
code: /-- Store in the `InfoTree` that `e` is a "dot"-completion target. `stx` should cover the entire term. -/
def addDotCompletionInfo (stx : Syntax) (e : Expr) (expectedType? : Option Expr) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.elabTerm
code: /--
  Main function for elaborating terms.
  It extracts the elaboration methods from the environment using the node kind.
  Recall that the environment has a mapping from `SyntaxNodeKind` to `TermElab` methods.
  It creates a fresh macro scope for executing the elaboration method.
  All unlogged trace messages produced by the elaboration method are logged using
  the position information at `stx`. If the elaboration method throws an `Exception.error` and `errToSorry == true`,
  the error is logged and a synthetic sorry expression is returned.
  If the elaboration throws `Exception.postpone` and `catchExPostpone == true`,
  a new synthetic metavariable of kind `SyntheticMVarKind.postponed` is created, registered,
  and returned.
  The option `catchExPostpone == false` is used to implement `resumeElabTerm`
  to prevent the creation of another synthetic metavariable when resuming the elaboration.

  If `implicitLambda == false`, then disable implicit lambdas feature for the given syntax, but not for its subterms.
  We use this flag to implement, for example, the `@` modifier. If `Context.implicitLambda == false`, then this parameter has no effect.
  -/
def elabTerm (stx : Syntax) (expectedType? : Option Expr) (catchExPostpone := true) (implicitLambda := true) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.elabTermEnsuringType
code: /--
Similar to `Lean.Elab.Term.elabTerm`, but ensures that the type of the elaborated term is `expectedType?`
by inserting coercions if necessary.

If `errToSorry` is true, then if coercion insertion fails, this function returns `sorry` and logs the error.
Otherwise, it throws the error.
-/
def elabTermEnsuringType (stx : Syntax) (expectedType? : Option Expr) (catchExPostpone := true) (implicitLambda := true) (errorMsgHeader? : Option String := none) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.commitIfNoErrors?
code: /-- Execute `x` and return `some` if no new errors were recorded or exceptions were thrown. Otherwise, return `none`. -/
def commitIfNoErrors? (x : TermElabM α) : TermElabM (Option α) 
goal: Lean.Elab.TermElabM (Option α)

full_name: Lean.Elab.Term.adaptExpander
code: /-- Adapt a syntax transformation to a regular, term-producing elaborator. -/
def adaptExpander (exp : Syntax → TermElabM Syntax) : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.mkInstMVar
code: /--
  Create a new metavariable with the given type, and try to synthesize it.
  If type class resolution cannot be executed (e.g., it is stuck because of metavariables in `type`),
  register metavariable as a pending one.
-/
def mkInstMVar (type : Expr) (extraErrorMsg? : Option MessageData := none) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.ensureType
code: /--
  Make sure `e` is a type by inferring its type and making sure it is an `Expr.sort`
  or is unifiable with `Expr.sort`, or can be coerced into one. -/
def ensureType (e : Expr) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.elabType
code: /-- Elaborate `stx` and ensure result is a type. -/
def elabType (stx : Syntax) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.withAutoBoundImplicit.loop
code: /--
  Enable auto-bound implicits, and execute `k` while catching auto bound implicit exceptions. When an exception is caught,
  a new local declaration is created, registered, and `k` is tried to be executed again. -/
partial def withAutoBoundImplicit (k : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withAutoBoundImplicit
code: /--
  Enable auto-bound implicits, and execute `k` while catching auto bound implicit exceptions. When an exception is caught,
  a new local declaration is created, registered, and `k` is tried to be executed again. -/
partial def withAutoBoundImplicit (k : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withoutAutoBoundImplicit
code: def withoutAutoBoundImplicit (k : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.withAutoBoundImplicitForbiddenPred
code: partial def withAutoBoundImplicitForbiddenPred (p : Name → Bool) (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.collectUnassignedMVars.go
code: /--
  Collect unassigned metavariables in `type` that are not already in `init` and not satisfying `except`.
-/
partial def collectUnassignedMVars (type : Expr) (init : Array Expr := #[]) (except : MVarId → Bool := fun _ => false)
    : TermElabM (Array Expr) 
goal: Lean.Elab.TermElabM (Array Lean.Expr)

full_name: Lean.Elab.Term.collectUnassignedMVars
code: /--
  Collect unassigned metavariables in `type` that are not already in `init` and not satisfying `except`.
-/
partial def collectUnassignedMVars (type : Expr) (init : Array Expr := #[]) (except : MVarId → Bool := fun _ => false)
    : TermElabM (Array Expr) 
goal: Lean.Elab.TermElabM (Array Lean.Expr)

full_name: Lean.Elab.Term.addAutoBoundImplicits
code: /--
  Return `autoBoundImplicits ++ xs`
  This method throws an error if a variable in `autoBoundImplicits` depends on some `x` in `xs`.
  The `autoBoundImplicits` may contain free variables created by the auto-implicit feature, and unassigned free variables.
  It avoids the hack used at `autoBoundImplicitsOld`.

  Remark: we cannot simply replace every occurrence of `addAutoBoundImplicitsOld` with this one because a particular
  use-case may not be able to handle the metavariables in the array being given to `k`.
-/
def addAutoBoundImplicits (xs : Array Expr) : TermElabM (Array Expr) 
goal: Lean.Elab.TermElabM (Array Lean.Expr)

full_name: Lean.Elab.Term.addAutoBoundImplicits.go
code: /--
  Return `autoBoundImplicits ++ xs`
  This method throws an error if a variable in `autoBoundImplicits` depends on some `x` in `xs`.
  The `autoBoundImplicits` may contain free variables created by the auto-implicit feature, and unassigned free variables.
  It avoids the hack used at `autoBoundImplicitsOld`.

  Remark: we cannot simply replace every occurrence of `addAutoBoundImplicitsOld` with this one because a particular
  use-case may not be able to handle the metavariables in the array being given to `k`.
-/
def addAutoBoundImplicits (xs : Array Expr) : TermElabM (Array Expr) 
goal: Lean.Elab.TermElabM (Array Lean.Expr)

full_name: Lean.Elab.Term.addAutoBoundImplicits'
code: /--
  Similar to `autoBoundImplicits`, but immediately if the resulting array of expressions contains metavariables,
  it immediately uses `mkForallFVars` + `forallBoundedTelescope` to convert them into free variables.
  The type `type` is modified during the process if type depends on `xs`.
  We use this method to simplify the conversion of code using `autoBoundImplicitsOld` to `autoBoundImplicits`.
-/
def addAutoBoundImplicits' (xs : Array Expr) (type : Expr) (k : Array Expr → Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.mkAuxName
code: def mkAuxName (suffix : Name) : TermElabM Name 
goal: Lean.Elab.TermElabM Lean.Name

full_name: Lean.Elab.Term.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.15706
code: builtin_initialize registerTraceClass `Elab.letrec
goal: IO Unit

full_name: Lean.Elab.Term.isLetRecAuxMVar
code: /-- Return true if mvarId is an auxiliary metavariable created for compiling `let rec` or it
   is delayed assigned to one. -/
def isLetRecAuxMVar (mvarId : MVarId) : TermElabM Bool 
goal: Lean.Elab.TermElabM Bool

full_name: Lean.Elab.Term.mkConst
code: /--
  Create an `Expr.const` using the given name and explicit levels.
  Remark: fresh universe metavariables are created if the constant has more universe
  parameters than `explicitLevels`. -/
def mkConst (constName : Name) (explicitLevels : List Level := []) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Term.0.Lean.Elab.Term.mkConsts
code: private def mkConsts (candidates : List (Name × List String)) (explicitLevels : List Level) : TermElabM (List (Expr × List String)) 
goal: Lean.Elab.TermElabM (List (Lean.Expr × List String))

full_name: Lean.Elab.Term.resolveName
code: def resolveName (stx : Syntax) (n : Name) (preresolved : List Syntax.Preresolved) (explicitLevels : List Level) (expectedType? : Option Expr := none) : TermElabM (List (Expr × List String)) 
goal: Lean.Elab.TermElabM (List (Lean.Expr × List String))

full_name: Lean.Elab.Term.resolveName.process
code: def resolveName (stx : Syntax) (n : Name) (preresolved : List Syntax.Preresolved) (explicitLevels : List Level) (expectedType? : Option Expr := none) : TermElabM (List (Expr × List String)) 
goal: Lean.Elab.TermElabM (List (Lean.Expr × List String))

full_name: Lean.Elab.Term.resolveName'
code: /--
  Similar to `resolveName`, but creates identifiers for the main part and each projection with position information derived from `ident`.
  Example: Assume resolveName `v.head.bla.boo` produces `(v.head, ["bla", "boo"])`, then this method produces
  `(v.head, id, [f₁, f₂])` where `id` is an identifier for `v.head`, and `f₁` and `f₂` are identifiers for fields `"bla"` and `"boo"`. -/
def resolveName' (ident : Syntax) (explicitLevels : List Level) (expectedType? : Option Expr := none) : TermElabM (List (Expr × Syntax × List Syntax)) 
goal: Lean.Elab.TermElabM (List (Lean.Expr × Lean.Syntax × List Lean.Syntax))

full_name: Lean.Elab.Term.resolveId?
code: def resolveId? (stx : Syntax) (kind := "term") (withInfo := false) : TermElabM (Option Expr) 
goal: Lean.Elab.TermElabM (Option Lean.Expr)

full_name: Lean.Elab.Term.TermElabM.run
code: def TermElabM.run (x : TermElabM α) (ctx : Context := {}) (s : State := {}) : MetaM (α × State) 
goal: Lean.MetaM (α × Lean.Elab.Term.State)

full_name: Lean.Elab.Term.TermElabM.run'
code: @[inline] def TermElabM.run' (x : TermElabM α) (ctx : Context := {}) (s : State := {}) : MetaM α 
goal: Lean.MetaM α

full_name: Lean.Elab.Term.TermElabM.toIO
code: def TermElabM.toIO (x : TermElabM α)
    (ctxCore : Core.Context) (sCore : Core.State)
    (ctxMeta : Meta.Context) (sMeta : Meta.State)
    (ctx : Context) (s : State) : IO (α × Core.State × Meta.State × State) 
goal: IO (α × Lean.Core.State × Lean.Meta.State × Lean.Elab.Term.State)

full_name: Lean.Elab.Term.instMetaEvalTermElabM
code: instance [MetaEval α] : MetaEval (TermElabM α) 
goal: Lean.MetaEval (Lean.Elab.TermElabM α)

full_name: Lean.Elab.Term.universeConstraintsCheckpoint
code: /--
  Execute `x` and then tries to solve pending universe constraints.
  Note that, stuck constraints will not be discarded.
-/
def universeConstraintsCheckpoint (x : TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.expandDeclId
code: def expandDeclId (currNamespace : Name) (currLevelNames : List Name) (declId : Syntax) (modifiers : Modifiers) : TermElabM ExpandDeclIdResult 
goal: Lean.Elab.TermElabM Lean.Elab.ExpandDeclIdResult

full_name: Lean.Elab.Term.exprToSyntax
code: /--
  Helper function for "embedding" an `Expr` in `Syntax`.
  It creates a named hole `?m` and immediately assigns `e` to it.
  Examples:
  ```lean
  let e := mkConst ``Nat.zero
  `(Nat.succ $(← exprToSyntax e))
  ```
-/
def exprToSyntax (e : Expr) : TermElabM Term 
goal: Lean.Elab.TermElabM Lean.Term

full_name: Lean.Elab.withoutModifyingStateWithInfoAndMessages
code: def withoutModifyingStateWithInfoAndMessages [MonadControlT TermElabM m] [Monad m] (x : m α) : m α 
goal: m α

full_name: Lean.Elab.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.18003
code: builtin_initialize
  registerTraceClass `Elab.postpone
  registerTraceClass `Elab.coe
  registerTraceClass `Elab.debug
  registerTraceClass `Elab.reuse
goal: IO Unit

full_name: Lean.Elab.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.18202
code: builtin_initialize incrementalAttr : TagAttribute ←
  registerTagAttribute `incremental "Marks an elaborator (tactic or command, currently) as \
supporting incremental elaboration. For unmarked elaborators, the corresponding snapshot bundle \
field in the elaboration context is unset so as to prevent accidental, incorrect reuse."
goal: IO Lean.TagAttribute

full_name: Lean.Elab.incrementalAttr
code: builtin_initialize incrementalAttr : TagAttribute ←
  registerTagAttribute `incremental "Marks an elaborator (tactic or command, currently) as \
supporting incremental elaboration. For unmarked elaborators, the corresponding snapshot bundle \
field in the elaboration context is unset so as to prevent accidental, incorrect reuse."
goal: Lean.TagAttribute

full_name: Lean.Elab.builtinIncrementalElabs
code: builtin_initialize builtinIncrementalElabs : IO.Ref NameSet ← IO.mkRef {}
goal: IO.Ref Lean.NameSet

full_name: Lean.Elab.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.18230
code: builtin_initialize builtinIncrementalElabs : IO.Ref NameSet ← IO.mkRef {}
goal: IO (IO.Ref Lean.NameSet)

full_name: Lean.Elab.addBuiltinIncrementalElab
code: def addBuiltinIncrementalElab (decl : Name) : IO Unit 
goal: IO Unit

full_name: Lean.Elab.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.18284
code: builtin_initialize
  registerBuiltinAttribute {
    name            := `builtin_incremental
    descr           := s!"(builtin) {incrementalAttr.attr.descr}"
    applicationTime := .afterCompilation
    add             := fun decl stx kind => do
      Attribute.Builtin.ensureNoArgs stx
      unless kind == AttributeKind.global do
        throwError "invalid attribute 'builtin_incremental', must be global"
      declareBuiltin decl <| mkApp (mkConst ``addBuiltinIncrementalElab) (toExpr decl)
  }
goal: IO Unit

full_name: Lean.Elab.isIncrementalElab
code: /-- Checks whether a declaration is annotated with `[builtin_incremental]` or `[incremental]`. -/
def isIncrementalElab [Monad m] [MonadEnv m] [MonadLiftT IO m] (decl : Name) : m Bool 
goal: m Bool

full_name: Lean.Elab.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Term._hyg.18549
code: builtin_initialize
  registerTraceClass `Elab.implicitForall
goal: IO Unit