-definition REL: category.
- constructor 1;
- [ apply (ΣA:Type.Ω \sup A)
- | intros; apply (binary_relation_setoid ?? (s_proof ?? s) (s_proof ?? s1))
- | intros; constructor 1; intros; apply (s=s1)
- | 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;
- [ rewrite > H | rewrite < H2 ]
- assumption
- |*: exists; try assumption; split; first [ reflexivity | assumption ]]]
-qed.
\ No newline at end of file
+definition foo : ∀o1,o2:REL.carr1 (o1 ⇒_\r1 o2) → carr2 (setoid2_of_setoid1 (o1 ⇒_\r1 o2)) ≝ λo1,o2,x.x.
+
+interpretation "relation f⎻*" 'OR_f_minus_star r = (fun12 ?? (minus_star_image ? ?) (foo ?? r)).
+interpretation "relation f⎻" 'OR_f_minus r = (fun12 ?? (minus_image ? ?) (foo ?? r)).
+interpretation "relation f*" 'OR_f_star r = (fun12 ?? (star_image ? ?) (foo ?? r)).
+
+definition image_coercion: ∀U,V:REL. (U ⇒_\r1 V) → Ω^U ⇒_2 Ω^V.
+intros (U V r Us); apply (image U V r); qed.
+coercion image_coercion.
+
+(* minus_image is the same as ext *)
+
+theorem image_id: ∀o. (id1 REL o : carr2 (Ω^o ⇒_2 Ω^o)) =_1 (id2 SET1 Ω^o).
+ intros; unfold image_coercion; unfold image; simplify;
+ whd in match (?:carr2 ?);
+ intro U; simplify; split; simplify; intros;
+ [ change with (a ∈ U);
+ cases e; cases x; change in e1 with (w =_1 a); apply (. e1^-1‡#); assumption
+ | change in f with (a ∈ U);
+ exists; [apply a] split; [ change with (a = a); apply refl1 | assumption]]
+qed.
+
+theorem minus_star_image_id: ∀o:REL.
+ ((id1 REL o)⎻* : carr2 (Ω^o ⇒_2 Ω^o)) =_1 (id2 SET1 Ω^o).
+ intros; unfold minus_star_image; simplify; intro U; simplify;
+ split; simplify; intros;
+ [ change with (a ∈ U); apply f; change with (a=a); apply refl1
+ | change in f1 with (eq1 ? x a); apply (. f1‡#); apply f]
+qed.
+
+alias symbol "compose" (instance 5) = "category2 composition".
+alias symbol "compose" (instance 4) = "category1 composition".
+theorem image_comp: ∀A,B,C.∀r:B ⇒_\r1 C.∀s:A ⇒_\r1 B.
+ ((r ∘ s) : carr2 (Ω^A ⇒_2 Ω^C)) =_1 r ∘ s.
+ intros; intro U; split; intro x; (unfold image; unfold SET1; simplify);
+ intro H; cases H;
+ cases x1; [cases f|cases f1]; exists; [1,3: apply w1] cases x2; split; try assumption;
+ exists; try assumption; split; assumption;
+qed.
+
+theorem minus_star_image_comp:
+ ∀A,B,C.∀r:B ⇒_\r1 C.∀s:A ⇒_\r1 B.
+ minus_star_image A C (r ∘ s) =_1 minus_star_image B C r ∘ (minus_star_image A B s).
+ intros; unfold minus_star_image; intro X; simplify; split; simplify; intros;
+ [ whd; intros; simplify; whd; intros; apply f; exists; try assumption; split; assumption;
+ | cases f1; cases x1; apply f; 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.
+*)
+
+axiom daemon : False.
+
+theorem extS_singleton:
+ ∀o1,o2.∀a.∀x.extS o1 o2 a {(x)} = ext o1 o2 a x.
+ intros; unfold extS; unfold ext; unfold singleton; simplify;
+ split; intros 2; simplify; simplify in f;
+ [ cases f; cases e; cases x1; change in f2 with (x =_1 w); apply (. #‡f2); assumption;
+ | split; try apply I; exists [apply x] split; try assumption; change with (x = x); apply rule #;] qed.
\ No newline at end of file