@[inline]
castAdd m i
embeds i : Fin n
in Fin (n+m)
. See also Fin.natAdd
and Fin.addNat
.
Equations
- Fin.castAdd m = Fin.castLE (_ : n ≤ n + m)
Instances For
Inner loop for Fin.foldl
. Fin.foldl.loop n f x i = f (f (f x i) ...) (n-1)
Equations
- Fin.foldl.loop n f x i = if h : i < n then Fin.foldl.loop n f (f x { val := i, isLt := h }) (i + 1) else x
Instances For
Inner loop for Fin.foldr
. Fin.foldr.loop n f i x = f 0 (f ... (f (i-1) x))
Equations
- Fin.foldr.loop n f { val := 0, property := property } x = x
- Fin.foldr.loop n f { val := Nat.succ i, property := h } x = Fin.foldr.loop n f { val := i, property := (_ : i ≤ n) } (f { val := i, isLt := h } x)