Result-type changing `Fin` arithmetics
import public Data.Fin
(+) : Fin m -> Fin (S n) -> Fin (m + n)
Addition of `Fin`s as bounded naturals.
The resulting type has the smallest possible bound
as illustrated by the relations with the `last` function.
(*) : Fin (S m) -> Fin (S n) -> Fin (S (m * n))
Multiplication of `Fin`s as bounded naturals.
The resulting type has the smallest possible bound
as illustated by the relations with the `last` function.
finToNatPlusHomo : (x : Fin m) -> (y : Fin (S n)) -> finToNat (x + y) = finToNat x + finToNat y
finToNatMultHomo : (x : Fin (S m)) -> (y : Fin (S n)) -> finToNat (x * y) = finToNat x * finToNat y
plusPreservesLast : (m : Nat) -> (n : Nat) -> last + last = last
multPreservesLast : (m : Nat) -> (n : Nat) -> last * last = last
plusSuccRightSucc : (left : Fin m) -> (right : Fin (S n)) -> FS (left + right) ~~~ (left + FS right)
shiftAsPlus : (k : Fin (S m)) -> shift n k ~~~ (last + k)
weakenNAsPlusFZ : (k : Fin n) -> weakenN m k = k + the (Fin (S m)) FZ
weakenNPlusHomo : (k : Fin p) -> weakenN n (weakenN m k) ~~~ weakenN (m + n) k
weakenNOfPlus : (k : Fin m) -> (l : Fin (S n)) -> weakenN w (k + l) ~~~ (weakenN w k + l)
plusZeroLeftNeutral : (k : Fin (S n)) -> (FZ + k) ~~~ k
congPlusLeft : (c : Fin (S p)) -> k ~~~ l -> (k + c) ~~~ (l + c)
plusZeroRightNeutral : (k : Fin m) -> (k + FZ) ~~~ k
congPlusRight : (c : Fin m) -> k ~~~ l -> (c + k) ~~~ (c + l)
plusCommutative : (left : Fin (S m)) -> (right : Fin (S n)) -> (left + right) ~~~ (right + left)
plusAssociative : (left : Fin m) -> (centre : Fin (S n)) -> (right : Fin (S p)) -> (left + (centre + right)) ~~~ ((left + centre) + right)