# Documentation

Lean.Meta.IndPredBelow

• motives :
• typeInfos :
• belowNames :
• numParams : Nat

The context used in the creation of the below scheme for inductive predicates.

Instances For
• target :
• indVal :
• params :
• args :
• motives :
• innerType : Lean.Expr

Collection of variables used to keep track of the positions of binders in the construction of below motives and constructors.

Instances For
Equations
• One or more equations did not get rendered due to their size.
• params :
• motives :
• indices :
• witness : Lean.FVarId
• indHyps :

Collection of variables used to keep track of the local context used in the brecOn proof.

Instances For
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.IndPredBelow.mkContext.mkHeader (motives : ) (numParams : Nat) (indVal : Lean.InductiveVal) :
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.IndPredBelow.mkContext.addMotives (motives : ) (numParams : Nat) :
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
def Lean.Meta.IndPredBelow.mkCtorType (belowIdx : Nat) (originalCtor : Lean.ConstructorVal) :
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.IndPredBelow.mkCtorType.mkMotiveBinder (vars : Lean.Meta.IndPredBelow.Variables) (indValIdx : Nat) (binder : Lean.Expr) (domain : Lean.Expr) {α : Type} (k : ) :
Equations
• One or more equations did not get rendered due to their size.
Equations
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.IndPredBelow.mkBrecOnDecl.mkIH (params : ) (motives : ) (idx : Fin (Array.size ctx.motives)) (motive : ) :
Equations
• One or more equations did not get rendered due to their size.

Given a constructor name, find the indices of the corresponding below version thereof.

Equations
• One or more equations did not get rendered due to their size.
partial def Lean.Meta.IndPredBelow.getBelowIndices.loop (xs : ) (rest : Lean.Expr) (belowIndices : ) (xIdx : Nat) (yIdx : Nat) :
def Lean.Meta.IndPredBelow.mkBelowMatcher (matcherApp : Lean.Meta.MatcherApp) (belowMotive : Lean.Expr) (below : Lean.Expr) (idx : Nat) :

This function adds an additional below discriminant to a matcher application. It is used for modifying the patterns, such that the structural recursion can use the new below predicate instead of the original one and thus be used prove structural recursion.

It takes as parameters:

• matcherApp: a matcher application
• belowMotive: the motive, that the below type should carry
• below: an expression from the local context that is the below version of a predicate and can be used for structural recursion
• idx: the index of the original predicate discriminant.

It returns:

• A matcher application as an expression
• A side-effect for adding the matcher to the environment
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
partial def Lean.Meta.IndPredBelow.mkBelowMatcher.convertToBelow (belowMotive : Lean.Expr) (indName : Lean.Name) (originalPattern : Lean.Meta.Match.Pattern) :

this function changes the type of the pattern from the original type to the below version thereof. Most of the cases don't apply. In order to change the type and the pattern to be type correct, we don't simply recursively change all occurrences, but rather, we recursively change occurences of the constructor. As such there are only a few cases:

• the pattern is a constructor from the original type. Here we need to:
• replace the constructor
• copy original recursive patterns and convert them to below and reintroduce them in the correct position
• turn original recursive patterns inaccessible
• introduce free variables as needed.
• it is an as pattern. Here the contstructor could be hidden inside of it.
• it is a variable. Here you we need to introduce a fresh variable of a different type.
partial def Lean.Meta.IndPredBelow.mkBelowMatcher.transformFields (belowMotive : Lean.Expr) (belowCtor : Lean.Expr) (indName : Lean.Name) (belowFieldOpts : ) :
partial def Lean.Meta.IndPredBelow.mkBelowMatcher.transformFields.loop (belowMotive : Lean.Expr) (indName : Lean.Name) (belowCtor : Lean.Expr) (belowFieldOpts : ) (belowFields : ) (additionalFVars : ) :
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.
Equations
• One or more equations did not get rendered due to their size.