Mercurial > hg > Members > kono > Proof > category
comparison pullback.agda @ 282:c831abfa9bf4
limit on going...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 23 Sep 2013 17:23:40 +0900 |
parents | dbd2044add2a |
children | 5492a0681f55 |
comparison
equal
deleted
inserted
replaced
281:dbd2044add2a | 282:c831abfa9bf4 |
---|---|
9 module pullback { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ') ( Γ : Functor I A ) where | 9 module pullback { c₁ c₂ ℓ : Level} ( A : Category c₁ c₂ ℓ ) { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ') ( Γ : Functor I A ) where |
10 | 10 |
11 open import HomReasoning | 11 open import HomReasoning |
12 open import cat-utility | 12 open import cat-utility |
13 | 13 |
14 -- | 14 -- |
15 -- Pullback from equalizer and product | 15 -- Pullback from equalizer and product |
16 -- f | 16 -- f |
17 -- a -------> c | 17 -- a -------> c |
18 -- ^ ^ | 18 -- ^ ^ |
19 -- π1 | |g | 19 -- π1 | |g |
20 -- | | | 20 -- | | |
21 -- ab -------> b | 21 -- ab -------> b |
22 -- ^ π2 | 22 -- ^ π2 |
23 -- | | 23 -- | |
24 -- | e = equalizer (f π1) (g π1) | 24 -- | e = equalizer (f π1) (g π1) |
25 -- | | 25 -- | |
26 -- d <------------------ d' | 26 -- d <------------------ d' |
27 -- k (π1' × π2' ) | 27 -- k (π1' × π2' ) |
28 | 28 |
29 open Equalizer | 29 open Equalizer |
30 open Product | 30 open Product |
31 open Pullback | 31 open Pullback |
32 | 32 |
33 pullback-from : (a b c ab d : Obj A) | 33 pullback-from : (a b c ab d : Obj A) |
34 ( f : Hom A a c ) ( g : Hom A b c ) | 34 ( f : Hom A a c ) ( g : Hom A b c ) |
35 ( π1 : Hom A ab a ) ( π2 : Hom A ab b ) ( e : Hom A d ab ) | 35 ( π1 : Hom A ab a ) ( π2 : Hom A ab b ) ( e : Hom A d ab ) |
36 ( eqa : {a b c : Obj A} → (f g : Hom A a b) → {e : Hom A c a } → Equalizer A e f g ) | 36 ( eqa : {a b c : Obj A} → (f g : Hom A a b) → {e : Hom A c a } → Equalizer A e f g ) |
37 ( prod : Product A a b ab π1 π2 ) → Pullback A a b c d f g | 37 ( prod : Product A a b ab π1 π2 ) → Pullback A a b c d f g |
38 ( A [ π1 o equalizer ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ){e} ) ] ) | 38 ( A [ π1 o equalizer ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ){e} ) ] ) |
39 ( A [ π2 o equalizer ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ){e} ) ] ) | 39 ( A [ π2 o equalizer ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ){e} ) ] ) |
40 pullback-from a b c ab d f g π1 π2 e eqa prod = record { | 40 pullback-from a b c ab d f g π1 π2 e eqa prod = record { |
41 commute = commute1 ; | 41 commute = commute1 ; |
42 p = p1 ; | 42 p = p1 ; |
43 π1p=π1 = λ {d} {π1'} {π2'} {eq} → π1p=π11 {d} {π1'} {π2'} {eq} ; | 43 π1p=π1 = λ {d} {π1'} {π2'} {eq} → π1p=π11 {d} {π1'} {π2'} {eq} ; |
44 π2p=π2 = λ {d} {π1'} {π2'} {eq} → π2p=π21 {d} {π1'} {π2'} {eq} ; | 44 π2p=π2 = λ {d} {π1'} {π2'} {eq} → π2p=π21 {d} {π1'} {π2'} {eq} ; |
45 uniqueness = uniqueness1 | 45 uniqueness = uniqueness1 |
46 } where | 46 } where |
47 commute1 : A [ A [ f o A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] ] ≈ A [ g o A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] ] ] | 47 commute1 : A [ A [ f o A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] ] ≈ A [ g o A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] ] ] |
48 commute1 = let open ≈-Reasoning (A) in | 48 commute1 = let open ≈-Reasoning (A) in |
49 begin | 49 begin |
50 f o ( π1 o equalizer (eqa ( f o π1 ) ( g o π2 )) ) | 50 f o ( π1 o equalizer (eqa ( f o π1 ) ( g o π2 )) ) |
51 ≈⟨ assoc ⟩ | 51 ≈⟨ assoc ⟩ |
52 ( f o π1 ) o equalizer (eqa ( f o π1 ) ( g o π2 )) | 52 ( f o π1 ) o equalizer (eqa ( f o π1 ) ( g o π2 )) |
53 ≈⟨ fe=ge (eqa (A [ f o π1 ]) (A [ g o π2 ])) ⟩ | 53 ≈⟨ fe=ge (eqa (A [ f o π1 ]) (A [ g o π2 ])) ⟩ |
54 ( g o π2 ) o equalizer (eqa ( f o π1 ) ( g o π2 )) | 54 ( g o π2 ) o equalizer (eqa ( f o π1 ) ( g o π2 )) |
55 ≈↑⟨ assoc ⟩ | 55 ≈↑⟨ assoc ⟩ |
56 g o ( π2 o equalizer (eqa ( f o π1 ) ( g o π2 )) ) | 56 g o ( π2 o equalizer (eqa ( f o π1 ) ( g o π2 )) ) |
57 ∎ | 57 ∎ |
58 lemma1 : {d' : Obj A} {π1' : Hom A d' a} {π2' : Hom A d' b} → A [ A [ f o π1' ] ≈ A [ g o π2' ] ] → | 58 lemma1 : {d' : Obj A} {π1' : Hom A d' a} {π2' : Hom A d' b} → A [ A [ f o π1' ] ≈ A [ g o π2' ] ] → |
59 A [ A [ A [ f o π1 ] o (prod × π1') π2' ] ≈ A [ A [ g o π2 ] o (prod × π1') π2' ] ] | 59 A [ A [ A [ f o π1 ] o (prod × π1') π2' ] ≈ A [ A [ g o π2 ] o (prod × π1') π2' ] ] |
60 lemma1 {d'} { π1' } { π2' } eq = let open ≈-Reasoning (A) in | 60 lemma1 {d'} { π1' } { π2' } eq = let open ≈-Reasoning (A) in |
61 begin | 61 begin |
62 ( f o π1 ) o (prod × π1') π2' | 62 ( f o π1 ) o (prod × π1') π2' |
63 ≈↑⟨ assoc ⟩ | 63 ≈↑⟨ assoc ⟩ |
64 f o ( π1 o (prod × π1') π2' ) | 64 f o ( π1 o (prod × π1') π2' ) |
65 ≈⟨ cdr (π1fxg=f prod) ⟩ | 65 ≈⟨ cdr (π1fxg=f prod) ⟩ |
70 g o ( π2 o (prod × π1') π2' ) | 70 g o ( π2 o (prod × π1') π2' ) |
71 ≈⟨ assoc ⟩ | 71 ≈⟨ assoc ⟩ |
72 ( g o π2 ) o (prod × π1') π2' | 72 ( g o π2 ) o (prod × π1') π2' |
73 ∎ | 73 ∎ |
74 p1 : {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' d | 74 p1 : {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' d |
75 p1 {d'} { π1' } { π2' } eq = | 75 p1 {d'} { π1' } { π2' } eq = |
76 let open ≈-Reasoning (A) in k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) ( lemma1 eq ) | 76 let open ≈-Reasoning (A) in k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) ( lemma1 eq ) |
77 π1p=π11 : {d₁ : Obj A} {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → | 77 π1p=π11 : {d₁ : Obj A} {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → |
78 A [ A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ] o p1 eq ] ≈ π1' ] | 78 A [ A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ] o p1 eq ] ≈ π1' ] |
79 π1p=π11 {d'} {π1'} {π2'} {eq} = let open ≈-Reasoning (A) in | 79 π1p=π11 {d'} {π1'} {π2'} {eq} = let open ≈-Reasoning (A) in |
80 begin | 80 begin |
81 ( π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ) o p1 eq | 81 ( π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ) o p1 eq |
82 ≈⟨⟩ | 82 ≈⟨⟩ |
83 ( π1 o e) o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) | 83 ( π1 o e) o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) |
84 ≈↑⟨ assoc ⟩ | 84 ≈↑⟨ assoc ⟩ |
85 π1 o ( e o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) ) | 85 π1 o ( e o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) ) |
86 ≈⟨ cdr ( ek=h ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} )) ⟩ | 86 ≈⟨ cdr ( ek=h ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} )) ⟩ |
87 π1 o (_×_ prod π1' π2' ) | 87 π1 o (_×_ prod π1' π2' ) |
88 ≈⟨ π1fxg=f prod ⟩ | 88 ≈⟨ π1fxg=f prod ⟩ |
89 π1' | 89 π1' |
90 ∎ | 90 ∎ |
91 π2p=π21 : {d₁ : Obj A} {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → | 91 π2p=π21 : {d₁ : Obj A} {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → |
92 A [ A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ] o p1 eq ] ≈ π2' ] | 92 A [ A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ] o p1 eq ] ≈ π2' ] |
93 π2p=π21 {d'} {π1'} {π2'} {eq} = let open ≈-Reasoning (A) in | 93 π2p=π21 {d'} {π1'} {π2'} {eq} = let open ≈-Reasoning (A) in |
94 begin | 94 begin |
95 ( π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ) o p1 eq | 95 ( π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ]) {e} ) ) o p1 eq |
96 ≈⟨⟩ | 96 ≈⟨⟩ |
97 ( π2 o e) o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) | 97 ( π2 o e) o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) |
98 ≈↑⟨ assoc ⟩ | 98 ≈↑⟨ assoc ⟩ |
99 π2 o ( e o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) ) | 99 π2 o ( e o k ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} ) (_×_ prod π1' π2' ) (lemma1 eq) ) |
100 ≈⟨ cdr ( ek=h ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} )) ⟩ | 100 ≈⟨ cdr ( ek=h ( eqa ( A [ f o π1 ] ) ( A [ g o π2 ] ) {e} )) ⟩ |
101 π2 o (_×_ prod π1' π2' ) | 101 π2 o (_×_ prod π1' π2' ) |
102 ≈⟨ π2fxg=g prod ⟩ | 102 ≈⟨ π2fxg=g prod ⟩ |
103 π2' | 103 π2' |
104 ∎ | 104 ∎ |
105 uniqueness1 : {d₁ : Obj A} (p' : Hom A d₁ d) {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → | 105 uniqueness1 : {d₁ : Obj A} (p' : Hom A d₁ d) {π1' : Hom A d₁ a} {π2' : Hom A d₁ b} {eq : A [ A [ f o π1' ] ≈ A [ g o π2' ] ]} → |
106 {eq1 : A [ A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ] ≈ π1' ]} → | 106 {eq1 : A [ A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ] ≈ π1' ]} → |
117 equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p' | 117 equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p' |
118 ≈↑⟨ Product.uniqueness prod ⟩ | 118 ≈↑⟨ Product.uniqueness prod ⟩ |
119 (prod × ( π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p') ) ( π2 o (equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p')) | 119 (prod × ( π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p') ) ( π2 o (equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) o p')) |
120 ≈⟨ ×-cong prod (assoc) (assoc) ⟩ | 120 ≈⟨ ×-cong prod (assoc) (assoc) ⟩ |
121 (prod × (A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ])) | 121 (prod × (A [ A [ π1 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ])) |
122 (A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ]) | 122 (A [ A [ π2 o equalizer (eqa (A [ f o π1 ]) (A [ g o π2 ])) ] o p' ]) |
123 ≈⟨ ×-cong prod eq1 eq2 ⟩ | 123 ≈⟨ ×-cong prod eq1 eq2 ⟩ |
124 ((prod × π1') π2') | 124 ((prod × π1') π2') |
125 ∎ ) ⟩ | 125 ∎ ) ⟩ |
126 p' | 126 p' |
127 ∎ | 127 ∎ |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 open NTrans | 148 open NTrans |
149 | 149 |
150 record Limit { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | 150 record Limit { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) |
151 ( a0 : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) : Set (suc (c₁' ⊔ c₂' ⊔ ℓ' ⊔ c₁ ⊔ c₂ ⊔ ℓ )) where | 151 ( a0 : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) : Set (suc (c₁' ⊔ c₂' ⊔ ℓ' ⊔ c₁ ⊔ c₂ ⊔ ℓ )) where |
152 field | 152 field |
153 limit : ( a : Obj A ) → ( t : NTrans I A ( K I a ) Γ ) → Hom A a a0 | 153 limit : ( a : Obj A ) → ( t : NTrans I A ( K I a ) Γ ) → Hom A a a0 |
154 t0f=t : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → ∀ { i : Obj I } → | 154 t0f=t : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → ∀ { i : Obj I } → |
155 A [ A [ TMap t0 i o limit a t ] ≈ TMap t i ] | 155 A [ A [ TMap t0 i o limit a t ] ≈ TMap t i ] |
156 limit-uniqueness : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → { f : Hom A a a0 } → ( ∀ { i : Obj I } → | 156 limit-uniqueness : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → { f : Hom A a a0 } → ( ∀ { i : Obj I } → |
157 A [ A [ TMap t0 i o f ] ≈ TMap t i ] ) → A [ limit a t ≈ f ] | 157 A [ A [ TMap t0 i o f ] ≈ TMap t i ] ) → A [ limit a t ≈ f ] |
158 A0 : Obj A | 158 A0 : Obj A |
159 A0 = a0 | 159 A0 = a0 |
160 T0 : NTrans I A ( K I a0 ) Γ | 160 T0 : NTrans I A ( K I a0 ) Γ |
161 T0 = t0 | 161 T0 = t0 |
162 | 162 |
163 -------------------------------- | 163 -------------------------------- |
164 -- | 164 -- |
165 -- If we have two limits on c and c', there are isomorphic pair h, h' | 165 -- If we have two limits on c and c', there are isomorphic pair h, h' |
166 | 166 |
167 open Limit | 167 open Limit |
168 | 168 |
169 iso-l : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | 169 iso-l : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) |
170 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) | 170 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) |
171 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) | 171 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) |
172 → Hom A a0 a0' | 172 → Hom A a0 a0' |
173 iso-l I Γ a0 a0' t0 t0' lim lim' = limit lim' a0 t0 | 173 iso-l I Γ a0 a0' t0 t0' lim lim' = limit lim' a0 t0 |
174 | 174 |
175 iso-r : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | 175 iso-r : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) |
176 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) | 176 ( a0 a0' : Obj A ) ( t0 : NTrans I A ( K I a0 ) Γ ) ( t0' : NTrans I A ( K I a0' ) Γ ) |
177 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) | 177 ( lim : Limit I Γ a0 t0 ) → ( lim' : Limit I Γ a0' t0' ) |
178 → Hom A a0' a0 | 178 → Hom A a0' a0 |
179 iso-r I Γ a0 a0' t0 t0' lim lim' = limit lim a0' t0' | 179 iso-r I Γ a0 a0' t0 t0' lim lim' = limit lim a0' t0' |
180 | 180 |
181 | 181 |
182 iso-lr : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) | 182 iso-lr : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) ( Γ : Functor I A ) |
186 iso-lr I Γ a0 a0' t0 t0' lim lim' {i} = let open ≈-Reasoning (A) in begin | 186 iso-lr I Γ a0 a0' t0 t0' lim lim' {i} = let open ≈-Reasoning (A) in begin |
187 limit lim' a0 t0 o limit lim a0' t0' | 187 limit lim' a0 t0 o limit lim a0' t0' |
188 ≈↑⟨ limit-uniqueness lim' ( λ {i} → ( begin | 188 ≈↑⟨ limit-uniqueness lim' ( λ {i} → ( begin |
189 TMap t0' i o ( limit lim' a0 t0 o limit lim a0' t0' ) | 189 TMap t0' i o ( limit lim' a0 t0 o limit lim a0' t0' ) |
190 ≈⟨ assoc ⟩ | 190 ≈⟨ assoc ⟩ |
191 ( TMap t0' i o limit lim' a0 t0 ) o limit lim a0' t0' | 191 ( TMap t0' i o limit lim' a0 t0 ) o limit lim a0' t0' |
192 ≈⟨ car ( t0f=t lim' ) ⟩ | 192 ≈⟨ car ( t0f=t lim' ) ⟩ |
193 TMap t0 i o limit lim a0' t0' | 193 TMap t0 i o limit lim a0' t0' |
194 ≈⟨ t0f=t lim ⟩ | 194 ≈⟨ t0f=t lim ⟩ |
195 TMap t0' i | 195 TMap t0' i |
196 ∎) ) ⟩ | 196 ∎) ) ⟩ |
197 limit lim' a0' t0' | 197 limit lim' a0' t0' |
198 ≈⟨ limit-uniqueness lim' idR ⟩ | 198 ≈⟨ limit-uniqueness lim' idR ⟩ |
199 id a0' | 199 id a0' |
200 ∎ | 200 ∎ |
201 | 201 |
202 | 202 |
203 open import CatExponetial | 203 open import CatExponetial |
204 | 204 |
205 open Functor | 205 open Functor |
206 | 206 |
207 -------------------------------- | 207 -------------------------------- |
208 -- | 208 -- |
211 KI : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) → Functor A ( A ^ I ) | 211 KI : { c₁' c₂' ℓ' : Level} ( I : Category c₁' c₂' ℓ' ) → Functor A ( A ^ I ) |
212 KI { c₁'} {c₂'} {ℓ'} I = record { | 212 KI { c₁'} {c₂'} {ℓ'} I = record { |
213 FObj = λ a → K I a ; | 213 FObj = λ a → K I a ; |
214 FMap = λ f → record { -- NTrans I A (K I a) (K I b) | 214 FMap = λ f → record { -- NTrans I A (K I a) (K I b) |
215 TMap = λ a → f ; | 215 TMap = λ a → f ; |
216 isNTrans = record { | 216 isNTrans = record { |
217 commute = λ {a b f₁} → commute1 {a} {b} {f₁} f | 217 commute = λ {a b f₁} → commute1 {a} {b} {f₁} f |
218 } | 218 } |
219 } ; | 219 } ; |
220 isFunctor = let open ≈-Reasoning (A) in record { | 220 isFunctor = let open ≈-Reasoning (A) in record { |
221 ≈-cong = λ f=g {x} → f=g | 221 ≈-cong = λ f=g {x} → f=g |
222 ; identity = refl-hom | 222 ; identity = refl-hom |
223 ; distr = refl-hom | 223 ; distr = refl-hom |
224 } | 224 } |
225 } where | 225 } where |
226 commute1 : {a b : Obj I} {f₁ : Hom I a b} → {a' b' : Obj A} → (f : Hom A a' b' ) → | 226 commute1 : {a b : Obj I} {f₁ : Hom I a b} → {a' b' : Obj A} → (f : Hom A a' b' ) → |
227 A [ A [ FMap (K I b') f₁ o f ] ≈ A [ f o FMap (K I a') f₁ ] ] | 227 A [ A [ FMap (K I b') f₁ o f ] ≈ A [ f o FMap (K I a') f₁ ] ] |
228 commute1 {a} {b} {f₁} {a'} {b'} f = let open ≈-Reasoning (A) in begin | 228 commute1 {a} {b} {f₁} {a'} {b'} f = let open ≈-Reasoning (A) in begin |
229 FMap (K I b') f₁ o f | 229 FMap (K I b') f₁ o f |
230 ≈⟨ idL ⟩ | 230 ≈⟨ idL ⟩ |
231 f | 231 f |
232 ≈↑⟨ idR ⟩ | 232 ≈↑⟨ idR ⟩ |
233 f o FMap (K I a') f₁ | 233 f o FMap (K I a') f₁ |
234 ∎ | 234 ∎ |
235 | 235 |
236 | 236 |
237 --------- | 237 --------- |
238 -- | 238 -- |
239 -- limit gives co universal mapping ( i.e. adjunction ) | 239 -- limit gives co universal mapping ( i.e. adjunction ) |
240 -- | 240 -- |
241 -- F = KI I : Functor A (A ^ I) | 241 -- F = KI I : Functor A (A ^ I) |
242 -- U = λ b → A0 (lim b {a0 b} {t0 b} | 242 -- U = λ b → A0 (lim b {a0 b} {t0 b} |
243 -- ε = λ b → T0 ( lim b {a0 b} {t0 b} ) | 243 -- ε = λ b → T0 ( lim b {a0 b} {t0 b} ) |
244 | 244 |
245 limit2couniv : | 245 limit2couniv : |
246 ( lim : ( Γ : Functor I A ) → { a0 : Obj A } { t0 : NTrans I A ( K I a0 ) Γ } → Limit I Γ a0 t0 ) | 246 ( lim : ( Γ : Functor I A ) → { a0 : Obj A } { t0 : NTrans I A ( K I a0 ) Γ } → Limit I Γ a0 t0 ) |
247 → ( a0 : ( b : Functor I A ) → Obj A ) ( t0 : ( b : Functor I A ) → NTrans I A ( K I (a0 b) ) b ) | 247 → ( a0 : ( b : Functor I A ) → Obj A ) ( t0 : ( b : Functor I A ) → NTrans I A ( K I (a0 b) ) b ) |
248 → coUniversalMapping A ( A ^ I ) (KI I) (λ b → A0 (lim b {a0 b} {t0 b} ) ) ( λ b → T0 ( lim b {a0 b} {t0 b} ) ) | 248 → coUniversalMapping A ( A ^ I ) (KI I) (λ b → A0 (lim b {a0 b} {t0 b} ) ) ( λ b → T0 ( lim b {a0 b} {t0 b} ) ) |
249 limit2couniv lim a0 t0 = record { -- F U ε | 249 limit2couniv lim a0 t0 = record { -- F U ε |
250 _*' = λ {b} {a} k → limit (lim b {a0 b} {t0 b} ) a k ; -- η | 250 _*' = λ {b} {a} k → limit (lim b {a0 b} {t0 b} ) a k ; -- η |
251 iscoUniversalMapping = record { | 251 iscoUniversalMapping = record { |
252 couniversalMapping = λ{ b a f} → couniversalMapping1 {b} {a} {f} ; | 252 couniversalMapping = λ{ b a f} → couniversalMapping1 {b} {a} {f} ; |
253 couniquness = couniquness2 | 253 couniquness = couniquness2 |
254 } | 254 } |
255 } where | 255 } where |
256 couniversalMapping1 : {b : Obj (A ^ I)} {a : Obj A} {f : Hom (A ^ I) (FObj (KI I) a) b} → | 256 couniversalMapping1 : {b : Obj (A ^ I)} {a : Obj A} {f : Hom (A ^ I) (FObj (KI I) a) b} → |
257 A ^ I [ A ^ I [ T0 (lim b {a0 b} {t0 b}) o FMap (KI I) (limit (lim b {a0 b} {t0 b}) a f) ] ≈ f ] | 257 A ^ I [ A ^ I [ T0 (lim b {a0 b} {t0 b}) o FMap (KI I) (limit (lim b {a0 b} {t0 b}) a f) ] ≈ f ] |
258 couniversalMapping1 {b} {a} {f} {i} = let open ≈-Reasoning (A) in begin | 258 couniversalMapping1 {b} {a} {f} {i} = let open ≈-Reasoning (A) in begin |
259 TMap (T0 (lim b {a0 b} {t0 b})) i o TMap ( FMap (KI I) (limit (lim b {a0 b} {t0 b}) a f) ) i | 259 TMap (T0 (lim b {a0 b} {t0 b})) i o TMap ( FMap (KI I) (limit (lim b {a0 b} {t0 b}) a f) ) i |
260 ≈⟨⟩ | 260 ≈⟨⟩ |
261 TMap (t0 b) i o (limit (lim b) a f) | 261 TMap (t0 b) i o (limit (lim b) a f) |
262 ≈⟨ t0f=t (lim b) ⟩ | 262 ≈⟨ t0f=t (lim b) ⟩ |
263 TMap f i -- i comes from ∀{i} → B [ TMap f i ≈ TMap g i ] | 263 TMap f i -- i comes from ∀{i} → B [ TMap f i ≈ TMap g i ] |
264 ∎ | 264 ∎ |
265 couniquness2 : {b : Obj (A ^ I)} {a : Obj A} {f : Hom (A ^ I) (FObj (KI I) a) b} {g : Hom A a (A0 (lim b {a0 b} {t0 b} ))} → | 265 couniquness2 : {b : Obj (A ^ I)} {a : Obj A} {f : Hom (A ^ I) (FObj (KI I) a) b} {g : Hom A a (A0 (lim b {a0 b} {t0 b} ))} → |
266 ( ∀ { i : Obj I } → A [ A [ TMap (T0 (lim b {a0 b} {t0 b} )) i o TMap ( FMap (KI I) g) i ] ≈ TMap f i ] ) | 266 ( ∀ { i : Obj I } → A [ A [ TMap (T0 (lim b {a0 b} {t0 b} )) i o TMap ( FMap (KI I) g) i ] ≈ TMap f i ] ) |
267 → A [ limit (lim b {a0 b} {t0 b} ) a f ≈ g ] | 267 → A [ limit (lim b {a0 b} {t0 b} ) a f ≈ g ] |
268 couniquness2 {b} {a} {f} {g} lim-g=f = let open ≈-Reasoning (A) in begin | 268 couniquness2 {b} {a} {f} {g} lim-g=f = let open ≈-Reasoning (A) in begin |
269 limit (lim b {a0 b} {t0 b} ) a f | 269 limit (lim b {a0 b} {t0 b} ) a f |
270 ≈⟨ limit-uniqueness ( lim b {a0 b} {t0 b} ) lim-g=f ⟩ | 270 ≈⟨ limit-uniqueness ( lim b {a0 b} {t0 b} ) lim-g=f ⟩ |
271 g | 271 g |
273 | 273 |
274 open import Category.Cat | 274 open import Category.Cat |
275 | 275 |
276 | 276 |
277 open coUniversalMapping | 277 open coUniversalMapping |
278 | 278 |
279 univ2limit : | 279 univ2limit : |
280 ( U : Obj (A ^ I ) → Obj A ) | 280 ( U : Obj (A ^ I ) → Obj A ) |
281 ( ε : ( b : Obj (A ^ I ) ) → NTrans I A (K I (U b)) b ) | 281 ( ε : ( b : Obj (A ^ I ) ) → NTrans I A (K I (U b)) b ) |
282 ( univ : coUniversalMapping A (A ^ I) (KI I) U (ε) ) → | 282 ( univ : coUniversalMapping A (A ^ I) (KI I) U (ε) ) → |
283 ( Γ : Functor I A ) → Limit I Γ (U Γ) (ε Γ) | 283 ( Γ : Functor I A ) → Limit I Γ (U Γ) (ε Γ) |
284 univ2limit U ε univ Γ = record { | 284 univ2limit U ε univ Γ = record { |
285 limit = λ a t → limit1 a t ; | 285 limit = λ a t → limit1 a t ; |
286 t0f=t = λ {a t i } → t0f=t1 {a} {t} {i} ; | 286 t0f=t = λ {a t i } → t0f=t1 {a} {t} {i} ; |
287 limit-uniqueness = λ {a} {t} {f} t=f → limit-uniqueness1 {a} {t} {f} t=f | 287 limit-uniqueness = λ {a} {t} {f} t=f → limit-uniqueness1 {a} {t} {f} t=f |
288 } where | 288 } where |
289 limit1 : (a : Obj A) → NTrans I A (K I a) Γ → Hom A a (U Γ) | 289 limit1 : (a : Obj A) → NTrans I A (K I a) Γ → Hom A a (U Γ) |
290 limit1 a t = _*' univ {_} {a} t | 290 limit1 a t = _*' univ {_} {a} t |
291 t0f=t1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {i : Obj I} → | 291 t0f=t1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {i : Obj I} → |
292 A [ A [ TMap (ε Γ) i o limit1 a t ] ≈ TMap t i ] | 292 A [ A [ TMap (ε Γ) i o limit1 a t ] ≈ TMap t i ] |
293 t0f=t1 {a} {t} {i} = let open ≈-Reasoning (A) in begin | 293 t0f=t1 {a} {t} {i} = let open ≈-Reasoning (A) in begin |
294 TMap (ε Γ) i o limit1 a t | 294 TMap (ε Γ) i o limit1 a t |
295 ≈⟨⟩ | 295 ≈⟨⟩ |
296 TMap (ε Γ) i o _*' univ {Γ} {a} t | 296 TMap (ε Γ) i o _*' univ {Γ} {a} t |
297 ≈⟨ coIsUniversalMapping.couniversalMapping ( iscoUniversalMapping univ) {Γ} {a} {t} ⟩ | 297 ≈⟨ coIsUniversalMapping.couniversalMapping ( iscoUniversalMapping univ) {Γ} {a} {t} ⟩ |
298 TMap t i | 298 TMap t i |
299 ∎ | 299 ∎ |
300 limit-uniqueness1 : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → { f : Hom A a (U Γ)} | 300 limit-uniqueness1 : { a : Obj A } → { t : NTrans I A ( K I a ) Γ } → { f : Hom A a (U Γ)} |
301 → ( ∀ { i : Obj I } → A [ A [ TMap (ε Γ) i o f ] ≈ TMap t i ] ) → A [ limit1 a t ≈ f ] | 301 → ( ∀ { i : Obj I } → A [ A [ TMap (ε Γ) i o f ] ≈ TMap t i ] ) → A [ limit1 a t ≈ f ] |
302 limit-uniqueness1 {a} {t} {f} εf=t = let open ≈-Reasoning (A) in begin | 302 limit-uniqueness1 {a} {t} {f} εf=t = let open ≈-Reasoning (A) in begin |
303 _*' univ t | 303 _*' univ t |
304 ≈⟨ ( coIsUniversalMapping.couniquness ( iscoUniversalMapping univ) ) εf=t ⟩ | 304 ≈⟨ ( coIsUniversalMapping.couniquness ( iscoUniversalMapping univ) ) εf=t ⟩ |
305 f | 305 f |
318 field | 318 field |
319 product : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → Hom A q p | 319 product : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → Hom A q p |
320 pif=q : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → ∀ { i : I } → A [ A [ ( pi i ) o ( product qi ) ] ≈ (qi i) ] | 320 pif=q : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → ∀ { i : I } → A [ A [ ( pi i ) o ( product qi ) ] ≈ (qi i) ] |
321 ip-uniqueness : {q : Obj A} { h : Hom A q p } → A [ product ( λ (i : I) → A [ (pi i) o h ] ) ≈ h ] | 321 ip-uniqueness : {q : Obj A} { h : Hom A q p } → A [ product ( λ (i : I) → A [ (pi i) o h ] ) ≈ h ] |
322 ip-cong : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → ( qi' : (i : I) → Hom A q (ai i) ) | 322 ip-cong : {q : Obj A} → ( qi : (i : I) → Hom A q (ai i) ) → ( qi' : (i : I) → Hom A q (ai i) ) |
323 → ( ∀ (i : I ) → A [ qi i ≈ qi' i ] ) → A [ product qi ≈ product qi' ] | 323 → ( ∀ (i : I ) → A [ qi i ≈ qi' i ] ) → A [ product qi ≈ product qi' ] |
324 | 324 |
325 open IProduct | 325 open IProduct |
326 | 326 |
327 limit-equalizer : | 327 -- |
328 -- limit from equalizer and product | |
329 -- | |
330 -- | |
331 -- ai | |
332 -- ^ ^ | |
333 -- | | pi | |
334 -- | | | |
335 -- | p | |
336 -- | ^ | |
337 -- | | | |
338 -- | | e = equalizer (f pi) (g pi') | |
339 -- | | | |
340 -- lim <------------------ d' | |
341 -- k ( product pi ) | |
342 | |
343 open Equalizer | |
344 | |
345 limit-equalizer : | |
328 ( prod : (p : Obj A) ( ai : Obj I → Obj A ) ( pi : (i : Obj I) → Hom A p ( ai i ) ) | 346 ( prod : (p : Obj A) ( ai : Obj I → Obj A ) ( pi : (i : Obj I) → Hom A p ( ai i ) ) |
329 → IProduct {c₁'} A (Obj I) p ai pi ) | 347 → IProduct {c₁'} A (Obj I) p ai pi ) |
330 ( eqa : {a b c : Obj A} → (e : Hom A c a ) → (f g : Hom A a b) → Equalizer A e f g ) | 348 ( eqa : {a b c : Obj A} → (e : Hom A c a ) → (f g : Hom A a b) → Equalizer A e f g ) |
331 ( Γ : Functor I A ) → | 349 ( Γ : Functor I A ) → |
332 ( lim : Obj A ) | 350 ( lim p : Obj A ) ( e : Hom A lim p ) |
333 ( proj : (i : Obj I ) → Hom A lim (FObj Γ i) ) → | 351 ( proj : (i : Obj I ) → Hom A p (FObj Γ i) ) → |
334 NTrans I A (K I lim) Γ | 352 NTrans I A (K I lim) Γ |
335 limit-equalizer prod eqa Γ lim proj = record { | 353 limit-equalizer prod eqa Γ lim p e proj = record { |
336 TMap = tmap ; | 354 TMap = tmap ; |
337 isNTrans = record { | 355 isNTrans = record { |
338 commute = {!!} | 356 commute = commute1 |
339 } | 357 } |
340 } where | 358 } where |
341 tmap : (i : Obj I) → Hom A (FObj (K I lim) i) (FObj Γ i) | 359 tmap : (i : Obj I) → Hom A (FObj (K I lim) i) (FObj Γ i) |
342 tmap i = A [ ( proj i ) o equalizer ( eqa (id1 A lim) (A [ FMap Γ (id1 I i) o proj i ] ) (A [ {!!} o {!!} ] )) ] | 360 tmap i = A [ ( proj i ) o e ] |
343 | 361 commute1 : {a b : Obj I} {f : Hom I a b} → |
344 limit-from : | 362 A [ A [ FMap Γ f o tmap a ] ≈ A [ tmap b o FMap (K I lim) f ] ] |
363 commute1 {i} {j} {f} = let open ≈-Reasoning (A) in begin | |
364 FMap Γ f o tmap i | |
365 ≈⟨⟩ | |
366 FMap Γ f o ( proj i o e ) | |
367 ≈⟨ assoc ⟩ | |
368 ( FMap Γ f o proj i ) o e | |
369 ≈⟨ {!!} ⟩ | |
370 proj j o e | |
371 ≈↑⟨ idR ⟩ | |
372 (proj j o e ) o id1 A lim | |
373 ≈⟨⟩ | |
374 tmap j o FMap (K I lim) f | |
375 ∎ | |
376 | |
377 limit-from : | |
345 ( prod : (p : Obj A) ( ai : Obj I → Obj A ) ( pi : (i : Obj I) → Hom A p ( ai i ) ) | 378 ( prod : (p : Obj A) ( ai : Obj I → Obj A ) ( pi : (i : Obj I) → Hom A p ( ai i ) ) |
346 → IProduct {c₁'} A (Obj I) p ai pi ) | 379 → IProduct {c₁'} A (Obj I) p ai pi ) |
347 ( eqa : {a b c : Obj A} → (e : Hom A c a ) → (f g : Hom A a b) → Equalizer A e f g ) | 380 ( eqa : {a b c : Obj A} → (e : Hom A c a ) → (f g : Hom A a b) → Equalizer A e f g ) |
348 ( Γ : Functor I A ) → | 381 ( Γ : Functor I A ) → |
349 ( lim : Obj A ) | 382 ( lim p : Obj A ) ( e : Hom A lim p ) |
350 ( proj : (i : Obj I ) → Hom A lim (FObj Γ i) ) → | 383 ( proj : (i : Obj I ) → Hom A p (FObj Γ i) ) → |
351 Limit I Γ lim ( limit-equalizer prod eqa Γ lim proj ) | 384 Limit I Γ lim ( limit-equalizer prod eqa Γ lim p e proj ) |
352 limit-from prod eqa lim Γ proj = {!!} | 385 limit-from prod eqa Γ lim p e proj = record { |
386 limit = λ a t → limit1 a t ; | |
387 t0f=t = λ {a t i } → t0f=t1 {a} {t} {i} ; | |
388 limit-uniqueness = λ {a} {t} {f} t=f → limit-uniqueness1 {a} {t} {f} t=f | |
389 } where | |
390 limit1 : (a : Obj A) → NTrans I A (K I a) Γ → Hom A a lim | |
391 limit1 a t = k (eqa e {!!} {!!} ) (product ( prod p (FObj Γ) proj ) (TMap t) ) {!!} | |
392 t0f=t1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {i : Obj I} → | |
393 A [ A [ TMap (limit-equalizer prod eqa Γ lim p e proj) i o limit1 a t ] ≈ TMap t i ] | |
394 t0f=t1 = {!!} | |
395 limit-uniqueness1 : {a : Obj A} {t : NTrans I A (K I a) Γ} {f : Hom A a lim} → ({i : Obj I} → | |
396 A [ A [ TMap (limit-equalizer prod eqa Γ lim p e proj) i o f ] ≈ TMap t i ]) → | |
397 A [ limit1 a t ≈ f ] | |
398 limit-uniqueness1 = {!!} |