From mathcomp.ssreflect
From mathcomp
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
(* Framing with respect to the world *)
Module Injection.
Section Injection.
Variable W : world.
Structure injects (U V : world) := Inject {
E : world;
_ : V = U \+ E;
(* These all should be easy to prove given a standard world disentanglement *)
_ : forall s, Coh V s <-> exists s1 s2,
[/\ s = s1 \+ s2, Coh U s1 & Coh E s2];
_ : forall s1 s2 s this,
s1 \+ s \In Coh V -> s2 \+ s \In Coh V ->
network_step U this s1 s2 -> network_step V this (s1 \+ s) (s2 \+ s);
_ : forall s1 s2 s1' s2' this,
s1 \In Coh U -> s2 \In Coh U ->
network_step V this (s1 \+ s1') (s2 \+ s2') ->
(network_step U this s1 s2   /\ s1' = s2') \/
(network_step E this s1' s2' /\ s1 = s2); }.
End Injection.
Module Exports.
Section Exports.
Definition inj_ext := E.
Definition injects := injects.
Definition Inject := Inject.
Variables (U V : world).

(* Specifications: *)
Lemma cohK (w : injects U V) : V = U \+ inj_ext w.
Lemma sem_split (w : injects U V) s1 s1' s2 s2' this:
s1 \In Coh U -> s2 \In Coh U ->
network_step V this (s1 \+ s1') (s2 \+ s2') ->
(network_step U this s1 s2   /\ s1' = s2') \/
(network_step (inj_ext w) this s1' s2' /\ s1 = s2).
Lemma projectS_cohR W1 W2 s :
s \In Coh (W1 \+ W2) -> projectS W2 s \In Coh W2.
Lemma coh_split W1 W2 s :
s \In Coh (W1 \+ W2) ->
exists s1 s2 : state,
[/\ s1 \In Coh W1, s2 \In Coh W2 & s = s1 \+ s2].
Lemma injExtL (W1 W2 : world) (pf : injects W1 (W1 \+ W2)) :
valid (W1 \+ W2) -> inj_ext pf = W2.
Lemma injExtR (W1 W2 : world) (pf : injects W2 (W1 \+ W2)) :
valid (W1 \+ W2) -> inj_ext pf = W1.