rw [Stream'.corec_def,Stream'.map]
case h
α : Type
lengths : Stream' ℕ
a : Stream' α
n : ℕ
⊢ Stream'.corec (fun x => Stream'.take x.1.head x.2) (fun x => (x.1.tail, Stream'.drop x.1.head x.2)) (lengths, a) n =
    Stream'.take (lengths n) (Stream'.drop (∑ j ∈ Finset.range n, lengths j) a)
case h
α : Type
lengths : Stream' ℕ
a : Stream' α
n : ℕ
⊢ Stream'.take ((Stream'.iterate (fun x => (x.1.tail, Stream'.drop x.1.head x.2)) (lengths, a)).get n).1.head
      ((Stream'.iterate (fun x => (x.1.tail, Stream'.drop x.1.head x.2)) (lengths, a)).get n).2 =
    Stream'.take (lengths n) (Stream'.drop (∑ j ∈ Finset.range n, lengths j) a)