ToExpr
instances for Mathlib #
This module should be imported by any module that intends to define ToExpr
instances.
It provides necessary dependencies (the Lean.ToLevel
class) and it also overrides the instances
that come from core Lean 4 that do not handle universe polymorphism.
(See the module Lean.ToExpr
for the instances that are overridden.)
In addition, we provide some additional ToExpr
instances for core definitions.
instance
Lean.instToExprOption_1 :
{α : Type u} → [inst : Lean.ToExpr α] → [inst : Lean.ToLevel.{u}] → Lean.ToExpr (Option α)
Equations
- Lean.instToExprOption_1 = { toExpr := Lean.toExprOption✝, toTypeExpr := Lean.Expr.app (Lean.Expr.const `Option [Lean.toLevel.{u}]) (Lean.toTypeExpr α) }
instance
Lean.instToExprList_1 :
{α : Type u} → [inst : Lean.ToExpr α] → [inst : Lean.ToLevel.{u}] → Lean.ToExpr (List α)
Equations
- Lean.instToExprList_1 = { toExpr := Lean.toExprList✝, toTypeExpr := Lean.Expr.app (Lean.Expr.const `List [Lean.toLevel.{u}]) (Lean.toTypeExpr α) }
instance
Lean.instToExprArray_1
{α : Type u}
[Lean.ToExpr α]
[Lean.ToLevel.{u}]
:
Lean.ToExpr (Array α)
Equations
- One or more equations did not get rendered due to their size.
instance
Lean.instToExprProd_1 :
{α : Type u} →
{β : Type v} →
[inst : Lean.ToExpr α] →
[inst : Lean.ToExpr β] → [inst : Lean.ToLevel.{u}] → [inst : Lean.ToLevel.{v}] → Lean.ToExpr (α × β)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.instToExprFilePath = { toExpr := Lean.toExprFilePath✝, toTypeExpr := Lean.Expr.const `System.FilePath [] }
Equations
- Mathlib.instToExprInt = { toExpr := Mathlib.toExprInt✝, toTypeExpr := Lean.Expr.const `Int [] }
instance
Mathlib.instToExprULift :
{α : Type s} → [inst : Lean.ToExpr α] → [inst : Lean.ToLevel.{r}] → [inst : Lean.ToLevel.{s}] → Lean.ToExpr (ULift α)
Equations
- Mathlib.instToExprULift = { toExpr := Mathlib.toExprULift✝, toTypeExpr := Lean.Expr.app (Lean.Expr.const `ULift [Lean.toLevel.{r}, Lean.toLevel.{s}]) (Lean.toTypeExpr α) }
Hand-written instance since PUnit
is a Sort
rather than a Type
.
Equations
- Mathlib.instToExprPUnit = { toExpr := fun (x : PUnit) => Lean.mkConst `PUnit.unit [Lean.toLevel.{u + 1}], toTypeExpr := Lean.mkConst `PUnit [Lean.toLevel.{u + 1}] }
Equations
- Mathlib.instToExprPos = { toExpr := Mathlib.toExprPos✝, toTypeExpr := Lean.Expr.const `String.Pos [] }
Equations
- Mathlib.instToExprSubstring = { toExpr := Mathlib.toExprSubstring✝, toTypeExpr := Lean.Expr.const `Substring [] }
Equations
- Mathlib.instToExprSourceInfo = { toExpr := Mathlib.toExprSourceInfo✝, toTypeExpr := Lean.Expr.const `Lean.SourceInfo [] }
Equations
- Mathlib.instToExprPreresolved = { toExpr := Mathlib.toExprPreresolved✝, toTypeExpr := Lean.Expr.const `Lean.Syntax.Preresolved [] }
Equations
- Mathlib.instToExprSyntax = { toExpr := Mathlib.toExprSyntax✝, toTypeExpr := Lean.Expr.const `Lean.Syntax [] }
Equations
- Mathlib.instToExprMData = { toExpr := Mathlib.toExprMData, toTypeExpr := Lean.mkConst `Lean.MData }
Equations
- Mathlib.instToExprFVarId = { toExpr := Mathlib.toExprFVarId✝, toTypeExpr := Lean.Expr.const `Lean.FVarId [] }
Equations
- Mathlib.instToExprMVarId = { toExpr := Mathlib.toExprMVarId✝, toTypeExpr := Lean.Expr.const `Lean.MVarId [] }
Equations
- Mathlib.instToExprLevelMVarId = { toExpr := Mathlib.toExprLevelMVarId✝, toTypeExpr := Lean.Expr.const `Lean.LevelMVarId [] }
Equations
- Mathlib.instToExprLevel = { toExpr := Mathlib.toExprLevel✝, toTypeExpr := Lean.Expr.const `Lean.Level [] }
Equations
- Mathlib.instToExprBinderInfo = { toExpr := Mathlib.toExprBinderInfo✝, toTypeExpr := Lean.Expr.const `Lean.BinderInfo [] }
Equations
- Mathlib.instToExprLiteral = { toExpr := Mathlib.toExprLiteral✝, toTypeExpr := Lean.Expr.const `Lean.Literal [] }
Equations
- Mathlib.instToExprExpr = { toExpr := Mathlib.toExprExpr✝, toTypeExpr := Lean.Expr.const `Lean.Expr [] }