# Documentation

Lean.Meta.Transform

• Return expression without visiting any subexpressions.

done:
• Visit expression (which should be different from current expression) instead.

visit:
• Continue transformation with the given expression (defaults to current expression). For pre, this means visiting the children of the expression. For post, this is equivalent to returning done.

continue:
Instances For
def Lean.Core.transform {m : } [inst : ] [inst : ] [inst : ] (input : Lean.Expr) (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) :

Transform the expression input using pre and post.

• First pre is invoked with the current expression and recursion is continued according to the TransformStep result. In all cases, the expression contained in the result, if any, must be definitionally equal to the current expression.
• After recursion, if any, post is invoked on the resulting expression.

The term s in both pre s and post s may contain loose bound variables. So, this method is not appropriate for if one needs to apply operations (e.g., whnf, inferType) that do not handle loose bound variables. Consider using Meta.transform to avoid loose bound variables.

This method is useful for applying transformations such as beta-reduction and delta-reduction.

Equations
partial def Lean.Core.transform.visit {m : } [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) :
(x : ) →
partial def Lean.Core.transform.visit.visitPost {m : } [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) :
(x : ) →
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.transform {m : } [inst : ] [inst : ] [inst : ] [inst : ] [inst : ] [inst : ] [inst : ] (input : Lean.Expr) (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) (usedLetOnly : ) :

Similar to Core.transform, but terms provided to pre and post do not contain loose bound variables. So, it is safe to use any MetaM method at pre and post.

Equations
• One or more equations did not get rendered due to their size.
partial def Lean.Meta.transform.visit {m : } [inst : ] [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) (usedLetOnly : ) :
(x : ) →
partial def Lean.Meta.transform.visit.visitPost {m : } [inst : ] [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) (usedLetOnly : ) :
(x : ) →
partial def Lean.Meta.transform.visit.visitLambda {m : } [inst : ] [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) (usedLetOnly : ) :
(x : ) →
partial def Lean.Meta.transform.visit.visitForall {m : } [inst : ] [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) (usedLetOnly : ) :
(x : ) →
partial def Lean.Meta.transform.visit.visitLet {m : } [inst : ] [inst : ] [inst : ] (pre : optParam () fun x => pure Lean.TransformStep.continue) (post : optParam () fun e => ) (usedLetOnly : ) :
(x : ) →
Equations
• One or more equations did not get rendered due to their size.

Unfold definitions and theorems in e that are not in the current environment, but are in biggerEnv.

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.