(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Parts.
(** Title "Union of two parts.".*)
Section Union1.
Variable E : Setoid.
Definition union : 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; try exact H'1; clear H' | intros H'1; clear H' ].
left; try assumption.
apply in_part_comp_l with x; auto with algebra.
right; try assumption.
apply in_part_comp_l with x; auto with algebra.
Defined.

Lemma included_union_l : forall A B : part_set E, included A (union A B).
unfold included in |- *; simpl in |- *; intuition.