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 := ⋯ } (f { val := i, isLt := h } x)