A simplification theorem for the structural simplifier.
Contains both the theorem expression and a precomputed pattern for efficient unification during rewriting.
- expr : Expr
The theorem expression, typically
Expr.const declNamefor a named theorem. - pattern : Pattern
Precomputed pattern extracted from the theorem's type for efficient matching.
- rhs : Expr
Right-hand side of the equation.
- perm : Bool
If
true, the theorem is a permutation rule (e.g.,x + y = y + x). Rewriting is only applied when the result is strictly less than the input (usingacLt), preventing infinite loops. - rhsVarMask : Nat
- fallback : Bool
If
true, the theorem is tried only when no other theorem rewrites the term. Used for the unfolding theoremf.eq_defof a definitionfprovided as aSym.simpparameter: the equational theorems offtake precedence. SeeTheorems.rewrite.
Instances For
Equations
Equations
- Lean.Meta.Sym.Simp.instBEqTheorem = { beq := fun (thm₁ thm₂ : Lean.Meta.Sym.Simp.Theorem) => thm₁.expr == thm₂.expr }
Collection of simplification theorems available to the simplifier.
The theorems with
Theorem.fallback := true. SeeTheorems.rewrite.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the theorems matching e, excluding the fallback ones.
Equations
- thms.getMatch mctx e = Lean.Meta.Sym.getMatch mctx thms.thms e
Instances For
Returns the theorems matching a prefix of e, excluding the fallback ones.
Equations
- thms.getMatchWithExtra mctx e = Lean.Meta.Sym.getMatchWithExtra mctx thms.thms e
Instances For
Returns the fallback theorems matching a prefix of e.
Equations
- thms.getFallbackMatchWithExtra mctx e = Lean.Meta.Sym.getMatchWithExtra mctx thms.fallback e
Instances For
Equations
- Lean.Meta.Sym.Simp.isPerm numVars lhs rhs = match (ReaderT.run (Lean.Meta.Sym.Simp.isPermAux✝ lhs rhs) 0).run (Array.replicate numVars none) with | Except.ok a => true | x => false
Instances For
The names of the theorems contributed by a declaration used as a Sym.simp theorem.
The declaration itself when it is a proposition, or the equational theorems of a definition. Empty for a reducible definition, which the
Sympreprocessing unfolds.The unfolding theorem
f.eq_defof a non-recursive definitionf, unlessthmsalready unfolds everyfapplication. It is a fallback (seeTheorem.fallback), so thatsimp [f]unfolds thefapplications not covered by the equational theorems, likeMeta.simpdoes.
Instances For
Returns the names of the theorems contributed by declName when it is used as a Sym.simp
theorem. A proposition contributes itself. A definition contributes its equational theorems
and, when it is not recursive, its unfolding theorem, so that simp [f] unfolds f
applications.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Creates the Theorems contributed by declName when it is used as a Sym.simp theorem.
See getSimpTheoremNames.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Environment extension storing a set of Sym.Simp theorems.
Each named set gets its own extension, created by registerSymSimpAttr.
Equations
Instances For
Equations
- ext.getTheorems = do let __do_lift ← Lean.getEnv pure (Lean.ScopedEnvExtension.getState ext __do_lift)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.