Ltac do_map_arg :=
match goal with |- ?a = ?b =>
  match a with context [map ?x _] =>
    match b with context [map ?y _] => replace y with x; auto end end end.Ltac inj_pair_tac :=
 match goal with H: (@existT ?U ?P ?p ?x = @existT _ _ _ ?y) |- _ =>
   generalize (@inj_pair2 U P p x y H); clear H; intro; try (subst x || subst y)
 end.

(* Specifications: *)
Lemma preds_fmap_NoneP: forall f1 f2, preds_fmap f1 f2 NoneP = NoneP.
Lemma age1_ghost_of: forall phi phi', age1 phi = Some phi' -> ghost_of phi' = ghost_fmap (approx (level phi')) (approx (level phi')) (ghost_of phi).
Lemma ghost_fmap_join: forall a b c f g, join a b c -> join (ghost_fmap f g a) (ghost_fmap f g b) (ghost_fmap f g c).
Lemma age1_ghost_of_identity: forall phi phi', age1 phi = Some phi' -> (identity (ghost_of phi) <-> identity (ghost_of phi')).
Lemma necR_ghost_of: forall phi phi', necR phi phi' -> ghost_of phi' = ghost_fmap (approx (level phi')) (approx (level phi')) (ghost_of phi).
Lemma empty_NO: forall r, identity r -> r = NO Share.bot bot_unreadable \/ exists k, exists pds, r = PURE k pds.
Lemma level_age_fash: forall m m': rmap, level m = S (level m') -> exists m1, age m m1.
Lemma level_later_fash: forall m m': rmap, (level m > level m')%nat -> exists m1, laterR m m1 /\ level m1 = level m'.