Instance pa_gej : @Perm_alg _ ghost_elem_join.
Instance pa_gj : forall PRED, @Perm_alg _ (ghost_join PRED).
Instance sa_gj : forall PRED, @Sep_alg _ (ghost_join PRED).
Definition pre_rmap (A:Type) := ((address -> res A) * ghost A)%type.
Definition f_pre_rmap : functor :=
fpair (ffunc (fconst address) f_res) f_ghost.
Notation Join_obj A := (Join_prod _ (Join_fun address (res A) (res_join A)) _ (ghost_join A)).
Instance Join_pre_rmap (A: Type) : Join (pre_rmap A) :=
Join_obj A.
Definition paf_pre_rmap : @pafunctor f_pre_rmap Join_pre_rmap :=
paf_pair (paf_fun address paf_res) paf_ghost.
Definition Perm_pre_rmap (A: Type): Perm_alg (pre_rmap A) :=
Perm_prod (Perm_fun address _ _ _) (pa_gj A).
Definition Sep_pre_rmap (A: Type): Sep_alg (pre_rmap A) :=
Sep_prod (Sep_fun address _ _ _) (sa_gj A).

(* Specifications: *)
Lemma pre_rmap_core:
forall (A : Type) (m : f_pre_rmap A),
@core (f_pre_rmap A) (Join_pre_rmap A) (Sep_pre_rmap A) m =
(@core ((fpair (ffunc (fconst address) f_res) f_ghost) A)
(Join_prod ((ffunc (fconst address) f_res) A)
(Join_pi ((fconst address) A)
(fun _ : (fconst address) A => f_res A)
(fun _ : (fconst address) A => Join_res A))
(f_ghost A) (ghost_join A))
(@Sep_prod ((ffunc (fconst address) f_res) A)
(Join_pi ((fconst address) A)
(fun _ : (fconst address) A => f_res A)
(fun _ : (fconst address) A => Join_res A))
(f_ghost A) (ghost_join A)
(Sep_pi ((fconst address) A)
(fun _ : (fconst address) A => f_res A)
(fun _ : (fconst address) A => Join_res A)
(fun _ : (fconst address) A => sa_rj A))
(sa_gj A)) m).