Local Open Scope kripke_model.
Definition increasing
{worlds: Type}
{R: Relation worlds}
{J: Join worlds}: worlds -> Prop :=
fun m => forall n n', join m n n' -> n <= n'.
Definition increasing'
{worlds: Type}
{R: Relation worlds}
{J: Join worlds}: worlds -> Prop :=
fun m => forall n, m <= n -> increasing n.
Class IncreasingSeparationAlgebra
(worlds: Type)
{R: Relation worlds}
{J: Join worlds }: Type :=
{
all_increasing: forall x: worlds, increasing x
}.
(* (* -Legacy definition-            * * Garbage Collected algebra      * * Is equivalent to increasing *)
Class GarbageCollectSeparationAlgebra(worlds: Type) {kiM: KripkeIntuitionisticModel worlds} {J: Join worlds }: Type :=
{
join_has_order1: forall (m1 m2 m: worlds), join m1 m2 m -> m1 <= m
}.
*)
Definition residue
{worlds: Type}
{R: Relation worlds}
{J: Join worlds}
(m n: worlds): Prop :=
exists n', join n n' m /\ m <= n'.
Class ResidualSeparationAlgebra
(worlds: Type)
{R: Relation worlds}
{J: Join worlds}: Type :=
{
residue_exists: forall n: worlds, exists m, residue n m;
}.
Class UnitalSeparationAlgebra
(worlds: Type)
{R: Relation worlds}
{J: Join worlds}: Type :=
{
incr_exists: forall n: worlds, exists m, residue n m /\ increasing m
}.
Class UnitalSeparationAlgebra'
(worlds: Type)
{R: Relation worlds}
{J: Join worlds}: Type :=
{
incr'_exists: forall n: worlds, exists m, residue n m /\ increasing' m
}.

(*A increasing separation algebras is unital * iff it is residual.*)
Lemma incr_unital_iff_residual
{worlds: Type}
{R: Relation worlds}
{po_R: PreOrder Krelation}
{J: Join worlds}:
IncreasingSeparationAlgebra worlds ->
UnitalSeparationAlgebra worlds <->
ResidualSeparationAlgebra worlds.