induction n generalizing f init
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u
f : Nat → α → m α
init : α
n : Nat
⊢ foldM f init (n + 1) = foldM f init n >>= f n
case zero
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u
f : Nat → α → m α
init : α
⊢ foldM f init (zero + 1) = foldM f init zero >>= f zero

case succ
m : Type u → Type v
inst✝¹ : Monad m
inst✝ : LawfulMonad m
α : Type u
n✝ : Nat
n_ih✝ : ∀ {f : Nat → α → m α} {init : α}, foldM f init (n✝ + 1) = foldM f init n✝ >>= f n✝
f : Nat → α → m α
init : α
⊢ foldM f init (succ n✝ + 1) = foldM f init (succ n✝) >>= f (succ n✝)