Information about a single argument position in a function's type signature.
This is used during pattern matching and structural definitional equality tests to identify arguments that can be skipped or handled specially (e.g., instance arguments can be synthesized, proof arguments can be inferred).
- isProof : Bool
trueif this argument is a proof (its type is aProp). - isInstance : Bool
trueif this argument is a type class instance.
Instances For
Equations
Instances For
Information about a function symbol. It stores which argument positions are proofs or instances, enabling optimizations during pattern matching and structural definitional equality tests such as skipping proof arguments or deferring instance synthesis.
- argsInfo : Array ProofInstArgInfo
Information about each argument position.
Instances For
Equations
- Lean.Meta.Sym.instInhabitedProofInstInfo.default = { argsInfo := default }
Instances For
Information on how to build congruence proofs for function applications. This enables efficient rewriting of subterms without repeatedly inferring types or instances.
- none : CongrInfo
None of the arguments of the function can be rewritten.
- fixedPrefix
(prefixSize suffixSize : Nat)
: CongrInfo
For functions with a fixed prefix of implicit/instance arguments followed by explicit non-dependent arguments that can be rewritten independently.
prefixSize: Number of leading arguments (types, instances) that are determined by the suffix arguments and should not be rewritten directly.suffixSize: Number of trailing arguments that can be rewritten using simple congruence.
Examples (showing
prefixSize,suffixSize): - interlaced
(rewritable : Array Bool)
: CongrInfo
For functions with interlaced rewritable and non-rewritable arguments. Each element indicates whether the corresponding argument position can be rewritten.
Example: For
HEq {α : Sort u} (a : α) {β : Sort u} (b : β), the mask would be#[false, true, false, true]— we can rewriteaandb, but notαorβ. - congrTheorem
(thm : CongrTheorem)
: CongrInfo
For functions that have proofs and
Decidablearguments. For this kind of function we generate a custom theorem. Example:Array.eraseIdx {α : Type u} (xs : Array α) (i : Nat) (h : i < xs.size) : Array α. The proof argumenthdepends onxsandi. To be able to rewritexsandi, we use the auto-generated theorem.Array.eraseIdx.congr_simp {α : Type u} (xs xs' : Array α) (e_xs : xs = xs') (i i' : Nat) (e_i : i = i') (h : i < xs.size) : xs.eraseIdx i h = xs'.eraseIdx i' ⋯
Instances For
Readonly context for the symbolic computation framework.
Instances For
Mutable state for the symbolic computation framework.
Maps expressions to their maximal free variable (by declaration index).
maxFVar[e] = some fvarIdmeansfvarIdis the free variable with the largest declaration index occurring ine.maxFVar[e] = nonemeansecontains no free variables (but may contain metavariables).
Recall that if
econtains a metavariable?m, then we assumeemay contain any free variable in the local context associated with?m.This mapping enables O(1) local context compatibility checks during metavariable assignment. Instead of traversing local contexts with
isSubPrefixOf, we check if the maximal free variable in the assigned value is in scope of the metavariable's local context.Note: We considered using a mapping
PHashMap ExprPtr FVarId. However, there is a corner case that is not supported by this representation.econtains a metavariable (with an empty local context), and no free variables.- proofInstInfo : PHashMap Name (Option ProofInstInfo)
Cache for
getLevelresults, keyed by pointer equality.- debug : Bool
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the internalized True constant.
Equations
- Lean.Meta.Sym.getTrueExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.trueExpr
Instances For
Returns the internalized False constant.
Equations
- Lean.Meta.Sym.getFalseExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.falseExpr
Instances For
Returns the internalized Bool.true.
Equations
- Lean.Meta.Sym.getBoolTrueExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.btrueExpr
Instances For
Returns the internalized Bool.false.
Equations
- Lean.Meta.Sym.getBoolFalseExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.bfalseExpr
Instances For
Returns the internalized 0 : Nat numeral.
Equations
- Lean.Meta.Sym.getNatZeroExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.natZExpr
Instances For
Returns the internalized Ordering.eq.
Equations
- Lean.Meta.Sym.getOrderingEqExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.ordEqExpr
Instances For
Returns the internalized Int.
Equations
- Lean.Meta.Sym.getIntExpr = do let __do_lift ← Lean.Meta.Sym.getSharedExprs pure __do_lift.intExpr