Local Open Scope kripke_model.
Module SS.
Class Relation (worlds: Type): Type :=
Krelation: worlds -> Ensemble worlds.
End SS.
Export SS.
Module Semantics.
Definition stable {worlds: Type} {R: Relation worlds} (X: Ensemble worlds): Prop := forall m n, R m n -> (X m <-> X n).
End Semantics.
Class SeparationAlgebraBisStable (worlds: Type) {J: Join worlds} {R: Relation worlds}: Type := {
split_bis_stable:
forall m n, R m n ->
(forall m1 m2, join m1 m2 m -> exists n1 n2, join n1 n2 n /\ R m1 n1 /\ R m2 n2) /\
(forall n1 n2, join n1 n2 n -> exists m1 m2, join m1 m2 m /\ R m1 n1 /\ R m2 n2);
extend_bis_stable:
forall m n, R m n ->
(forall m1 m2, join m m1 m2 -> exists n1 n2, join n n1 n2 /\ R m1 n1 /\ R m2 n2) /\
(forall n1 n2, join n n1 n2 -> exists m1 m2, join m m1 m2 /\ R m1 n1 /\ R m2 n2)
}.
Class SeparationAlgebraAbsorbStable (worlds: Type) {R1: KI.Relation worlds} {J: Join worlds} {R2: Relation worlds}: Type := {
SA_absorb_stable:
forall m m1 m2, join m1 m2 m ->
exists n1 n2, join n1 n2 m /\ R2 n1 m /\ R2 n2 m /\ m1 <= n1 /\ m2 <= n2
}.
Class StrongSeparationAlgebraAbsorbStable (worlds: Type) {J: Join worlds} {R: Relation worlds}: Type := {
strong_SA_absorb_stable:
forall m m1 m2, join m1 m2 m -> R m1 m /\ R m2 m
}.

(* Specifications: *)
Lemma DownwardsClosure_SAAbsorbStable (worlds: Type) {R1: KI.Relation worlds} {po_R: PreOrder KI.Krelation} {J: Join worlds} {R2: Relation worlds} {SA_abs': StrongSeparationAlgebraAbsorbStable worlds}: @SeparationAlgebraAbsorbStable worlds R1 DownwardsClosure_J R2.
Instance prod_SAbis (A B: Type) (JA: Join A) (JB: Join B) (RA: SS.Relation A) (RB: SS.Relation B) {SAbisA: SeparationAlgebraBisStable A} {SAbisB: SeparationAlgebraBisStable B}: @SeparationAlgebraBisStable (A * B) (@prod_Join _ _ JA JB) (RelProd RA RB).