Section Diff.
Variable E : Setoid.
Definition diff : part_set E -> part_set E -> part_set E.
intros A B.
apply (Build_Predicate (Pred_fun:=fun x : E => in_part x A /\ ~ in_part x B)).
red in |- *.
intros x y H' H'0; try assumption.
elim H'; intros H'1 H'2; try exact H'1; clear H'.
split; [ try assumption | idtac ].
apply in_part_comp_l with x; auto with algebra.
red in |- *.
intros H'; try assumption.
absurd (in_part x B); auto with algebra.
apply in_part_comp_l with y; auto with algebra.
Defined.

Lemma diff_comp :
forall A A' B B' : part_set E,
Equal A A' -> Equal B B' -> Equal (diff A B) (diff A' B').