2014-10-09 06:44:09 +00:00
|
|
|
import algebra.category.basic
|
2014-09-14 19:01:14 +00:00
|
|
|
open category
|
|
|
|
|
|
|
|
inductive my_functor {obC obD : Type} (C : category obC) (D : category obD) : Type :=
|
2014-10-09 06:44:09 +00:00
|
|
|
mk : Π (obF : obC → obD) (homF : Π{A B : obC}, hom A B → hom (obF A) (obF B)),
|
|
|
|
(Π {A : obC}, homF (ID A) = ID (obF A)) →
|
|
|
|
(Π {A B C : obC} {f : hom A B} {g : hom B C}, homF (g ∘ f) = homF g ∘ homF f) →
|
2014-09-14 19:01:14 +00:00
|
|
|
my_functor C D
|
|
|
|
|
|
|
|
definition my_object [coercion] {obC obD : Type} {C : category obC} {D : category obD} (F : my_functor C D) : obC → obD :=
|
2014-10-09 06:44:09 +00:00
|
|
|
my_functor.rec (λ obF homF Hid Hcomp, obF) F
|
2014-09-14 19:01:14 +00:00
|
|
|
|
2014-10-09 06:44:09 +00:00
|
|
|
definition my_homphism [coercion] {obC obD : Type} {C : category obC} {D : category obD} (F : my_functor C D) :
|
|
|
|
Π{A B : obC}, hom A B → hom (my_object F A) (my_object F B) :=
|
|
|
|
my_functor.rec (λ obF homF Hid Hcomp, homF) F
|
2014-09-14 19:01:14 +00:00
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constants obC obD : Type
|
|
|
|
constants a b : obC
|
|
|
|
constant C : category obC
|
2015-01-25 04:23:21 +00:00
|
|
|
attribute C [instance]
|
2014-10-02 23:20:52 +00:00
|
|
|
constant D : category obD
|
|
|
|
constant F : my_functor C D
|
2014-10-09 06:44:09 +00:00
|
|
|
constant m : hom a b
|
2014-09-14 19:01:14 +00:00
|
|
|
check F a
|
|
|
|
check F m
|