2014-09-16 18:58:54 +00:00
|
|
|
import algebra.category
|
2014-09-14 19:01:14 +00:00
|
|
|
open category
|
|
|
|
|
|
|
|
inductive my_functor {obC obD : Type} (C : category obC) (D : category obD) : Type :=
|
|
|
|
mk : Π (obF : obC → obD) (morF : Π{A B : obC}, mor A B → mor (obF A) (obF B)),
|
|
|
|
(Π {A : obC}, morF (ID A) = ID (obF A)) →
|
|
|
|
(Π {A B C : obC} {f : mor A B} {g : mor B C}, morF (g ∘ f) = morF g ∘ morF f) →
|
|
|
|
my_functor C D
|
|
|
|
|
|
|
|
definition my_object [coercion] {obC obD : Type} {C : category obC} {D : category obD} (F : my_functor C D) : obC → obD :=
|
|
|
|
my_functor.rec (λ obF morF Hid Hcomp, obF) F
|
|
|
|
|
|
|
|
definition my_morphism [coercion] {obC obD : Type} {C : category obC} {D : category obD} (F : my_functor C D) :
|
|
|
|
Π{A B : obC}, mor A B → mor (my_object F A) (my_object F B) :=
|
|
|
|
my_functor.rec (λ obF morF Hid Hcomp, morF) F
|
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constants obC obD : Type
|
|
|
|
constants a b : obC
|
|
|
|
constant C : category obC
|
2014-09-14 19:01:14 +00:00
|
|
|
instance C
|
2014-10-02 23:20:52 +00:00
|
|
|
constant D : category obD
|
|
|
|
constant F : my_functor C D
|
|
|
|
constant m : mor a b
|
2014-09-14 19:01:14 +00:00
|
|
|
check F a
|
|
|
|
check F m
|