Fixpoint lookup_block (bs : list block) (id : block_id) : option nat :=
  match bs with
  | [] => None
  | b :: bs' =>
    if Nat.eqb (block_blockid b) id
      then Some (block_payload b)
      else lookup_block bs' id
  end.

Lemma lookup_block_Some bs id v : lookup_block bs id = Some v -> In {| block_blockid := id; block_payload := v |} bs.