The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.Eval

2 declarations. Mathlib docs · Source

The eval% term elaborator

This file provides the eval% x term elaborator, which evaluates the constant x at compile-time in the interpreter, and interpolates it into the expression.

def Mathlib.Meta.eval_expr E1 #

Lean.ParserDescr

eval% x evaluates the term x : X in the interpreter, and then injects the resulting expression.

As an example:

example : 2^10 = eval% 2^10 := by
  -- goal is `2^10 = 1024`
  sorry

This only works if a Lean.ToExpr X instance is available.

Tip: you can use show_term eval% x to see the value of eval% x.

def Mathlib.Meta.elabEvalExpr E1 #

Lean.Elab.Term.TermElab

eval% x evaluates the term x : X in the interpreter, and then injects the resulting expression.

As an example:

example : 2^10 = eval% 2^10 := by
  -- goal is `2^10 = 1024`
  sorry

This only works if a Lean.ToExpr X instance is available.

Tip: you can use show_term eval% x to see the value of eval% x.