File: .lake/packages/lean4/src/lean/Lean/Meta/Closure.lean

full_name: Lean.Meta.Closure.ToProcessElement
code: structure ToProcessElement where
  fvarId : FVarId
  newFVarId : FVarId
  deriving Inhabited
goal: Type

full_name: Lean.Meta.Closure.ToProcessElement.newFVarId
code: structure ToProcessElement where
  fvarId : FVarId
  newFVarId : FVarId
  deriving Inhabited
goal: Lean.FVarId

full_name: Lean.Meta.Closure.instInhabitedToProcessElement
code: structure ToProcessElement where
  fvarId : FVarId
  newFVarId : FVarId
  deriving Inhabited
goal: Inhabited Lean.Meta.Closure.ToProcessElement

full_name: Lean.Meta.Closure.ToProcessElement.fvarId
code: structure ToProcessElement where
  fvarId : FVarId
  newFVarId : FVarId
  deriving Inhabited
goal: Lean.FVarId

full_name: Lean.Meta.Closure.Context.zetaDelta
code: structure Context where
  zetaDelta : Bool
goal: Bool

full_name: Lean.Meta.Closure.Context
code: structure Context where
  zetaDelta : Bool
goal: Type

full_name: Lean.Meta.Closure.State.newLetDecls
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.LocalDecl

full_name: Lean.Meta.Closure.State.nextExprIdx
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Nat

full_name: Lean.Meta.Closure.State
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Type

full_name: Lean.Meta.Closure.State.exprFVarArgs
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.Expr

full_name: Lean.Meta.Closure.State.levelArgs
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.Level

full_name: Lean.Meta.Closure.State.exprMVarArgs
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.Expr

full_name: Lean.Meta.Closure.State.nextLevelIdx
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Nat

full_name: Lean.Meta.Closure.State.newLocalDeclsForMVars
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.LocalDecl

full_name: Lean.Meta.Closure.State.visitedExpr
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Lean.ExprStructMap Lean.Expr

full_name: Lean.Meta.Closure.State.newLocalDecls
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.LocalDecl

full_name: Lean.Meta.Closure.State.visitedLevel
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Lean.LevelMap Lean.Level

full_name: Lean.Meta.Closure.State.levelParams
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.Name

full_name: Lean.Meta.Closure.State.toProcess
code: structure State where
  visitedLevel          : LevelMap Level := {}
  visitedExpr           : ExprStructMap Expr := {}
  levelParams           : Array Name := #[]
  nextLevelIdx          : Nat := 1
  levelArgs             : Array Level := #[]
  newLocalDecls         : Array LocalDecl := #[]
  newLocalDeclsForMVars : Array LocalDecl := #[]
  newLetDecls           : Array LocalDecl := #[]
  nextExprIdx           : Nat := 1
  exprMVarArgs          : Array Expr := #[]
  exprFVarArgs          : Array Expr := #[]
  toProcess             : Array ToProcessElement := #[]
goal: Array Lean.Meta.Closure.ToProcessElement

full_name: Lean.Meta.Closure.ClosureM
code: abbrev ClosureM 
goal: Type

full_name: Lean.Meta.Closure.visitLevel
code: @[inline] def visitLevel (f : Level → ClosureM Level) (u : Level) : ClosureM Level 
goal: Lean.Meta.Closure.ClosureM Lean.Level

full_name: Lean.Meta.Closure.visitExpr
code: @[inline] def visitExpr (f : Expr → ClosureM Expr) (e : Expr) : ClosureM Expr 
goal: Lean.Meta.Closure.ClosureM Lean.Expr

full_name: Lean.Meta.Closure.mkNewLevelParam
code: def mkNewLevelParam (u : Level) : ClosureM Level 
goal: Lean.Meta.Closure.ClosureM Lean.Level

full_name: Lean.Meta.Closure.collectLevelAux
code: partial def collectLevelAux : Level → ClosureM Level
  
goal: Lean.Level → Lean.Meta.Closure.ClosureM Lean.Level

full_name: Lean.Meta.Closure.collectLevel
code: def collectLevel (u : Level) : ClosureM Level 
goal: Lean.Meta.Closure.ClosureM Lean.Level

full_name: Lean.Meta.Closure.preprocess
code: def preprocess (e : Expr) : ClosureM Expr 
goal: Lean.Meta.Closure.ClosureM Lean.Expr

full_name: Lean.Meta.Closure.mkNextUserName
code: /--
  Remark: This method does not guarantee unique user names.
  The correctness of the procedure does not rely on unique user names.
  Recall that the pretty printer takes care of unintended collisions. -/
def mkNextUserName : ClosureM Name 
goal: Lean.Meta.Closure.ClosureM Lean.Name

full_name: Lean.Meta.Closure.pushToProcess
code: def pushToProcess (elem : ToProcessElement) : ClosureM Unit 
goal: Lean.Meta.Closure.ClosureM Unit

full_name: Lean.Meta.Closure.collectExprAux
code: partial def collectExprAux (e : Expr) : ClosureM Expr 
goal: Lean.Meta.Closure.ClosureM Lean.Expr

full_name: Lean.Meta.Closure.collectExpr
code: def collectExpr (e : Expr) : ClosureM Expr 
goal: Lean.Meta.Closure.ClosureM Lean.Expr

full_name: Lean.Meta.Closure.pickNextToProcessAux
code: partial def pickNextToProcessAux (lctx : LocalContext) (i : Nat) (toProcess : Array ToProcessElement) (elem : ToProcessElement)
    : ToProcessElement × Array ToProcessElement 
goal: Lean.Meta.Closure.ToProcessElement × Array Lean.Meta.Closure.ToProcessElement

full_name: Lean.Meta.Closure.pickNextToProcess?
code: def pickNextToProcess? : ClosureM (Option ToProcessElement) 
goal: Lean.Meta.Closure.ClosureM (Option Lean.Meta.Closure.ToProcessElement)

full_name: Lean.Meta.Closure.pushFVarArg
code: def pushFVarArg (e : Expr) : ClosureM Unit 
goal: Lean.Meta.Closure.ClosureM Unit

full_name: Lean.Meta.Closure.pushLocalDecl
code: def pushLocalDecl (newFVarId : FVarId) (userName : Name) (type : Expr) (bi := BinderInfo.default) : ClosureM Unit 
goal: Lean.Meta.Closure.ClosureM Unit

full_name: Lean.Meta.Closure.process
code: partial def process : ClosureM Unit 
goal: Lean.Meta.Closure.ClosureM Unit

full_name: Lean.Meta.Closure.mkBinding
code: @[inline] def mkBinding (isLambda : Bool) (decls : Array LocalDecl) (b : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Meta.Closure.mkLambda
code: def mkLambda (decls : Array LocalDecl) (b : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Meta.Closure.mkForall
code: def mkForall (decls : Array LocalDecl) (b : Expr) : Expr 
goal: Lean.Expr

full_name: Lean.Meta.Closure.MkValueTypeClosureResult
code: structure MkValueTypeClosureResult where
  levelParams : Array Name
  type        : Expr
  value       : Expr
  levelArgs   : Array Level
  exprArgs    : Array Expr
goal: Type

full_name: Lean.Meta.Closure.MkValueTypeClosureResult.type
code: structure MkValueTypeClosureResult where
  levelParams : Array Name
  type        : Expr
  value       : Expr
  levelArgs   : Array Level
  exprArgs    : Array Expr
goal: Lean.Expr

full_name: Lean.Meta.Closure.MkValueTypeClosureResult.levelParams
code: structure MkValueTypeClosureResult where
  levelParams : Array Name
  type        : Expr
  value       : Expr
  levelArgs   : Array Level
  exprArgs    : Array Expr
goal: Array Lean.Name

full_name: Lean.Meta.Closure.MkValueTypeClosureResult.levelArgs
code: structure MkValueTypeClosureResult where
  levelParams : Array Name
  type        : Expr
  value       : Expr
  levelArgs   : Array Level
  exprArgs    : Array Expr
goal: Array Lean.Level

full_name: Lean.Meta.Closure.MkValueTypeClosureResult.exprArgs
code: structure MkValueTypeClosureResult where
  levelParams : Array Name
  type        : Expr
  value       : Expr
  levelArgs   : Array Level
  exprArgs    : Array Expr
goal: Array Lean.Expr

full_name: Lean.Meta.Closure.MkValueTypeClosureResult.value
code: structure MkValueTypeClosureResult where
  levelParams : Array Name
  type        : Expr
  value       : Expr
  levelArgs   : Array Level
  exprArgs    : Array Expr
goal: Lean.Expr

full_name: Lean.Meta.Closure.mkValueTypeClosureAux
code: def mkValueTypeClosureAux (type : Expr) (value : Expr) : ClosureM (Expr × Expr) 
goal: Lean.Meta.Closure.ClosureM (Lean.Expr × Lean.Expr)

full_name: Lean.Meta.Closure.mkValueTypeClosure
code: def mkValueTypeClosure (type : Expr) (value : Expr) (zetaDelta : Bool) : MetaM MkValueTypeClosureResult 
goal: Lean.MetaM Lean.Meta.Closure.MkValueTypeClosureResult

full_name: Lean.Meta.mkAuxDefinition
code: /--
  Create an auxiliary definition with the given name, type and value.
  The parameters `type` and `value` may contain free and meta variables.
  A "closure" is computed, and a term of the form `name.{u_1 ... u_n} t_1 ... t_m` is
  returned where `u_i`s are universe parameters and metavariables `type` and `value` depend on,
  and `t_j`s are free and meta variables `type` and `value` depend on. -/
def mkAuxDefinition (name : Name) (type : Expr) (value : Expr) (zetaDelta : Bool := false) (compile : Bool := true) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAuxDefinitionFor
code: /-- Similar to `mkAuxDefinition`, but infers the type of `value`. -/
def mkAuxDefinitionFor (name : Name) (value : Expr) (zetaDelta : Bool := false) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAuxTheorem
code: /--
  Create an auxiliary theorem with the given name, type and value. It is similar to `mkAuxDefinition`.
-/
def mkAuxTheorem (name : Name) (type : Expr) (value : Expr) (zetaDelta : Bool := false) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.mkAuxTheoremFor
code: /--
  Similar to `mkAuxTheorem`, but infers the type of `value`.
-/
def mkAuxTheoremFor (name : Name) (value : Expr) (zetaDelta : Bool := false) : MetaM Expr 
goal: Lean.MetaM Lean.Expr