Require Export Ensembles.
Require Export EnsemblesSpec.
Definition inverse_image {X Y:Type} (f:X->Y) (T:Ensemble Y) : Ensemble X :=
[ x:X | In T (f x) ].
Hint Unfold inverse_image : sets.

(* Specifications: *)
Lemma inverse_image_increasing: forall {X Y:Type} (f:X->Y)
(T1 T2:Ensemble Y), Included T1 T2 ->
Included (inverse_image f T1) (inverse_image f T2).
Lemma inverse_image_empty: forall {X Y:Type} (f:X->Y),
inverse_image f Empty_set = Empty_set.
Lemma inverse_image_full: forall {X Y:Type} (f:X->Y),
inverse_image f Full_set = Full_set.
Lemma inverse_image_intersection: forall {X Y:Type} (f:X->Y)
(T1 T2:Ensemble Y), inverse_image f (Intersection T1 T2) =
Intersection (inverse_image f T1) (inverse_image f T2).
Lemma inverse_image_union: forall {X Y:Type} (f:X->Y)
(T1 T2:Ensemble Y), inverse_image f (Union T1 T2) =
Union (inverse_image f T1) (inverse_image f T2).
Lemma inverse_image_complement: forall {X Y:Type} (f:X->Y)
(T:Ensemble Y), inverse_image f (Complement T) =
Complement (inverse_image f T).
Lemma inverse_image_composition: forall {X Y Z:Type} (f:Y->Z) (g:X->Y)
(U:Ensemble Z), inverse_image (fun x:X => f (g x)) U =
inverse_image g (inverse_image f U).