Definition juicy_mem_core (j: juicy_mem) : rmap := core (m_phi j).
(*Lemma inflate_initial_mem_empty: forall lev, emp (inflate_initial_mem Mem.empty lev). intro lev. unfold inflate_initial_mem. destruct (make_rmap (inflate_initial_mem' Mem.empty lev) (core (ghost_of lev)) (inflate_initial_mem'_valid Mem.empty lev) (level lev) (inflate_initial_mem'_fmap Mem.empty lev)); simpl. { rewrite core_ghost_of, <- level_core; apply ghost_of_approx. } destruct a. apply resource_at_empty2. intro l; rewrite H0. unfold inflate_initial_mem'. destruct l. unfold access_at; unfold empty at 1. simpl. rewrite PMap.gi. destruct (max_access_at empty (b,z)); try destruct p; try apply NO_identity. Qed. Local Hint Resolve inflate_initial_mem_empty.*)
(* fancy initial mem *)
(* TODO: move this somewhere more appropriate *)
Definition no_VALs (phi: rmap) := forall loc,
match phi @ loc with
| YES _ _ (VAL _) _ => False | _ => True
end.

(* Specifications: *)
Lemma components_join_joins {A} {JA: Join A}{PA: Perm_alg A}{TA: Trip_alg A}: forall a b c d,
join a b c -> joins a d -> joins b d -> joins c d.