Documentation

Mathlib.Tactic.ToLevel

ToLevel class #

This module defines Lean.ToLevel, which is the Lean.Level analogue to Lean.ToExpr.

Warning: Import Mathlib.Tactic.ToExpr instead of this one if you are writing ToExpr instances. This ensures that you are using the universe polymorphic ToExpr instances that override the ones from Lean 4 core.

class Lean.ToLevel :
Type (u + 1)

A class to create Level expressions that denote particular universe levels in Lean. Lean.ToLevel.toLevel.{u} evaluates to a Lean.Level term representing u

  • toLevel : Lean.Level

    A Level that represents the universe level u.

  • univ : Type u

    The universe itself. This is only here to avoid the "unused universe parameter" error.

Instances
    Equations
    • Lean.instToLevel_1 = { toLevel := Lean.toLevel.{?u.10}.succ, univ := Type ?u.10 }

    ToLevel for max u v. This is not an instance since it causes divergence.

    Equations
    • Lean.ToLevel.max = { toLevel := Lean.toLevel.{?u.16}.max Lean.toLevel.{?u.15}, univ := Sort (max ?u.16 ?u.15) }
    Instances For

      ToLevel for imax u v. This is not an instance since it causes divergence.

      Equations
      • Lean.ToLevel.imax = { toLevel := Lean.toLevel.{?u.16}.imax Lean.toLevel.{?u.15}, univ := Sort (imax ?u.16 ?u.15) }
      Instances For