# Documentation

Lean.Meta.Tactic.Simp.SimpTheorems

• A global declaration in the environment.

decl:
• A local hypothesis. When contextual := true is enabled, this fvar may exist in an extension of the current local context; it will not be used for rewriting by simp once it is out of scope but it may end up in the usedSimps trace.

fvar:
• A proof term provided directly to a call to simp [ref, ...] where ref is the provided simp argument (of kind Parser.Tactic.simpLemma). The id is a unique identifier for the call.

stx:
• Some other origin. name should not collide with the other types for erasure to work correctly, and simp trace will ignore this lemma. The other origins should be preferred if possible.

other:

An Origin is an identifier for simp theorems which indicates roughly what action the user took which lead to this theorem existing in the simp set.

Instances For

A unique identifier corresponding to the origin.

Equations
• One or more equations did not get rendered due to their size.
Equations
Equations
@[inline]
Equations
• It stores universe parameter names for universe polymorphic proofs. Recall that it is non-empty only when we elaborate an expression provided by the user. When proof is just a constant, we can use the universe parameter names stored in the declaration.

levelParams :
• proof : Lean.Expr
• priority : Nat
• post : Bool
• perm is true if lhs and rhs are identical modulo permutation of variables.

perm : Bool
• origin is mainly relevant for producing trace messages. It is also viewed an id used to "erase" simp theorems from SimpTheorems.

• rfl is true if proof is by Eq.refl or rfl.

rfl : Bool

The fields levelParams and proof are used to encode the proof of the simp theorem. If the proof is a global declaration c, we store Expr.const c [] at proof without the universe levels, and levelParams is set to #[] When using the lemma, we create fresh universe metavariables. Motivation: most simp theorems are global declarations, and this approach is faster and saves memory.

The field levelParams is not empty only when we elaborate an expression provided by the user, and it contains universe metavariables. Then, we use abstractMVars to abstract the universe metavariables and create new fresh universe parameters that are stored at the field levelParams.

Instances For
Equations
• One or more equations did not get rendered due to their size.
partial def Lean.Meta.isRflProofCore (type : Lean.Expr) (proof : Lean.Expr) :
partial def Lean.Meta.isRflTheorem (declName : Lean.Name) :
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.ppOrigin {m : } [inst : ] [inst : ] [inst : ] :
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.ppSimpTheorem {m : } [inst : ] [inst : ] [inst : ] [inst : ] :
Equations
• One or more equations did not get rendered due to their size.
Equations
@[inline]
Equations
• lemmaNames :
• toUnfold :
• erased :
• toUnfoldThms :
Instances For
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.

Return true if declName is tagged to be unfolded using unfoldDefinition? (i.e., without using equational theorems).

Equations

Register the equational theorems for the given definition.

Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.SimpTheorems.erase {m : } [inst : ] [inst : ] (thmId : Lean.Meta.Origin) :
Equations
• One or more equations did not get rendered due to their size.
• thm:
• toUnfold:
• toUnfoldThms:
Instances For
Equations
def Lean.Meta.addSimpTheorem (ext : Lean.Meta.SimpExtension) (declName : Lean.Name) (post : Bool) (inv : Bool) (attrKind : Lean.AttributeKind) (prio : Nat) :
Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.mkSimpAttr (attrName : Lean.Name) (attrDescr : String) (ext : Lean.Meta.SimpExtension) (ref : ) :
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.
@[inline]
Equations
def Lean.Meta.registerSimpAttr (attrName : Lean.Name) (attrDescr : String) (ref : ) :
Equations
• One or more equations did not get rendered due to their size.
Equations
def Lean.Meta.SimpTheorems.addConst (declName : Lean.Name) (post : ) (inv : ) (prio : optParam Nat 1000) :

Auxiliary method for adding a global declaration to a SimpTheorems datastructure.

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.mkSimpTheorems (id : Lean.Meta.Origin) (levelParams : ) (proof : Lean.Expr) (post : ) (inv : ) (prio : optParam Nat 1000) :

Auxiliary method for creating simp theorems from a proof term val.

Equations
• One or more equations did not get rendered due to their size.
def Lean.Meta.SimpTheorems.add (id : Lean.Meta.Origin) (levelParams : ) (proof : Lean.Expr) (inv : ) (post : ) (prio : optParam Nat 1000) :

Auxiliary method for adding a local simp theorem to a SimpTheorems datastructure.

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.
@[inline]
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.