跳到內容

fin

本頁內容尚未翻譯。

data Fin : Nat -> Type

A natural number below n.

def absurdZero {A : Type} (i : Fin zero) : A

There is no index below zero.

def toNat {n : Nat} (i : Fin n) : Nat

The number.

def ofNat (n : Nat) (k : Nat) (below : Nat.blt k n = true) : Fin n

The index of a number below the bound.

def ofNatOption (n : Nat) (k : Nat) : Option (Fin n)

The index of a number, if it is below the bound.

def last (n : Nat) : Fin (succ n)

The largest index below succ n, which is n.

def weaken {n : Nat} (i : Fin n) : Fin (succ n)

The same number under a bound one larger.

def beq {n : Nat} (i : Fin n) (j : Fin n) : Bool

Whether two indices are the same number.

def blt {n : Nat} (i : Fin n) (j : Fin n) : Bool

Whether i is below j.

def all (n : Nat) : List (Fin n)

All the indices below n, in order.

def toNatBelow {n : Nat} (i : Fin n) : Nat.blt (toNat i) n = true

An index’s number is below its bound.

def toNatOfNat (n : Nat) (k : Nat) (below : Nat.blt k n = true) : toNat (ofNat n k below) = k

An index made from a number has that number.

def toNatWeaken {n : Nat} (i : Fin n) : toNat (weaken i) = toNat i

Weakening keeps the number.

def toNatLast (n : Nat) : toNat (last n) = n

The last index below succ n is n.

def allLength (n : Nat) : List.length (all n) = n

There are n indices below n.