Set Implicit Arguments.
Unset Strict Implicit.
Set Maximal Implicit Insertion.
Section SepAlgSect.
Class SepAlgOps T:= {
sa_unit : T -> Prop;
sa_mul : T -> T -> T -> Prop
}.
Class SepAlg T `{rel : T -> T -> Prop} `{SAOps: SepAlgOps T} : Type := {
sa_type            :> Equivalence rel;
sa_mulC a b c      : sa_mul a b c -> sa_mul b a c;
sa_mulA a b c      : forall ab abc, sa_mul a b ab -> sa_mul ab c abc ->
exists bc, sa_mul b c bc /\ sa_mul a bc abc;
sa_unit_ex a       : exists e, sa_unit e /\ sa_mul a e a;
sa_unit_eq a a' e  : sa_unit e -> sa_mul a e a' -> rel a' a;
sa_unit_proper     : Proper (rel ==> iff) sa_unit;
sa_mul_mon a b c d : rel a b -> sa_mul a c d -> sa_mul b c d
}.
End SepAlgSect.
Arguments SepAlg {T} {rel} {SAOps} : rename.
Section SepAlgCompat.
Context A `{SA: SepAlg A}.
Definition compat (a b : A) := exists s, sa_mul a b s.
Definition subheap (a b : A) := exists c, sa_mul a c b.

(* Specifications: *)
Lemma sa_mul_monR (a b c d : A) (Habc : sa_mul a b c) (Hcd: rel c d) : sa_mul a b d.
Lemma sa_mulC2 a b c : sa_mul a b c <-> sa_mul b a c.
Global Instance sa_mul_proper : Proper (rel ==> rel ==> rel ==> iff) sa_mul.