Instance Perm_env {PA: Perm_alg A}: @Perm_alg env Join_env.Instance Sep_env {SA: Sep_alg A}: @Sep_alg env Join_env.Instance Sing_env {SA: Sep_alg A}: @Sing_alg env Join_env Sep_env.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).
Lemma empty_env_unit {key: Type}{A: Type}: forall rho: env key A, unit_for empty_env rho.
Lemma empty_env_unit' {key: Type}{A: Type}: forall rho: env key A, join empty_env rho rho.
Lemma env_join_sub1 {key: Type}{A: Type}: forall rho1 rho2: env key A, (forall id x, env_get rho1 id = Some x -> env_get rho2 id = Some x) -> join_sub rho1 rho2.
Lemma env_get_join_sub {key: Type}{A: Type}: forall (rho rho': env key A) id sh v, join_sub rho rho' -> env_get rho id = Some (sh,v) -> exists sh', env_get rho' id = Some (sh', v) /\ join_sub (pshare_sh sh) (pshare_sh sh').
Lemma env_at_joins {key: Type}{A: Type}{KE: EqDec key}: forall rho1 rho2: env key A, (forall id, @joins _ (@Join_lower (pshare * A) (Join_prod pshare Join_pshare A (Join_equiv _))) (env_get rho1 id) (env_get rho2 id)) -> joins rho1 rho2.
Lemma env_at_join_sub {key: Type}{A: Type}{KE: EqDec key}: forall rho1 rho2, (forall id: key, @join_sub _ (@Join_lower (pshare * A) (Join_prod pshare Join_pshare A (Join_equiv _))) (env_get rho1 id) (env_get rho2 id)) -> join_sub rho1 rho2.
Lemma identity_empty_env {key: Type}{A: Type}{KE: EqDec key}: forall rho: env key A, identity rho <-> rho = empty_env.