(* * Copyright (c) 2009-2011, Andrew Appel, Robert Dockins and Aquinas Hobor. * *)
(** The cross split axiom looks unwieldly, but here we show that it arises naturally as a kind of distributivity property. Cross split can be rendered, with some accuracy, as "the separation algebra is distributive." *)
(** This definition mirrors the definition of distributivity in a join-semilattice.  This definition generalizes the standard notion of distributivity in a lattice, but only mentions of the lattice operators.  Here we transplant the semilattice definition into the setting of separation algebras. *)
Definition sa_distributive (A: Type) {JOIN: Join A} :=
forall a b x z,
join a b z ->
constructive_join_sub x z ->
{a' : A & {b' : A &
(constructive_join_sub a' a * constructive_join_sub b' b * join a' b' x)%type}}.
(* (** We define this weaker version of cross-split in order to show that the sa_distributive axiom is equivalent. The ordinary cross_split is more constructive (it uses a sigma type rather than 'exists'), so we have to weaken it to show the correspondence.  We could, instead, define and use a constructive version of join_sub. *)
Definition weak_cross_split `{sepalg A} :=
forall a b c d z : A,
join a b z ->
join c d z ->
exists x:(A*A*A*A), match x with (ac,ad,bc,bd) =>
join ac ad a /\
join bc bd b /\
join ac bc c /\
join ad bd d
end.
*)

Theorem distributive_cross_split {A} `{Perm_alg A}{SA: Sep_alg A}{CA: Canc_alg A}:
sa_distributive A -> Cross_alg A.