Section fparts_in_def.
Variable E : Setoid.
(* Add_part. *)
Definition add_part (A : part_set E) (x : E) := union A (single x).
unfold add_part in |- *; auto with algebra.
Qed.
Hint Resolve add_part_comp: algebra.
simpl in |- *; auto with algebra.
Qed.
Hint Resolve add_part_in: algebra.
unfold add_part in |- *.
intros.
apply Trans with (union A (union (single x) (single y))); auto with algebra.
apply Trans with (union A (union (single y) (single x))); auto with algebra.
Qed.
Hint Immediate add_part_com: algebra.
intro A.
case A.
simpl in |- *; unfold pred_compatible, eq_part, in_part in |- *;
simpl in |- *.
intuition eauto.
Qed.
Hint Resolve add_in: algebra.
simpl in |- *.
unfold eq_part, add_part, union, single in |- *; simpl in |- *.
intro.
case A; simpl in |- *.
intros a pa.
intuition.
Qed.

Lemma add_part_in_el_not_in :
forall (A : part_set E) (x y : E),
in_part y (add_part A x) -> ~ in_part y A -> Equal y x.