-definition REL: category.
- constructor 1;
- [ apply Type
- | intros; apply (binary_relation_setoid T T1)
- | intros; constructor 1; intros; apply (eq ? o1 o2);
- | intros; constructor 1;
- [ apply composition
- | apply composition_morphism
- ]
- | intros; unfold mk_binary_morphism; simplify;
- apply associative_composition
- |6,7: intros 5; simplify; split; intro;
- [1,3: cases H; clear H; cases H1; clear H1;
- [ alias id "eq_elim_r''" = "cic:/matita/logic/equality/eq_elim_r''.con".
- apply (eq_elim_r'' ? w ?? x H); assumption
- | alias id "eq_rect" = "cic:/matita/logic/equality/eq_rect.con".
- apply (eq_rect ? w ?? y H2); assumption ]
- assumption
- |*: exists; try assumption; split;
- alias id "refl_eq" = "cic:/matita/logic/equality/eq.ind#xpointer(1/1/1)".
- first [ apply refl_eq | assumption ]]]
-qed.
-
-definition full_subset: ∀s:REL. Ω \sup s ≝ λs.{x | True}.
-
-coercion full_subset.
\ No newline at end of file
+(* the same as ⋄ for a basic pair *)
+definition image: ∀U,V:REL. binary_morphism1 (arrows1 ? U V) (Ω \sup U) (Ω \sup V).
+ intros; constructor 1;
+ [ apply (λr: arrows1 ? U V.λS: Ω \sup U. {y | ∃x:U. x ♮r y ∧ x ∈ S});
+ intros; simplify; split; intro; cases H1; exists [1,3: apply w]
+ [ apply (. (#‡H)‡#); assumption
+ | apply (. (#‡H \sup -1)‡#); assumption]
+ | intros; split; simplify; intros; cases H2; exists [1,3: apply w]
+ [ apply (. #‡(#‡H1)); cases x; split; try assumption;
+ apply (if ?? (H ??)); assumption
+ | apply (. #‡(#‡H1 \sup -1)); cases x; split; try assumption;
+ apply (if ?? (H \sup -1 ??)); assumption]]
+qed.
+
+(* the same as □ for a basic pair *)
+definition minus_star_image: ∀U,V:REL. binary_morphism1 (arrows1 ? U V) (Ω \sup U) (Ω \sup V).
+ intros; constructor 1;
+ [ apply (λr: arrows1 ? U V.λS: Ω \sup U. {y | ∀x:U. x ♮r y → x ∈ S});
+ intros; simplify; split; intros; apply H1;
+ [ apply (. #‡H \sup -1); assumption
+ | apply (. #‡H); assumption]
+ | intros; split; simplify; intros; [ apply (. #‡H1); | apply (. #‡H1 \sup -1)]
+ apply H2; [ apply (if ?? (H \sup -1 ??)); | apply (if ?? (H ??)) ] assumption]
+qed.
+
+(* minus_image is the same as ext *)
+
+theorem image_id: ∀o,U. image o o (id1 REL o) U = U.
+ intros; unfold image; simplify; split; simplify; intros;
+ [ change with (a ∈ U);
+ cases H; cases x; change in f with (eq1 ? w a); apply (. f‡#); assumption
+ | change in f with (a ∈ U);
+ exists; [apply a] split; [ change with (a = a); apply refl | assumption]]
+qed.
+
+theorem minus_star_image_id: ∀o,U. minus_star_image o o (id1 REL o) U = U.
+ intros; unfold minus_star_image; simplify; split; simplify; intros;
+ [ change with (a ∈ U); apply H; change with (a=a); apply refl
+ | change in f1 with (eq1 ? x a); apply (. f1 \sup -1‡#); apply f]
+qed.
+
+theorem image_comp: ∀A,B,C,r,s,X. image A C (r ∘ s) X = image B C r (image A B s X).
+ intros; unfold image; simplify; split; simplify; intros; cases H; clear H; cases x;
+ clear x; [ cases f; clear f; | cases f1; clear f1 ]
+ exists; try assumption; cases x; clear x; split; try assumption;
+ exists; try assumption; split; assumption.
+qed.
+
+theorem minus_star_image_comp:
+ ∀A,B,C,r,s,X.
+ minus_star_image A C (r ∘ s) X = minus_star_image B C r (minus_star_image A B s X).
+ intros; unfold minus_star_image; simplify; split; simplify; intros; whd; intros;
+ [ apply H; exists; try assumption; split; assumption
+ | change with (x ∈ X); cases f; cases x1; apply H; assumption]
+qed.
+
+(*CSC: unused! *)
+theorem ext_comp:
+ ∀o1,o2,o3: REL.
+ ∀a: arrows1 ? o1 o2.
+ ∀b: arrows1 ? o2 o3.
+ ∀x. ext ?? (b∘a) x = extS ?? a (ext ?? b x).
+ intros;
+ unfold ext; unfold extS; simplify; split; intro; simplify; intros;
+ cases f; clear f; split; try assumption;
+ [ cases f2; clear f2; cases x1; clear x1; exists; [apply w] split;
+ [1: split] assumption;
+ | cases H; clear H; cases x1; clear x1; exists [apply w]; split;
+ [2: cases f] assumption]
+qed.
+
+theorem extS_singleton:
+ ∀o1,o2.∀a:arrows1 ? o1 o2.∀x.extS o1 o2 a (singleton o2 x) = ext o1 o2 a x.
+ intros; unfold extS; unfold ext; unfold singleton; simplify;
+ split; intros 2; simplify; cases f; split; try assumption;
+ [ cases H; cases x1; change in f2 with (eq1 ? x w); apply (. #‡f2 \sup -1);
+ assumption
+ | exists; try assumption; split; try assumption; change with (x = x); apply refl]
+qed.
\ No newline at end of file