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.
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_simpl :
forall (A B : part_set E) (x : E),
~ in_part x A ->
~ in_part x B -> Equal (add_part A x) (add_part B x) -> Equal A B.