simpl in |- *.
unfold eq_part, add_part, minus_part, union, diff, single in |- *;
simpl in |- *.
intro.
case A; simpl in |- *.
intros a pa.
intros.
intuition.
apply H.
apply pa with x0; auto with algebra.
Qed.
Hint Resolve add_minus: algebra.
(* Cardinal. *)
Inductive cardinal : part_set E -> nat -> Prop :=
| cardinal_empty : forall A : part_set E, Equal A (empty E) -> cardinal A 0
| cardinal_add :
forall (A B : part_set E) (n : nat),
cardinal B n ->
forall x : E,
~ in_part x B -> Equal A (add_part B x) -> cardinal A (S n).
Hint Immediate cardinal_empty: algebra.

Lemma cardinal_comp :
forall (A B : part_set E) (n m : nat),
Equal A B -> n = m -> cardinal A n -> cardinal B m.