2014-09-06 02:02:18 +00:00
|
|
|
import logic
|
|
|
|
|
|
|
|
inductive category (ob : Type) (mor : ob → ob → Type) : Type :=
|
|
|
|
mk : Π (comp : Π⦃A B C : ob⦄, mor B C → mor A B → mor A C)
|
|
|
|
(id : Π {A : ob}, mor A A),
|
|
|
|
(Π {A B C D : ob} {f : mor A B} {g : mor B C} {h : mor C D},
|
|
|
|
comp h (comp g f) = comp (comp h g) f) →
|
|
|
|
(Π {A B : ob} {f : mor A B}, comp f id = f) →
|
|
|
|
(Π {A B : ob} {f : mor A B}, comp id f = f) →
|
|
|
|
category ob mor
|
2015-01-25 04:23:21 +00:00
|
|
|
attribute category [class]
|
2014-09-06 02:02:18 +00:00
|
|
|
|
|
|
|
namespace category
|
2015-04-22 02:46:57 +00:00
|
|
|
section sec_cat
|
2014-09-06 02:02:18 +00:00
|
|
|
parameter A : Type
|
|
|
|
inductive foo :=
|
|
|
|
mk : A → foo
|
|
|
|
|
2015-01-25 04:23:21 +00:00
|
|
|
attribute foo [class]
|
2014-09-06 02:02:18 +00:00
|
|
|
parameters {ob : Type} {mor : ob → ob → Type} {Cat : category ob mor}
|
2015-02-11 20:49:27 +00:00
|
|
|
definition compose := category.rec (λ comp id assoc idr idl, comp) Cat
|
|
|
|
definition id := category.rec (λ comp id assoc idr idl, id) Cat
|
2015-04-22 02:46:57 +00:00
|
|
|
local infixr ∘ := compose
|
2014-09-06 02:02:18 +00:00
|
|
|
inductive is_section {A B : ob} (f : mor A B) : Type :=
|
|
|
|
mk : ∀g, g ∘ f = id → is_section f
|
|
|
|
end sec_cat
|
|
|
|
end category
|