Instance Sep_env {SA: Sep_alg A}: @Sep_alg env Join_env.
refine (mkSep Join_env (fun _ => empty_env) _ _).
repeat intro; rewrite env_get_empty; constructor.
auto.
Defined.
Instance Sing_env {SA: Sep_alg A}: @Sing_alg env Join_env Sep_env.
refine (mkSing empty_env _). reflexivity.
Defined.
Instance Canc_env {PA: Perm_alg A}{CA: Canc_alg A}: @Canc_alg env Join_env.
Instance Disj_env {PA: Perm_alg A}{DA: Disj_alg A}: @Disj_alg env Join_env.
Instance Cross_env: Cross_alg env.
Definition _env_mapsto {KE: EqDec key} (id: key) (sh: Share.t) (v: A) : pred env :=
fun rho => exists p,
forall id', env_get rho id' = if eq_dec id id' then Some (exist _ sh p,v) else None.

(* Specifications: *)
Lemma _env_mapsto_exists{KE: EqDec key}: forall id sh v, exists rho, _env_mapsto id (pshare_sh sh) v rho.
Lemma _env_get_mapsto {KE: EqDec key}:  forall (id: key) (v: A) (rho: env),
(exists sh, env_get rho id = Some (sh,v)) =
(exp (fun sh => _env_mapsto id sh v) * TT)%pred rho.
Lemma _env_get_mapsto'  {KE: EqDec key}: forall id (sh: pshare) v rho,
env_get rho id = Some(pfullshare,v) -> (_env_mapsto id (pshare_sh sh) v * TT)%pred rho.
Lemma _env_mapsto_set{KE: EqDec key}: forall id v,
_env_mapsto id Share.top v (env_set id v empty_env).
Lemma _env_mapsto_set_sh{KE: EqDec key}: forall id (sh: pshare) v,
_env_mapsto id (pshare_sh sh) v (env_set_sh id (Some (sh,v)) empty_env).
Lemma _env_mapsto_get{KE: EqDec key}: forall id sh v rho,
_env_mapsto id sh v rho
-> exists Pf: nonunit sh,
env_get rho id = Some (exist nonunit sh Pf, v).
Lemma _env_mapsto_empty_env {KE: EqDec key} : forall id v sh,
~(_env_mapsto id sh v empty_env).
Lemma _env_mapsto_get_neq {KE: EqDec key} : forall (id1 id2: key) (sh: Share.t) (v: A) rho,
id1 <> id2 -> _env_mapsto id1 sh v rho -> env_get rho id2 = None.
Lemma _env_mapsto_splittable1 {KE: EqDec key}: forall id v (sh sh1 sh2: pshare) rho,
join (proj1_sig sh1) (proj1_sig sh2) (proj1_sig sh)
-> (_env_mapsto id  (pshare_sh sh1) v * _env_mapsto id (pshare_sh sh2) v)%pred rho
-> _env_mapsto id (pshare_sh sh) v rho.
Lemma _env_mapsto_splittable2{KE: EqDec key}: forall id v (sh sh1 sh2: pshare) rho,
join (proj1_sig sh1) (proj1_sig sh2) (proj1_sig sh)
-> _env_mapsto id (pshare_sh sh) v rho
-> (_env_mapsto id (pshare_sh sh1) v * _env_mapsto id (pshare_sh sh2) v)%pred rho.
Lemma _env_mapsto_splittable {KE: EqDec key}: forall id v (sh sh1 sh2: pshare) rho,
join (proj1_sig sh1) (proj1_sig sh2) (proj1_sig sh)
-> (_env_mapsto id (pshare_sh sh) v rho
<-> (_env_mapsto id (pshare_sh sh1) v * _env_mapsto id (pshare_sh sh2)  v)%pred rho).