Set Bullet Behavior "Strict Subproofs".
Opaque upto.
(* 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_add : forall i i' lasts j shs (Hj : 0 <= j < Zlength lasts)
(Hi : Znth j lasts = i) (Hi' : i' <> i) (Hlen : Zlength shs >= Zlength lasts),
exists shs1 shs2, make_shares shs lasts i = shs1 ++ shs2 /\
make_shares shs (upd_Znth j lasts i') i = shs1 ++ Znth j shs :: shs2.