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

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.expandBinderType
code: /--
  Given syntax of the forms
    a) (`:` term)?
    b) `:` term
  return `term` if it is present, or a hole if not. -/
private def expandBinderType (ref : Syntax) (stx : Syntax) : Syntax 
goal: Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.expandBinderIdent
code: /-- Given syntax of the form `ident <|> hole`, return `ident`. If `hole`, then we create a new anonymous name. -/
private def expandBinderIdent (stx : Syntax) : TermElabM Syntax 
goal: Lean.Elab.TermElabM Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.expandOptIdent
code: /-- Given syntax of the form `(ident >> " : ")?`, return `ident`, or a new instance name. -/
private def expandOptIdent (stx : Syntax) : TermElabM Syntax 
goal: Lean.Elab.TermElabM Lean.Syntax

full_name: Lean.Elab.Term.BinderView.id
code: /-- Auxiliary datatype for elaborating binders. -/
structure BinderView where
  /--
  Position information provider for the Info Tree.
  We currently do not track binder "macro expansion" steps in the info tree.
  For example, suppose we expand a `_` into a fresh identifier. The fresh identifier
  has synthetic position since it was not written by the user, and we would not get
  hover information for the `_` because we also don't have this macro expansion step
  stored in the info tree. Thus, we store the original `Syntax` in `ref`, and use
  it when storing the binder information in the info tree.

  Potential better solution: add a binder syntax category, an extensible `elabBinder`
  (like we have `elabTerm`), and perform all macro expansion steps at `elabBinder` and
  record them in the infro tree.
  -/
  ref  : Syntax
  id   : Syntax
  type : Syntax
  bi   : BinderInfo
goal: Lean.Syntax

full_name: Lean.Elab.Term.BinderView.type
code: /-- Auxiliary datatype for elaborating binders. -/
structure BinderView where
  /--
  Position information provider for the Info Tree.
  We currently do not track binder "macro expansion" steps in the info tree.
  For example, suppose we expand a `_` into a fresh identifier. The fresh identifier
  has synthetic position since it was not written by the user, and we would not get
  hover information for the `_` because we also don't have this macro expansion step
  stored in the info tree. Thus, we store the original `Syntax` in `ref`, and use
  it when storing the binder information in the info tree.

  Potential better solution: add a binder syntax category, an extensible `elabBinder`
  (like we have `elabTerm`), and perform all macro expansion steps at `elabBinder` and
  record them in the infro tree.
  -/
  ref  : Syntax
  id   : Syntax
  type : Syntax
  bi   : BinderInfo
goal: Lean.Syntax

full_name: Lean.Elab.Term.BinderView.bi
code: /-- Auxiliary datatype for elaborating binders. -/
structure BinderView where
  /--
  Position information provider for the Info Tree.
  We currently do not track binder "macro expansion" steps in the info tree.
  For example, suppose we expand a `_` into a fresh identifier. The fresh identifier
  has synthetic position since it was not written by the user, and we would not get
  hover information for the `_` because we also don't have this macro expansion step
  stored in the info tree. Thus, we store the original `Syntax` in `ref`, and use
  it when storing the binder information in the info tree.

  Potential better solution: add a binder syntax category, an extensible `elabBinder`
  (like we have `elabTerm`), and perform all macro expansion steps at `elabBinder` and
  record them in the infro tree.
  -/
  ref  : Syntax
  id   : Syntax
  type : Syntax
  bi   : BinderInfo
goal: Lean.BinderInfo

full_name: Lean.Elab.Term.BinderView.ref
code: /-- Auxiliary datatype for elaborating binders. -/
structure BinderView where
  /--
  Position information provider for the Info Tree.
  We currently do not track binder "macro expansion" steps in the info tree.
  For example, suppose we expand a `_` into a fresh identifier. The fresh identifier
  has synthetic position since it was not written by the user, and we would not get
  hover information for the `_` because we also don't have this macro expansion step
  stored in the info tree. Thus, we store the original `Syntax` in `ref`, and use
  it when storing the binder information in the info tree.

  Potential better solution: add a binder syntax category, an extensible `elabBinder`
  (like we have `elabTerm`), and perform all macro expansion steps at `elabBinder` and
  record them in the infro tree.
  -/
  ref  : Syntax
  id   : Syntax
  type : Syntax
  bi   : BinderInfo
goal: Lean.Syntax

full_name: Lean.Elab.Term.BinderView
code: /-- Auxiliary datatype for elaborating binders. -/
structure BinderView where
  /--
  Position information provider for the Info Tree.
  We currently do not track binder "macro expansion" steps in the info tree.
  For example, suppose we expand a `_` into a fresh identifier. The fresh identifier
  has synthetic position since it was not written by the user, and we would not get
  hover information for the `_` because we also don't have this macro expansion step
  stored in the info tree. Thus, we store the original `Syntax` in `ref`, and use
  it when storing the binder information in the info tree.

  Potential better solution: add a binder syntax category, an extensible `elabBinder`
  (like we have `elabTerm`), and perform all macro expansion steps at `elabBinder` and
  record them in the infro tree.
  -/
  ref  : Syntax
  id   : Syntax
  type : Syntax
  bi   : BinderInfo
goal: Type

full_name: Lean.Elab.Term.kindOfBinderName
code: /--
Determines the local declaration kind depending on the variable name.

The `__x` in `let __x := 42; body` gets kind `.implDetail`.
-/
def kindOfBinderName (binderName : Name) : LocalDeclKind 
goal: Lean.LocalDeclKind

full_name: Lean.Elab.Term.quoteAutoTactic
code: partial def quoteAutoTactic : Syntax → CoreM Expr
  
goal: Lean.Syntax → Lean.CoreM Lean.Expr

full_name: Lean.Elab.Term.declareTacticSyntax
code: def declareTacticSyntax (tactic : Syntax) : TermElabM Name 
goal: Lean.Elab.TermElabM Lean.Name

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.expandBinderModifier
code: /--
Expand `optional (binderTactic <|> binderDefault)`
```
def binderTactic  := leading_parser " := " >> " by " >> tacticParser
def binderDefault := leading_parser " := " >> termParser
```
-/
private def expandBinderModifier (type : Syntax) (optBinderModifier : Syntax) : TermElabM Syntax 
goal: Lean.Elab.TermElabM Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.getBinderIds
code: private def getBinderIds (ids : Syntax) : TermElabM (Array Syntax) 
goal: Lean.Elab.TermElabM (Array Lean.Syntax)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.toBinderViews
code: /--
Convert `stx` into an array of `BinderView`s.
`stx` must be an identifier, `_`, `explicitBinder`, `implicitBinder`, `strictImplicitBinder`, or `instBinder`.
-/
private def toBinderViews (stx : Syntax) : TermElabM (Array BinderView) 
goal: Lean.Elab.TermElabM (Array Lean.Elab.Term.BinderView)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.registerFailedToInferBinderTypeInfo
code: private def registerFailedToInferBinderTypeInfo (type : Expr) (ref : Syntax) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.addLocalVarInfo
code: def addLocalVarInfo (stx : Syntax) (fvar : Expr) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.ensureAtomicBinderName
code: private def ensureAtomicBinderName (binderView : BinderView) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: Lean.Elab.Term.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Binders._hyg.1800
code: register_builtin_option checkBinderAnnotations : Bool := {
  defValue := true
  descr    := "check whether type is a class instance whenever the binder annotation `[...]` is used"
}
goal: IO (Lean.Option Bool)

full_name: Lean.Elab.Term.checkBinderAnnotations
code: register_builtin_option checkBinderAnnotations : Bool := {
  defValue := true
  descr    := "check whether type is a class instance whenever the binder annotation `[...]` is used"
}
goal: Lean.Option Bool

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.checkLocalInstanceParameters
code: /-- Throw an error if `type` is not a valid local instance. -/
private partial def checkLocalInstanceParameters (type : Expr) : TermElabM Unit 
goal: Lean.Elab.TermElabM Unit

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.elabBinderViews
code: private partial def elabBinderViews (binderViews : Array BinderView) (fvars : Array (Syntax × Expr)) (k : Array (Syntax × Expr) → TermElabM α)
    : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.elabBinderViews.loop
code: private partial def elabBinderViews (binderViews : Array BinderView) (fvars : Array (Syntax × Expr)) (k : Array (Syntax × Expr) → TermElabM α)
    : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.elabBindersAux
code: private partial def elabBindersAux (binders : Array Syntax) (k : Array (Syntax × Expr) → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.elabBindersAux.loop
code: private partial def elabBindersAux (binders : Array Syntax) (k : Array (Syntax × Expr) → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.elabBindersEx
code: /--
  Like `elabBinders`, but also pass syntax node per binder.
  `elabBinders(Ex)` automatically adds binder info nodes for the produced fvars, but storing the syntax nodes
  might be necessary when later adding the same binders back to the local context so that info nodes can
  manually be added for the new fvars; see `MutualDef` for an example. -/
def elabBindersEx (binders : Array Syntax) (k : Array (Syntax × Expr) → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.elabBinders
code: /--
  Elaborate the given binders (i.e., `Syntax` objects for `bracketedBinder`),
  update the local context, set of local instances, reset instance cache (if needed), and then
  execute `k` with the updated context.
  The local context will only be included inside `k`.

  For example, suppose you have binders `[(a : α), (b : β a)]`, then the elaborator will
  create two new free variables `a` and `b`, push these to the context and pass to `k #[a,b]`.
  -/
def elabBinders (binders : Array Syntax) (k : Array Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.elabBinder
code: /-- Same as `elabBinder` with a single binder.-/
def elabBinder (binder : Syntax) (x : Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.expandSimpleBinderWithType
code: /-- If `binder` is a `_` or an identifier, return a `bracketedBinder` using `type` otherwise throw an exception. -/
def expandSimpleBinderWithType (type : Term) (binder : Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandForall
code: @[builtin_macro Lean.Parser.Term.forall] def expandForall : Macro
  
goal: Lean.Macro

full_name: Lean.Elab.Term.elabForall
code: @[builtin_term_elab «forall»] def elabForall : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.precheckArrow
code: @[builtin_quot_precheck Lean.Parser.Term.arrow] def precheckArrow : Precheck
  
goal: Lean.Elab.Term.Quotation.Precheck

full_name: Lean.Elab.Term.elabArrow
code: @[builtin_term_elab arrow] def elabArrow : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.elabDepArrow
code: /--
The dependent arrow. `(x : α) → β` is equivalent to `∀ x : α, β`, but we usually
reserve the latter for propositions. Also written as `Π x : α, β` (the "Pi-type")
in the literature. -/
@[builtin_term_elab depArrow] def elabDepArrow : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.getFunBinderIds?
code: /--
  Auxiliary functions for converting `id_1 ... id_n` application into `#[id_1, ..., id_m]`
  It is used at `expandFunBinders`. -/
private partial def getFunBinderIds? (stx : Syntax) : OptionT MacroM (Array Syntax) 
goal: OptionT Lean.MacroM (Array Lean.Syntax)

full_name: Lean.Elab.Term.expandFunBinders
code: /--
  Auxiliary function for expanding `fun` notation binders. Recall that `fun` parser is defined as
  ```
  def funBinder : Parser := implicitBinder <|> instBinder <|> termParser maxPrec
  leading_parser unicodeSymbol "λ" "fun" >> many1 funBinder >> "=>" >> termParser
  ```
  to allow notation such as `fun (a, b) => a + b`, where `(a, b)` should be treated as a pattern.
  The result is a pair `(explicitBinders, newBody)`, where `explicitBinders` is syntax of the form
  ```
  `(` ident `:` term `)`
  ```
  which can be elaborated using `elabBinders`, and `newBody` is the updated `body` syntax.
  We update the `body` syntax when expanding the pattern notation.
  Example: `fun (a, b) => a + b` expands into `fun _a_1 => match _a_1 with | (a, b) => a + b`.
  See local function `processAsPattern` at `expandFunBindersAux`.

  The resulting `Bool` is true if a pattern was found. We use it "mark" a macro expansion. -/
partial def expandFunBinders (binders : Array Syntax) (body : Syntax) : MacroM (Array Syntax × Syntax × Bool) 
goal: Lean.MacroM (Array Lean.Syntax × Lean.Syntax × Bool)

full_name: Lean.Elab.Term.expandFunBinders.loop
code: /--
  Auxiliary function for expanding `fun` notation binders. Recall that `fun` parser is defined as
  ```
  def funBinder : Parser := implicitBinder <|> instBinder <|> termParser maxPrec
  leading_parser unicodeSymbol "λ" "fun" >> many1 funBinder >> "=>" >> termParser
  ```
  to allow notation such as `fun (a, b) => a + b`, where `(a, b)` should be treated as a pattern.
  The result is a pair `(explicitBinders, newBody)`, where `explicitBinders` is syntax of the form
  ```
  `(` ident `:` term `)`
  ```
  which can be elaborated using `elabBinders`, and `newBody` is the updated `body` syntax.
  We update the `body` syntax when expanding the pattern notation.
  Example: `fun (a, b) => a + b` expands into `fun _a_1 => match _a_1 with | (a, b) => a + b`.
  See local function `processAsPattern` at `expandFunBindersAux`.

  The resulting `Bool` is true if a pattern was found. We use it "mark" a macro expansion. -/
partial def expandFunBinders (binders : Array Syntax) (body : Syntax) : MacroM (Array Syntax × Syntax × Bool) 
goal: Lean.MacroM (Array Lean.Syntax × Lean.Syntax × Bool)

full_name: Lean.Elab.Term.FunBinders.State.lctx
code: structure State where
  fvars         : Array Expr := #[]
  lctx          : LocalContext
  localInsts    : LocalInstances
  expectedType? : Option Expr := none
goal: Lean.LocalContext

full_name: Lean.Elab.Term.FunBinders.State.localInsts
code: structure State where
  fvars         : Array Expr := #[]
  lctx          : LocalContext
  localInsts    : LocalInstances
  expectedType? : Option Expr := none
goal: Lean.LocalInstances

full_name: Lean.Elab.Term.FunBinders.State.expectedType?
code: structure State where
  fvars         : Array Expr := #[]
  lctx          : LocalContext
  localInsts    : LocalInstances
  expectedType? : Option Expr := none
goal: Option Lean.Expr

full_name: Lean.Elab.Term.FunBinders.State.fvars
code: structure State where
  fvars         : Array Expr := #[]
  lctx          : LocalContext
  localInsts    : LocalInstances
  expectedType? : Option Expr := none
goal: Array Lean.Expr

full_name: Lean.Elab.Term.FunBinders.State
code: structure State where
  fvars         : Array Expr := #[]
  lctx          : LocalContext
  localInsts    : LocalInstances
  expectedType? : Option Expr := none
goal: Type

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.FunBinders.propagateExpectedType
code: private def propagateExpectedType (fvar : Expr) (fvarType : Expr) (s : State) : TermElabM State 
goal: Lean.Elab.TermElabM Lean.Elab.Term.FunBinders.State

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.FunBinders.elabFunBinderViews
code: private partial def elabFunBinderViews (binderViews : Array BinderView) (i : Nat) (s : State) : TermElabM State 
goal: Lean.Elab.TermElabM Lean.Elab.Term.FunBinders.State

full_name: Lean.Elab.Term.FunBinders.elabFunBindersAux
code: partial def elabFunBindersAux (binders : Array Syntax) (i : Nat) (s : State) : TermElabM State 
goal: Lean.Elab.TermElabM Lean.Elab.Term.FunBinders.State

full_name: Lean.Elab.Term.elabFunBinders
code: def elabFunBinders (binders : Array Syntax) (expectedType? : Option Expr) (x : Array Expr → Option Expr → TermElabM α) : TermElabM α 
goal: Lean.Elab.TermElabM α

full_name: Lean.Elab.Term.expandWhereDecls
code: def expandWhereDecls (whereDecls : Syntax) (body : Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandWhereDeclsOpt
code: def expandWhereDeclsOpt (whereDeclsOpt : Syntax) (body : Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Elab.Binders.0.Lean.Elab.Term.expandMatchAltsIntoMatchAux
code: /--
 Helper function for `expandMatchAltsIntoMatch`.
-/
private def expandMatchAltsIntoMatchAux (matchAlts : Syntax) (isTactic : Bool) (useExplicit : Bool) : Nat → Array Syntax → Array Ident → MacroM Syntax
  
goal: Nat → Array Lean.Syntax → Array Lean.Ident → Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandMatchAltsIntoMatch
code: /--
  Expand `matchAlts` syntax into a full `match`-expression.
  Example:
  ```
  | 0, true => alt_1
  | i, _    => alt_2
  ```
  expands into (for tactic == false)
  ```
  fun x_1 x_2 =>
  match @x_1, @x_2 with
  | 0, true => alt_1
  | i, _    => alt_2
  ```
  and (for tactic == true)
  ```
  intro x_1; intro x_2;
  match @x_1, @x_2 with
  | 0, true => alt_1
  | i, _    => alt_2
  ```

  If `useExplicit = true`, we add a `@` before `fun` to disable implicit lambdas. We disable them when processing `let` and `let rec` declarations
  to make sure the behavior is consistent with top-level declarations where we can write
  ```
  def f : {α : Type} → α → α
    | _, a => a
  ```
  We use `useExplicit = false` when we are elaborating the `fun | ... => ... | ...` notation. See issue #1132.
  If `@fun` is used with this notation, the we set `useExplicit = true`.
  We also use `useExplicit = false` when processing `instance ... where` notation declarations. The motivation is to have compact declarations such as
  ```
  instance [Alternative m] : MonadLiftT Option m where
  monadLift -- We don't want to provide the implicit arguments of `monadLift` here. One should use `monadLift := @fun ...` if they want to provide them.
    | some a => pure a
    | none => failure
  ```

  Remark: we add `@` at discriminants to make sure we don't consume implicit arguments, and to make the behavior consistent with `fun`.
  Example:
  ```
  inductive T : Type 1 :=
  | mkT : (forall {a : Type}, a -> a) -> T

  def makeT (f : forall {a : Type}, a -> a) : T :=
    mkT f

  def makeT' : (forall {a : Type}, a -> a) -> T
  | f => mkT f
  ```
  The two definitions should be elaborated without errors and be equivalent.
 -/
def expandMatchAltsIntoMatch (ref : Syntax) (matchAlts : Syntax) (useExplicit := true) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandMatchAltsIntoMatchTactic
code: def expandMatchAltsIntoMatchTactic (ref : Syntax) (matchAlts : Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandMatchAltsWhereDecls.loop
code: /--
  Similar to `expandMatchAltsIntoMatch`, but supports an optional `where` clause.

  Expand `matchAltsWhereDecls` into `let rec` + `match`-expression.
  Example
  ```
  | 0, true => ... f 0 ...
  | i, _    => ... f i + g i ...
  where
    f x := g x + 1

    g : Nat → Nat
      | 0   => 1
      | x+1 => f x
  ```
  expands into
  ```
  fux x_1 x_2 =>
    let rec
      f x := g x + 1,
      g : Nat → Nat
        | 0   => 1
        | x+1 => f x
    match x_1, x_2 with
    | 0, true => ... f 0 ...
    | i, _    => ... f i + g i ...
  ```
-/
def expandMatchAltsWhereDecls (matchAltsWhereDecls : Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandMatchAltsWhereDecls
code: /--
  Similar to `expandMatchAltsIntoMatch`, but supports an optional `where` clause.

  Expand `matchAltsWhereDecls` into `let rec` + `match`-expression.
  Example
  ```
  | 0, true => ... f 0 ...
  | i, _    => ... f i + g i ...
  where
    f x := g x + 1

    g : Nat → Nat
      | 0   => 1
      | x+1 => f x
  ```
  expands into
  ```
  fux x_1 x_2 =>
    let rec
      f x := g x + 1,
      g : Nat → Nat
        | 0   => 1
        | x+1 => f x
    match x_1, x_2 with
    | 0, true => ... f 0 ...
    | i, _    => ... f i + g i ...
  ```
-/
def expandMatchAltsWhereDecls (matchAltsWhereDecls : Syntax) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.expandFun
code: @[builtin_macro Parser.Term.fun] partial def expandFun : Macro
  
goal: Lean.Macro

full_name: Lean.Elab.Term.expandExplicitFun
code: @[builtin_macro Parser.Term.explicit] partial def expandExplicitFun : Macro 
goal: Lean.Macro

full_name: Lean.Elab.Term.precheckFun
code: @[builtin_quot_precheck Lean.Parser.Term.fun] def precheckFun : Precheck
  
goal: Lean.Elab.Term.Quotation.Precheck

full_name: Lean.Elab.Term.elabFun
code: @[builtin_term_elab «fun»] partial def elabFun : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.elabLetDeclAux
code: /-- If `useLetExpr` is true, then a kernel let-expression `let x : type := val; body` is created.
   Otherwise, we create a term of the form `(fun (x : type) => body) val`

   The default elaboration order is `binders`, `typeStx`, `valStx`, and `body`.
   If `elabBodyFirst == true`, then we use the order `binders`, `typeStx`, `body`, and `valStx`. -/
def elabLetDeclAux (id : Syntax) (binders : Array Syntax) (typeStx : Syntax) (valStx : Syntax) (body : Syntax)
    (expectedType? : Option Expr) (useLetExpr : Bool) (elabBodyFirst : Bool) (usedLetOnly : Bool) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.LetIdDeclView.binders
code: structure LetIdDeclView where
  id      : Syntax
  binders : Array Syntax
  type    : Syntax
  value   : Syntax
goal: Array Lean.Syntax

full_name: Lean.Elab.Term.LetIdDeclView
code: structure LetIdDeclView where
  id      : Syntax
  binders : Array Syntax
  type    : Syntax
  value   : Syntax
goal: Type

full_name: Lean.Elab.Term.LetIdDeclView.id
code: structure LetIdDeclView where
  id      : Syntax
  binders : Array Syntax
  type    : Syntax
  value   : Syntax
goal: Lean.Syntax

full_name: Lean.Elab.Term.LetIdDeclView.type
code: structure LetIdDeclView where
  id      : Syntax
  binders : Array Syntax
  type    : Syntax
  value   : Syntax
goal: Lean.Syntax

full_name: Lean.Elab.Term.LetIdDeclView.value
code: structure LetIdDeclView where
  id      : Syntax
  binders : Array Syntax
  type    : Syntax
  value   : Syntax
goal: Lean.Syntax

full_name: Lean.Elab.Term.mkLetIdDeclView
code: def mkLetIdDeclView (letIdDecl : Syntax) : LetIdDeclView 
goal: Lean.Elab.Term.LetIdDeclView

full_name: Lean.Elab.Term.expandLetEqnsDecl
code: def expandLetEqnsDecl (letDecl : Syntax) (useExplicit := true) : MacroM Syntax 
goal: Lean.MacroM Lean.Syntax

full_name: Lean.Elab.Term.elabLetDeclCore
code: def elabLetDeclCore (stx : Syntax) (expectedType? : Option Expr) (useLetExpr : Bool) (elabBodyFirst : Bool) (usedLetOnly : Bool) : TermElabM Expr 
goal: Lean.Elab.TermElabM Lean.Expr

full_name: Lean.Elab.Term.elabLetDecl
code: @[builtin_term_elab «let»] def elabLetDecl : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.elabLetFunDecl
code: @[builtin_term_elab «let_fun»] def elabLetFunDecl : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.elabLetDelayedDecl
code: @[builtin_term_elab «let_delayed»] def elabLetDelayedDecl : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.elabLetTmpDecl
code: @[builtin_term_elab «let_tmp»] def elabLetTmpDecl : TermElab 
goal: Lean.Elab.Term.TermElab

full_name: Lean.Elab.Term.initFn._@..lake.packages.lean4.src.lean.Lean.Elab.Binders._hyg.10216
code: builtin_initialize
  registerTraceClass `Elab.let
  registerTraceClass `Elab.let.decl
  registerTraceClass `Elab.autoParam
goal: IO Unit