File: .lake/packages/lean4/src/lean/Lean/Elab/PreDefinition/Structural/Basic.lean

full_name: Lean.Elab.Structural.RecArgInfo.indLevels
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: List Lean.Level

full_name: Lean.Elab.Structural.RecArgInfo.pos
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Nat

full_name: Lean.Elab.Structural.RecArgInfo.indName
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Lean.Name

full_name: Lean.Elab.Structural.RecArgInfo.indParams
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Array Lean.Expr

full_name: Lean.Elab.Structural.RecArgInfo.indPred
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Bool

full_name: Lean.Elab.Structural.RecArgInfo.ys
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Array Lean.Expr

full_name: Lean.Elab.Structural.RecArgInfo.indIndices
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Array Lean.Expr

full_name: Lean.Elab.Structural.RecArgInfo
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Type

full_name: Lean.Elab.Structural.RecArgInfo.reflexive
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Bool

full_name: Lean.Elab.Structural.RecArgInfo.indicesPos
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Array Nat

full_name: Lean.Elab.Structural.RecArgInfo.fixedParams
code: structure RecArgInfo where
  /-- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
  fixedParams : Array Expr
  /-- recursion arguments -/
  ys          : Array Expr
  /-- position in `ys` of the argument we are recursing on -/
  pos         : Nat
  /-- position in `ys` of the inductive datatype indices we are recursing on -/
  indicesPos  : Array Nat
  /-- inductive datatype name of the argument we are recursing on -/
  indName     : Name
  /-- inductive datatype universe levels of the argument we are recursing on -/
  indLevels   : List Level
  /-- inductive datatype parameters of the argument we are recursing on -/
  indParams   : Array Expr
  /-- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i` -/
  indIndices  : Array Expr
  /-- true if we are recursing over a reflexive inductive datatype -/
  reflexive   : Bool
  /-- true if the type is an inductive predicate -/
  indPred     : Bool
goal: Array Lean.Expr

full_name: Lean.Elab.Structural.RecArgInfo.recArgPos
code: def RecArgInfo.recArgPos (info : RecArgInfo) : Nat 
goal: Nat

full_name: Lean.Elab.Structural.State
code: structure State where
  /-- As part of the inductive predicates case, we keep adding more and more discriminants from the
     local context and build up a bigger matcher application until we reach a fixed point.
     As a side-effect, this creates matchers. Here we capture all these side-effects, because
     the construction rolls back any changes done to the environment and the side-effects
     need to be replayed. -/
  addMatchers : Array (MetaM Unit) := #[]
goal: Type

full_name: Lean.Elab.Structural.State.addMatchers
code: structure State where
  /-- As part of the inductive predicates case, we keep adding more and more discriminants from the
     local context and build up a bigger matcher application until we reach a fixed point.
     As a side-effect, this creates matchers. Here we capture all these side-effects, because
     the construction rolls back any changes done to the environment and the side-effects
     need to be replayed. -/
  addMatchers : Array (MetaM Unit) := #[]
goal: Array (Lean.MetaM Unit)

full_name: Lean.Elab.Structural.M
code: abbrev M 
goal: Type

full_name: Lean.Elab.Structural.instInhabitedM
code: instance : Inhabited (M α) 
goal: Inhabited (Lean.Elab.Structural.M α)

full_name: Lean.Elab.Structural.run
code: def run (x : M α) (s : State := {}) : MetaM (α × State) 
goal: Lean.MetaM (α × Lean.Elab.Structural.State)

full_name: Lean.Elab.Structural.recArgHasLooseBVarsAt
code: /--
  Return true iff `e` contains an application `recFnName .. t ..` where the term `t` is
  the argument we are trying to recurse on, and it contains loose bound variables.

  We use this test to decide whether we should process a matcher-application as a regular
  application or not. That is, whether we should push the `below` argument should be affected by the matcher or not.
  If `e` does not contain an application of the form `recFnName .. t ..`, then we know
  the recursion doesn't depend on any pattern variable in this matcher.
-/
def recArgHasLooseBVarsAt (recFnName : Name) (recArgPos : Nat) (e : Expr) : Bool 
goal: Bool