Corollary ghost_set_remove : forall {A} g a (s : Ensemble A) (Hdec : forall b, b = a \/ b <> a),
  In s a -> ghost_set g s = ghost_set g (Singleton a) * ghost_set g (Subtract s a).Definition iname := nat.Class invG := { g_inv : gname; g_en : gname; g_dis : gname }.Class invG := { g_inv : gname; g_en : gname; g_dis : gname }.Class invG := { g_inv : gname; g_en : gname; g_dis : gname }.Class invG := { g_inv : gname; g_en : gname; g_dis : gname }.Definition master_list {A} g (l : list (option A)) := ghost_master1(ORD := list_order A) l g.(* up *)
Instance Inhabitant_option {A} : Inhabitant (option A) := None.(* Our ghost state construction makes it awkward to put agree inside other ghost state constructions.
   As a workaround, instead of having one ghost location with a map from indices to agrees,
   we have a map from indices to ghost locations, each with an agree. *)

Instance token_PCM : Ghost := exclusive_PCM unit.

(* Specifications: *)
Lemma nth_singleton : forall {A} n (a : A) d, nth n (list_singleton n a) d = Some a.
Lemma list_join_singleton_inv : forall {P : Ghost} n a b l, list_join (list_singleton n a) (list_singleton n b) l -> exists c, join a b c /\ l = list_singleton n c.
Lemma singleton_join_self : forall {P: Ghost} k (a : G), join a a a -> join (list_singleton k a) (list_singleton k a) (list_singleton k a).
Lemma invariant_dup : forall i P, invariant i P = invariant i P * invariant i P.
Lemma Zlength_eq : forall {A B} (l1 : list A) (l2 : list B), Zlength l1 = Zlength l2 <-> length l1 = length l2.