annotate cat-utility.agda @ 312:702adc45704f

is this right direction?
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 05 Jan 2014 23:37:12 +0900
parents d6a6dd305da2
children c483374f542b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 module cat-utility where
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp>
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
5 open import Category -- https://github.com/konn/category-agda
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
6 open import Level
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
7 --open import Category.HomReasoning
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
8 open import HomReasoning
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
10 open Functor
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
12 id1 : ∀{c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (a : Obj A ) → Hom A a a
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
13 id1 A a = (Id {_} {_} {_} {A} a)
253
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 202
diff changeset
14 -- We cannot make A implicit
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
16 record IsUniversalMapping {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
17 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
18 ( F : Obj A → Obj B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
19 ( η : (a : Obj A) → Hom A a ( FObj U (F a) ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
20 ( _* : { a : Obj A}{ b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
21 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
22 field
101
0f7086b6a1a6 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
23 universalMapping : {a : Obj A} { b : Obj B } → { f : Hom A a (FObj U b) } →
0f7086b6a1a6 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
24 A [ A [ FMap U ( f * ) o η a ] ≈ f ]
0f7086b6a1a6 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
25 uniquness : {a : Obj A} { b : Obj B } → { f : Hom A a (FObj U b) } → { g : Hom B (F a) b } →
0f7086b6a1a6 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 94
diff changeset
26 A [ A [ FMap U g o η a ] ≈ f ] → B [ f * ≈ g ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
28 record UniversalMapping {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
29 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
30 ( F : Obj A → Obj B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
31 ( η : (a : Obj A) → Hom A a ( FObj U (F a) ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
32 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
33 infixr 11 _*
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
34 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
35 _* : { a : Obj A}{ b : Obj B} → ( Hom A a (FObj U b) ) → Hom B (F a ) b
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
36 isUniversalMapping : IsUniversalMapping A B U F η _*
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
268
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
38 record coIsUniversalMapping {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
39 ( F : Functor A B )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
40 ( U : Obj B → Obj A )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
41 ( ε : (b : Obj B) → Hom B ( FObj F (U b) ) b )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
42 ( _*' : { b : Obj B}{ a : Obj A} → ( Hom B (FObj F a) b ) → Hom A a (U b ) )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
43 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
44 field
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
45 couniversalMapping : {b : Obj B} { a : Obj A } → { f : Hom B (FObj F a) b } →
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
46 B [ B [ ε b o FMap F ( f *' ) ] ≈ f ]
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
47 couniquness : {b : Obj B} { a : Obj A } → { f : Hom B (FObj F a) b } → { g : Hom A a (U b) } →
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
48 B [ B [ ε b o FMap F g ] ≈ f ] → A [ f *' ≈ g ]
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
49
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
50 record coUniversalMapping {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
51 ( F : Functor A B )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
52 ( U : Obj B → Obj A )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
53 ( ε : (b : Obj B) → Hom B ( FObj F (U b) ) b )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
54 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
55 infixr 11 _*'
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
56 field
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
57 _*' : { b : Obj B}{ a : Obj A} → ( Hom B (FObj F a) b ) → Hom A a (U b )
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
58 iscoUniversalMapping : coIsUniversalMapping A B F U ε _*'
2ff44ee3cb32 co universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 265
diff changeset
59
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
60 open NTrans
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
61 open import Category.Cat
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
62 record IsAdjunction {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
63 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
64 ( F : Functor A B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
65 ( η : NTrans A A identityFunctor ( U ○ F ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
66 ( ε : NTrans B B ( F ○ U ) identityFunctor )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
67 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
68 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
69 adjoint1 : { b : Obj B } →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
70 A [ A [ ( FMap U ( TMap ε b )) o ( TMap η ( FObj U b )) ] ≈ id1 A (FObj U b) ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
71 adjoint2 : {a : Obj A} →
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
72 B [ B [ ( TMap ε ( FObj F a )) o ( FMap F ( TMap η a )) ] ≈ id1 B (FObj F a) ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
74 record Adjunction {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) (B : Category c₁' c₂' ℓ')
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
75 ( U : Functor B A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
76 ( F : Functor A B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
77 ( η : NTrans A A identityFunctor ( U ○ F ) )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
78 ( ε : NTrans B B ( F ○ U ) identityFunctor )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
79 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
80 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
81 isAdjunction : IsAdjunction A B U F η ε
202
58ee98bbb333 remove an extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 176
diff changeset
82 U-functor = U
58ee98bbb333 remove an extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 176
diff changeset
83 F-functor = F
58ee98bbb333 remove an extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 176
diff changeset
84 Eta = η
58ee98bbb333 remove an extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 176
diff changeset
85 Epsiron = ε
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
88 record IsMonad {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
89 ( T : Functor A A )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
90 ( η : NTrans A A identityFunctor T )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
91 ( μ : NTrans A A (T ○ T) T)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
92 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
93 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
94 assoc : {a : Obj A} → A [ A [ TMap μ a o TMap μ ( FObj T a ) ] ≈ A [ TMap μ a o FMap T (TMap μ a) ] ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
95 unity1 : {a : Obj A} → A [ A [ TMap μ a o TMap η ( FObj T a ) ] ≈ Id {_} {_} {_} {A} (FObj T a) ]
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
96 unity2 : {a : Obj A} → A [ A [ TMap μ a o (FMap T (TMap η a ))] ≈ Id {_} {_} {_} {A} (FObj T a) ]
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
98 record Monad {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (T : Functor A A) (η : NTrans A A identityFunctor T) (μ : NTrans A A (T ○ T) T)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
99 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
100 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
101 isMonad : IsMonad A T η μ
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
102 -- g ○ f = μ(c) T(g) f
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
103 join : { a b : Obj A } → { c : Obj A } →
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
104 ( Hom A b ( FObj T c )) → ( Hom A a ( FObj T b)) → Hom A a ( FObj T c )
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
105 join {_} {_} {c} g f = A [ TMap μ c o A [ FMap T g o f ] ]
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
106
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
108 Functor*Nat : {c₁ c₂ ℓ c₁' c₂' ℓ' c₁'' c₂'' ℓ'' : Level} (A : Category c₁ c₂ ℓ) {B : Category c₁' c₂' ℓ'} (C : Category c₁'' c₂'' ℓ'')
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
109 (F : Functor B C) → { G H : Functor A B } → ( n : NTrans A B G H ) → NTrans A C (F ○ G) (F ○ H)
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
110 Functor*Nat A {B} C F {G} {H} n = record {
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
111 TMap = λ a → FMap F (TMap n a)
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
112 ; isNTrans = record {
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
113 commute = commute
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
114 }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
115 } where
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
116 commute : {a b : Obj A} {f : Hom A a b}
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
117 → C [ C [ (FMap F ( FMap H f )) o ( FMap F (TMap n a)) ] ≈ C [ (FMap F (TMap n b )) o (FMap F (FMap G f)) ] ]
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
118 commute {a} {b} {f} = let open ≈-Reasoning (C) in
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
119 begin
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
120 (FMap F ( FMap H f )) o ( FMap F (TMap n a))
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
121 ≈⟨ sym (distr F) ⟩
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
122 FMap F ( B [ (FMap H f) o TMap n a ])
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
123 ≈⟨ IsFunctor.≈-cong (isFunctor F) ( nat n ) ⟩
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
124 FMap F ( B [ (TMap n b ) o FMap G f ] )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
125 ≈⟨ distr F ⟩
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
126 (FMap F (TMap n b )) o (FMap F (FMap G f))
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
127
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
129 Nat*Functor : {c₁ c₂ ℓ c₁' c₂' ℓ' c₁'' c₂'' ℓ'' : Level} (A : Category c₁ c₂ ℓ) {B : Category c₁' c₂' ℓ'} (C : Category c₁'' c₂'' ℓ'')
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
130 { G H : Functor B C } → ( n : NTrans B C G H ) → (F : Functor A B) → NTrans A C (G ○ F) (H ○ F)
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
131 Nat*Functor A {B} C {G} {H} n F = record {
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
132 TMap = λ a → TMap n (FObj F a)
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
133 ; isNTrans = record {
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
134 commute = commute
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
135 }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
136 } where
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
137 commute : {a b : Obj A} {f : Hom A a b}
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
138 → C [ C [ ( FMap H (FMap F f )) o ( TMap n (FObj F a)) ] ≈ C [ (TMap n (FObj F b )) o (FMap G (FMap F f)) ] ]
130
5f331dfc000b remove Kleisli record
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 101
diff changeset
139 commute {a} {b} {f} = IsNTrans.commute ( isNTrans n)
56
83ff8d48fdca add unitility
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
141 -- T ≃ (U_R ○ F_R)
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
142 -- μ = U_R ε F_R
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
143 -- nat-ε
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
144 -- nat-η -- same as η but has different types
84
ee25f96ee8cc record Resolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 80
diff changeset
145
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
146 record MResolution {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} (A : Category c₁ c₂ ℓ) ( B : Category c₁' c₂' ℓ' )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
147 ( T : Functor A A )
94
4fa718e4fd77 Comparison Functor constructed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
148 -- { η : NTrans A A identityFunctor T }
4fa718e4fd77 Comparison Functor constructed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
149 -- { μ : NTrans A A (T ○ T) T }
4fa718e4fd77 Comparison Functor constructed
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 91
diff changeset
150 -- { M : Monad A T η μ }
87
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
151 ( UR : Functor B A ) ( FR : Functor A B )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
152 { ηR : NTrans A A identityFunctor ( UR ○ FR ) }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
153 { εR : NTrans B B ( FR ○ UR ) identityFunctor }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
154 { μR : NTrans A A ( (UR ○ FR) ○ ( UR ○ FR )) ( UR ○ FR ) }
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
155 ( Adj : Adjunction A B UR FR ηR εR )
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
156 : Set (suc (c₁ ⊔ c₂ ⊔ ℓ ⊔ c₁' ⊔ c₂' ⊔ ℓ' )) where
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
157 field
4690953794c4 MEsolution
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 86
diff changeset
158 T=UF : T ≃ (UR ○ FR)
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
159 μ=UεF : {x : Obj A } → A [ TMap μR x ≈ FMap UR ( TMap εR ( FObj FR x ) ) ]
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
160 -- ηR=η : {x : Obj A } → A [ TMap ηR x ≈ TMap η x ] -- We need T → UR FR conversion
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
161 -- μR=μ : {x : Obj A } → A [ TMap μR x ≈ TMap μ x ]
86
be4e3b073e0d resosultion
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 84
diff changeset
162
88
419923b149ca on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 87
diff changeset
163
260
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
164 record Equalizer { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) {c a b : Obj A} (e : Hom A c a) (f g : Hom A a b) : Set (ℓ ⊔ (c₁ ⊔ c₂)) where
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
165 field
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
166 fe=ge : A [ A [ f o e ] ≈ A [ g o e ] ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
167 k : {d : Obj A} (h : Hom A d a) → A [ A [ f o h ] ≈ A [ g o h ] ] → Hom A d c
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
168 ek=h : {d : Obj A} → ∀ {h : Hom A d a} → {eq : A [ A [ f o h ] ≈ A [ g o h ] ] } → A [ A [ e o k {d} h eq ] ≈ h ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
169 uniqueness : {d : Obj A} → ∀ {h : Hom A d a} → {eq : A [ A [ f o h ] ≈ A [ g o h ] ] } → {k' : Hom A d c } →
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
170 A [ A [ e o k' ] ≈ h ] → A [ k {d} h eq ≈ k' ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
171 equalizer : Hom A c a
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
172 equalizer = e
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
173
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
174 --
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
175 -- Product
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
176 --
264
78ce12f8e6b6 pullback done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 260
diff changeset
177 -- c
78ce12f8e6b6 pullback done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 260
diff changeset
178 -- f | g
78ce12f8e6b6 pullback done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 260
diff changeset
179 -- |f×g
78ce12f8e6b6 pullback done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 260
diff changeset
180 -- v
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
181 -- a <-------- ab ---------→ b
264
78ce12f8e6b6 pullback done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 260
diff changeset
182 -- π1 π2
260
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
183
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
184
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
185 record Product { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) (a b ab : Obj A)
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
186 ( π1 : Hom A ab a )
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
187 ( π2 : Hom A ab b )
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
188 : Set (ℓ ⊔ (c₁ ⊔ c₂)) where
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
189 field
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
190 _×_ : {c : Obj A} ( f : Hom A c a ) → ( g : Hom A c b ) → Hom A c ab
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
191 π1fxg=f : {c : Obj A} { f : Hom A c a } → { g : Hom A c b } → A [ A [ π1 o ( f × g ) ] ≈ f ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
192 π2fxg=g : {c : Obj A} { f : Hom A c a } → { g : Hom A c b } → A [ A [ π2 o ( f × g ) ] ≈ g ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
193 uniqueness : {c : Obj A} { h : Hom A c ab } → A [ ( A [ π1 o h ] ) × ( A [ π2 o h ] ) ≈ h ]
264
78ce12f8e6b6 pullback done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 260
diff changeset
194 ×-cong : {c : Obj A} { f f' : Hom A c a } → { g g' : Hom A c b } → A [ f ≈ f' ] → A [ g ≈ g' ] → A [ f × g ≈ f' × g' ]
260
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
195 axb : Obj A
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
196 axb = ab
265
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
197 pi1 : Hom A ab a
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
198 pi1 = π1
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
199 pi2 : Hom A ab b
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
200 pi2 = π2
260
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
201
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
202 -- Pullback
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
203 -- f
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
204 -- a ------→ c
260
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
205 -- ^ ^
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
206 -- π1 | |g
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
207 -- | |
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 268
diff changeset
208 -- ab ------→ b
260
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
209 -- ^ π2
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
210 -- |
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
211 -- d
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
212 --
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
213 record Pullback { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) (a b c ab : Obj A)
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
214 ( f : Hom A a c ) ( g : Hom A b c )
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
215 ( π1 : Hom A ab a ) ( π2 : Hom A ab b )
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
216 : Set (ℓ ⊔ (c₁ ⊔ c₂)) where
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
217 field
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
218 commute : A [ A [ f o π1 ] ≈ A [ g o π2 ] ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
219 p : { d : Obj A } → { π1' : Hom A d a } { π2' : Hom A d b } → A [ A [ f o π1' ] ≈ A [ g o π2' ] ] → Hom A d ab
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
220 π1p=π1 : { d : Obj A } → { π1' : Hom A d a } { π2' : Hom A d b } → { eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ] }
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
221 → A [ A [ π1 o p eq ] ≈ π1' ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
222 π2p=π2 : { d : Obj A } → { π1' : Hom A d a } { π2' : Hom A d b } → { eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ] }
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
223 → A [ A [ π2 o p eq ] ≈ π2' ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
224 uniqueness : { d : Obj A } → ( p' : Hom A d ab ) → { π1' : Hom A d a } { π2' : Hom A d b } → { eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ] }
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
225 → { π1p=π1' : A [ A [ π1 o p' ] ≈ π1' ] }
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
226 → { π2p=π2' : A [ A [ π2 o p' ] ≈ π2' ] }
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
227 → A [ p eq ≈ p' ]
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
228 axb : Obj A
a87d3ea9efe4 pullback
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 253
diff changeset
229 axb = ab
265
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
230 pi1 : Hom A ab a
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
231 pi1 = π1
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
232 pi2 : Hom A ab b
367e8fde93ee add limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 264
diff changeset
233 pi2 = π2
312
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
234
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
235 --
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
236 -- Limit
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
237 --
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
238 -----
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
239
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
240 -- Constancy Functor
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
241
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
242 K : { c₁' c₂' ℓ' : Level} (A : Category c₁' c₂' ℓ') { c₁'' c₂'' ℓ'' : Level} ( I : Category c₁'' c₂'' ℓ'' )
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
243 → ( a : Obj A ) → Functor I A
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
244 K A I a = record {
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
245 FObj = λ i → a ;
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
246 FMap = λ f → id1 A a ;
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
247 isFunctor = let open ≈-Reasoning (A) in record {
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
248 ≈-cong = λ f=g → refl-hom
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
249 ; identity = refl-hom
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
250 ; distr = sym idL
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
251 }
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
252 }
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
253
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
254
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
255 record Limit { c₁' c₂' ℓ' : Level} { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A )
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
256 ( a0 : Obj A ) ( t0 : NTrans I A ( K A I a0 ) Γ ) : Set (suc (c₁' ⊔ c₂' ⊔ ℓ' ⊔ c₁ ⊔ c₂ ⊔ ℓ )) where
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
257 field
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
258 limit : ( a : Obj A ) → ( t : NTrans I A ( K A I a ) Γ ) → Hom A a a0
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
259 t0f=t : { a : Obj A } → { t : NTrans I A ( K A I a ) Γ } → ∀ { i : Obj I } →
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
260 A [ A [ TMap t0 i o limit a t ] ≈ TMap t i ]
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
261 limit-uniqueness : { a : Obj A } → { t : NTrans I A ( K A I a ) Γ } → { f : Hom A a a0 } → ( ∀ { i : Obj I } →
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
262 A [ A [ TMap t0 i o f ] ≈ TMap t i ] ) → A [ limit a t ≈ f ]
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
263 A0 : Obj A
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
264 A0 = a0
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
265 T0 : NTrans I A ( K A I a0 ) Γ
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
266 T0 = t0
702adc45704f is this right direction?
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 300
diff changeset
267