(* The complement of make_shares. *)
Fixpoint make_shares_inv shs (lasts : list Z) i {struct lasts} : list share :=
match lasts with
| [] => []
| b :: rest => if eq_dec b i then hd Share.bot shs :: make_shares_inv (tl shs) rest i
else make_shares_inv (tl shs) rest i
end.

Lemma make_shares_inv_In : forall i lasts x shs (Hx : 0 <= x < Zlength lasts) (Hi : Znth x lasts = i)
(Hlen : Zlength shs >= Zlength lasts),
In (Znth x shs) (make_shares_inv shs lasts i).