simp only [sum_eq_corec, head_corec, tail_corec]
α : Type u_1
σ : Stream' α
x : α
f : α → ℕ
g : α → α
⊢ sum (corec f g x) =
    corec Prod.fst
      (fun x =>
        match x with
        | (acc, x) => (acc + f x, g x))
      (f x, g x)
α : Type u_1
σ : Stream' α
x : α
f : α → ℕ
g : α → α
⊢ corec Prod.fst (fun x => (x.fst + head x.snd, tail x.snd)) (f x, corec f g (g x)) =
    corec Prod.fst (fun x => (x.fst + f x.snd, g x.snd)) (f x, g x)