Mercurial > hg > Members > kono > Proof > category
annotate freyd1.agda @ 485:da4486523f73
on going ...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 11 Mar 2017 18:58:21 +0900 |
parents | fcae3025d900 |
children | 56cf6581c5f6 |
rev | line source |
---|---|
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 open import Category -- https://github.com/konn/category-agda |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 open import Level |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 module freyd1 {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} {A : Category c₁ c₂ ℓ} {C : Category c₁' c₂' ℓ'} |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 ( F : Functor A C ) ( G : Functor A C ) where |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 open import cat-utility |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 open import HomReasoning |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 open import Relation.Binary.Core |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 open Functor |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 open import Comma1 F G |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 open import freyd CommaCategory |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 open import Category.Cat |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 open NTrans |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 open Complete |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 open CommaObj |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 open CommaHom |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 open Limit |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 |
483 | 25 -- F : A → C |
26 -- G : A → C | |
27 -- | |
28 | |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 FIA : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) → Functor I A |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 FIA {I} Γ = record { |
482 | 31 FObj = λ x → obj (FObj Γ x ) ; |
32 FMap = λ {a} {b} f → arrow (FMap Γ f ) ; | |
33 isFunctor = record { | |
34 identity = identity | |
35 ; distr = IsFunctor.distr (isFunctor Γ) | |
36 ; ≈-cong = IsFunctor.≈-cong (isFunctor Γ) | |
37 }} where | |
38 identity : {x : Obj I } → A [ arrow (FMap Γ (id1 I x)) ≈ id1 A (obj (FObj Γ x)) ] | |
39 identity {x} = let open ≈-Reasoning (A) in begin | |
40 arrow (FMap Γ (id1 I x)) | |
41 ≈⟨ IsFunctor.identity (isFunctor Γ) ⟩ | |
42 id1 A (obj (FObj Γ x)) | |
43 ∎ | |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 |
482 | 45 NIA : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) |
46 (c : Obj CommaCategory ) ( ta : NTrans I CommaCategory ( K CommaCategory I c ) Γ ) → NTrans I A ( K A I (obj c) ) (FIA Γ) | |
47 NIA {I} Γ c ta = record { | |
48 TMap = λ x → arrow (TMap ta x ) | |
49 ; isNTrans = record { commute = comm1 } | |
50 } where | |
51 comm1 : {a b : Obj I} {f : Hom I a b} → | |
52 A [ A [ FMap (FIA Γ) f o arrow (TMap ta a) ] ≈ A [ arrow (TMap ta b) o FMap (K A I (obj c)) f ] ] | |
53 comm1 {a} {b} {f} = IsNTrans.commute (isNTrans ta ) | |
54 | |
484
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
55 tb : { c₁' c₂' ℓ' : Level} (B : Category c₁' c₂' ℓ') { c₁ c₂ ℓ : Level} ( I : Category c₁ c₂ ℓ ) ( Γ : Functor I B ) |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
56 ( lim : Obj B ) ( tb : NTrans I B ( K B I lim ) Γ ) → |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
57 ( U : Functor B C) → NTrans I C ( K C I (FObj U lim) ) (U ○ Γ) |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
58 tb B I Γ lim tb U = record { |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
59 TMap = TMap (Functor*Nat I C U tb) ; |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
60 isNTrans = record { commute = λ {a} {b} {f} → let open ≈-Reasoning (C) in begin |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
61 FMap (U ○ Γ) f o TMap (Functor*Nat I C U tb) a |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
62 ≈⟨ nat ( Functor*Nat I C U tb ) ⟩ |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
63 TMap (Functor*Nat I C U tb) b o FMap (U ○ K B I lim) f |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
64 ≈⟨ cdr (IsFunctor.identity (isFunctor U) ) ⟩ |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
65 TMap (Functor*Nat I C U tb) b o FMap (K C I (FObj U lim)) f |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
66 ∎ |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
67 } } |
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
68 |
485 | 69 FICG : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) → Functor I C |
70 FICG {I} Γ = G ○ (FIA Γ) | |
71 | |
72 FICF : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) → Functor I C | |
73 FICF {I} Γ = F ○ (FIA Γ) | |
74 | |
75 FINAT : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) → NTrans I C (FICF Γ) (FICG Γ) | |
76 FINAT {I} Γ = record { | |
77 TMap = λ i → tmap i | |
78 ; isNTrans = record { commute = λ {a} {b} {f} → commute {a} {b} {f} } | |
79 } where | |
80 tmap : (i : Obj I ) → Hom C (FObj (FICF Γ) i) (FObj (FICG Γ) i) | |
81 tmap i = hom (FObj Γ i ) | |
82 commute : {a b : Obj I} → {f : Hom I a b} → C [ C [ FMap (FICG Γ) f o tmap a ] ≈ C [ tmap b o FMap (FICF Γ) f ] ] | |
83 commute {a} {b} {f} = comm ( FMap Γ f ) | |
84 | |
85 revΓ : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) → Functor I CommaCategory | |
86 revΓ {I} Γ = record { | |
87 FObj = λ x → record { | |
88 obj = obj ( FObj Γ x ) | |
89 ; hom = TMap (FINAT Γ) x | |
90 } | |
91 ; FMap = λ {a} {b} f → record { | |
92 arrow = arrow ( FMap Γ f ) | |
93 ; comm = IsNTrans.commute ( isNTrans (FINAT Γ) ) | |
94 } | |
95 ; isFunctor = record { | |
96 identity = IsFunctor.identity ( isFunctor Γ ) | |
97 ; distr = IsFunctor.distr ( isFunctor Γ ) | |
98 ; ≈-cong = IsFunctor.≈-cong ( isFunctor Γ ) | |
99 }} where | |
100 | |
101 revF : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I A ) → Functor I CommaCategory | |
102 revF = {!!} | |
103 | |
484
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
104 |
483 | 105 NIC : { I : Category c₁ c₂ ℓ } → ( Γ : Functor I CommaCategory ) |
106 (c : Obj CommaCategory ) ( ta : NTrans I A ( K A I (obj c) ) (FIA Γ) ) → NTrans I C ( K C I (FObj G (obj c)) ) (G ○ ( FIA Γ) ) | |
484
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
107 NIC {I} Γ c ta = tb A I (FIA Γ) (obj c) ta G |
483 | 108 |
484
fcae3025d900
fix Limit pu a0 and t0 in record definition
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
483
diff
changeset
|
109 LimitC : { I : Category c₁ c₂ ℓ } → ( comp : Complete A I ) |
485 | 110 → ( glimit : ( Γ : Functor I A ) |
111 → ( limita : Limit A I Γ ) → Limit C I (G ○ Γ) ) | |
112 → ( Γ : Functor I CommaCategory ) | |
113 → Limit C I (FICG Γ) | |
114 LimitC {I} comp glimit Γ = glimit (FIA Γ) (isLimit comp (FIA Γ)) | |
483 | 115 |
485 | 116 revLimitC : { I : Category c₁ c₂ ℓ } → ( comp : Complete A I ) |
117 → ( glimit : ( Γ : Functor I A ) | |
118 → ( limita : Limit A I Γ ) → Limit C I (G ○ Γ) ) | |
119 → ( Γ : Functor I CommaCategory ) | |
120 → Limit C I ( G ○ (FIA (revΓ Γ) )) | |
121 revLimitC {I} comp glimit Γ = glimit (FIA (revΓ Γ)) (isLimit comp (FIA (revΓ Γ ))) | |
122 | |
123 commaLimit : { I : Category c₁ c₂ ℓ } → ( Complete A I) → ( Γ : Functor I CommaCategory ) | |
124 → ( glimit : ( Γ : Functor I A ) → ( limita : Limit A I Γ ) → Limit C I (G ○ Γ) ) | |
125 → Obj CommaCategory | |
126 commaLimit {I} comp Γ glimit = record { | |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 obj = limit-c comp (FIA Γ) |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 ; hom = limitHom |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 } where |
485 | 130 tu : NTrans I C (K C I (FObj F (limit-c comp (FIA Γ)))) (FICG Γ) |
131 tu = record { | |
132 TMap = λ i → C [ hom ( FObj Γ i ) o FMap F {!!} ] | |
133 ; isNTrans = {!!} | |
134 } | |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 limitHom : Hom C (FObj F (limit-c comp (FIA Γ ) )) (FObj G (limit-c comp (FIA Γ) )) |
485 | 136 limitHom = C [ {!!} o limit (revLimitC comp glimit Γ) (FObj F (limit-c comp (FIA (revΓ Γ)))) tu ] |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 commaNat : { I : Category c₁ c₂ ℓ } → ( comp : Complete A I) → ( Γ : Functor I CommaCategory ) |
485 | 140 → ( glimit : ( Γ : Functor I A ) → ( limita : Limit A I Γ ) → Limit C I (G ○ Γ) ) |
141 → NTrans I CommaCategory (K CommaCategory I {!!}) Γ | |
142 commaNat {I} comp Γ gilmit = record { | |
143 TMap = λ x → {!!} | |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 ; isNTrans = record { commute = {!!} } |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 } where |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 hasLimit : { I : Category c₁ c₂ ℓ } → ( comp : Complete A I ) |
485 | 149 → ( glimit : ( Γ : Functor I A ) → ( limita : Limit A I Γ ) → Limit C I (G ○ Γ) ) |
150 → ( Γ : Functor I CommaCategory ) | |
151 → Limit CommaCategory I Γ | |
152 hasLimit {I} comp glimit Γ = record { | |
153 a0 = {!!} ; | |
154 t0 = {!!} ; | |
481
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 limit = λ a t → {!!} ; |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 t0f=t = λ {a t i } → {!!} ; |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 limit-uniqueness = λ {a} {t} f t=f → {!!} |
65e6906782bb
Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 } |