End ENVSEC.
End Env.
Export Env.
Module EnvSA.
Existing Instance Join_env.
Existing Instance Perm_env.
Existing Instance Sep_env.
Existing Instance Sing_env.
Existing Instance Canc_env.
Existing Instance Disj_env.
Existing Instance Cross_env.

(* Specifications: *)
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.
Hint Resolve @empty_env_unit @empty_env_unit'.
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.
End EnvSA.