(* * Copyright (c) 2009-2011, Andrew Appel, Robert Dockins and Aquinas Hobor. * *)
(** This module defines the standard operators on separation algebras, including the operators over pairs, disjoint sums, function spaces, dependent products, dependent sums, sub-separation algebras, the discrete separation algebra, the trivial unit and void separation algrbras. *)
(** The trivial separation algebra over the unit type.  This SA is the identity of the product SA operator, up to isomorphism. *)
Instance Join_unit : Join unit := fun x y z => True.
Instance Perm_unit : Perm_alg unit.
Instance Sep_unit: Sep_alg unit.
Instance Canc_unit: Canc_alg unit.
Instance Canc_void: Canc_alg Void.
Instance Sep_bool: Sep_alg bool.
Section JOIN_EQUIV.
(** The "equivalance" or discrete SA.  In this SA, every element of an arbitrary set is made an idempotent element.  We do not add this as a global Instance, because it is too widely applicable in cases where we do not desire it. *)
Instance Join_equiv (A: Type) : Join A := fun x y z => x=y/\y=z.
Instance Perm_equiv (A: Type) :  @Perm_alg A (Join_equiv A).
Instance Sep_equiv (A: Type): Sep_alg A.

(* Specifications: *)
Lemma join_equiv_refl: forall A (v: A), @join A (Join_equiv A) v v v.
Instance Sep_prop (SA: Sep_alg A)(HPcore : forall x, P x -> P (core x)): Sep_alg (sig P).