Documentation

Lean.Level

def Nat.imax (n m : Nat) :
Equations
  • n.imax m = if m = 0 then 0 else n.max m

Cached hash code, cached results, and other data for Level. hash : 32-bits hasMVar : 1-bit hasParam : 1-bit depth : 24-bits

Equations
Instances For
Equations
Equations
Equations
Equations
Equations
def Lean.Level.mkData (h : UInt64) (depth : Nat := 0) (hasMVar hasParam : Bool := false) :
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
instance Lean.instForInLMVarIdMapProdLMVarId {m : Type u_1 → Type u_2} {α : Type} :
Equations
@[implemented_by Lean.Level.data._override]
noncomputable def Lean.Level.data :
Equations
Equations
  • u.hash = u.data.hash
Equations
  • u.depth = u.data.depth.toNat
Equations
  • u.hasMVar = u.data.hasMVar
Equations
  • u.hasParam = u.data.hasParam
@[export lean_level_hash]
Equations
  • u.hashEx = (hash u).toUInt32
@[export lean_level_has_mvar]
Equations
@[export lean_level_has_param]
Equations
@[export lean_level_depth]
Equations
  • u.depthEx = u.data.depth
Equations
Equations
@[export lean_level_mk_zero]
Equations
@[export lean_level_mk_succ]
Equations
@[export lean_level_mk_mvar]
Equations
@[export lean_level_mk_param]
Equations
@[export lean_level_mk_max]
Equations
@[export lean_level_mk_imax]
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations

If result is true, then forall assignments A which assigns all parameters and metavariables occurring in l, l[A] != zero

Equations
Equations
Equations
Equations
  • u.succ.getOffsetAux x✝ = u.getOffsetAux (x✝ + 1)
  • x✝¹.getOffsetAux x✝ = x✝
Equations
  • lvl.getOffset = lvl.getOffsetAux 0
Equations
  • a.succ.getLevelOffset = a.getLevelOffset
  • x✝.getLevelOffset = x✝
Equations
@[extern lean_level_eq]
opaque Lean.Level.beq (a b : Level) :

occurs u l return true iff u occurs in l.

Equations
  • x✝.occurs v₁.succ = (x✝ == v₁.succ || x✝.occurs v₁)
  • x✝.occurs (v₁.max v₂) = (x✝ == v₁.max v₂ || x✝.occurs v₁ || x✝.occurs v₂)
  • x✝.occurs (v₁.imax v₂) = (x✝ == v₁.imax v₂ || x✝.occurs v₁ || x✝.occurs v₂)
  • x✝¹.occurs x✝ = (x✝¹ == x✝)
Equations
@[irreducible]
Equations
  • l₁.succ.normLtAux x✝² x✝¹ x✝ = l₁.normLtAux (x✝² + 1) x✝¹ x✝
  • x✝².normLtAux x✝¹ l₂.succ x✝ = x✝².normLtAux x✝¹ l₂ (x✝ + 1)
  • (l₁₁.max l₁₂).normLtAux x✝¹ (l₂₁.max l₂₂) x✝ = if (l₁₁.max l₁₂ == l₂₁.max l₂₂) = true then decide (x✝¹ < x✝) else if (l₁₁ != l₂₁) = true then l₁₁.normLtAux 0 l₂₁ 0 else l₁₂.normLtAux 0 l₂₂ 0
  • (l₁₁.imax l₁₂).normLtAux x✝¹ (l₂₁.imax l₂₂) x✝ = if (l₁₁.imax l₁₂ == l₂₁.imax l₂₂) = true then decide (x✝¹ < x✝) else if (l₁₁ != l₂₁) = true then l₁₁.normLtAux 0 l₂₁ 0 else l₁₂.normLtAux 0 l₂₂ 0
  • (Lean.Level.param n₁).normLtAux x✝¹ (Lean.Level.param n₂) x✝ = if (n₁ == n₂) = true then decide (x✝¹ < x✝) else n₁.lt n₂
  • (Lean.Level.mvar n₁).normLtAux x✝¹ (Lean.Level.mvar n₂) x✝ = if (n₁ == n₂) = true then decide (x✝¹ < x✝) else n₁.name.lt n₂.name
  • x✝³.normLtAux x✝² x✝¹ x✝ = if (x✝³ == x✝¹) = true then decide (x✝² < x✝) else decide (x✝³.ctorToNat < x✝¹.ctorToNat)
def Lean.Level.normLt (l₁ l₂ : Level) :

A total order on level expressions that has the following properties

  • succ l is an immediate successor of l.
  • zero is the minimal element. This total order is used in the normalization procedure.
Equations
  • l₁.normLt l₂ = l₁.normLtAux 0 l₂ 0

Return true if u and v denote the same level. Check is currently incomplete.

Equations
  • u.isEquiv v = (u == v || u.normalize == v.normalize)

Reduce (if possible) universe level by 1

Equations
Equations
def Lean.Level.format (u : Level) (mvars : Bool) :
Equations
Equations
Equations
def Lean.Level.quote (u : Level) (prec : Nat := 0) (mvars : Bool := true) :
Equations
Equations
Equations

The update functions try to avoid allocating new values using pointer equality. Note that if the update*! functions are used under a match-expression, the compiler will eliminate the double-match.

@[implemented_by _private.Lean.Level.0.Lean.Level.updateSucc!Impl]
def Lean.Level.updateSucc! (lvl newLvl : Level) :
Equations
@[implemented_by _private.Lean.Level.0.Lean.Level.updateMax!Impl]
def Lean.Level.updateMax! (lvl newLhs newRhs : Level) :
Equations
@[implemented_by _private.Lean.Level.0.Lean.Level.updateIMax!Impl]
def Lean.Level.updateIMax! (lvl newLhs newRhs : Level) :
Equations
@[specialize #[]]
Equations
Equations
Equations
def Lean.Level.instantiateParams (u : Level) (paramNames : List Name) (vs : List Level) :
Equations
Equations
@[irreducible]
@[reducible, inline]
abbrev Lean.LevelMap (α : Type) :
Equations
@[reducible, inline]
Equations
@[reducible, inline]
Equations
Equations
  • v.succ.collectMVars s = v.collectMVars s
  • (u_2.max v).collectMVars s = u_2.collectMVars (v.collectMVars s)
  • (u_2.imax v).collectMVars s = u_2.collectMVars (v.collectMVars s)
  • (Lean.Level.mvar n).collectMVars s = Lean.RBTree.insert s n
  • u.collectMVars s = s
Equations
Equations
def Lean.Level.any (u : Level) (p : LevelBool) :
Equations
  • u.any p = (u.find? p).isSome
@[reducible, inline]
abbrev Nat.toLevel (n : Nat) :
Equations