annotate discrete.agda @ 456:4d97955ea419

limit with nat
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 02 Mar 2017 17:41:20 +0900
parents 55a9b6177ed4
children 0ba86e29f492
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 open import Category -- https://github.com/konn/category-agda
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 open import Level
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 module discrete where
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import Relation.Binary.Core
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 open import Relation.Nullary
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 open import Data.Empty
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
9 open import Data.Unit
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 open import Data.Maybe
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
11 open import cat-utility
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
12 open import HomReasoning
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open Functor
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 data TwoObject {c₁ : Level} : Set c₁ where
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 t0 : TwoObject
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 t1 : TwoObject
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 -- If we have limit then we have equalizer
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 --- two objects category
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 ---
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 --- f
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 --- -----→
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 --- 0 1
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 --- -----→
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 --- g
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
29 data TwoHom {c₁ c₂ : Level } : TwoObject {c₁} → TwoObject {c₁} → Set c₂ where
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
30 id-t0 : TwoHom t0 t0
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
31 id-t1 : TwoHom t1 t1
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
32 arrow-f : TwoHom t0 t1
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
33 arrow-g : TwoHom t0 t1
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
36 comp : ∀ {c₁ c₂} → {a b c : TwoObject {c₁}} → TwoHom {c₁} {c₂} b c → TwoHom {c₁} {c₂} a b → TwoHom {c₁} {c₂} a c
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
37 comp {_} {_} {t0} {t1} {t1} id-t1 arrow-f = arrow-f
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
38 comp {_} {_} {t0} {t1} {t1} id-t1 arrow-g = arrow-g
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
39 comp {_} {_} {t1} {t1} {t1} id-t1 id-t1 = id-t1
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
40 comp {_} {_} {t0} {t0} {t1} arrow-f id-t0 = arrow-f
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
41 comp {_} {_} {t0} {t0} {t1} arrow-g id-t0 = arrow-g
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
42 comp {_} {_} {t0} {t0} {t0} id-t0 id-t0 = id-t0
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 open TwoHom
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 _×_ : ∀ {c₁ c₂} → {a b c : TwoObject {c₁}} → ( TwoHom {c₁} {c₂} b c ) → ( TwoHom {c₁} {c₂} a b ) → ( TwoHom {c₁} {c₂} a c )
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
47 _×_ {c₁} {c₂} {a} {b} {c} f g = comp {c₁} {c₂} {a} {b} {c} f g
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 -- f g h
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 -- d <- c <- b <- a
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 --
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
53 -- It can be proved without TwoHom constraints
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 assoc-× : {c₁ c₂ : Level } {a b c d : TwoObject {c₁} }
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 {f : (TwoHom {c₁} {c₂ } c d )} →
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 {g : (TwoHom {c₁} {c₂ } b c )} →
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 {h : (TwoHom {c₁} {c₂ } a b )} →
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
59 ( f × (g × h)) ≡ ((f × g) × h )
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
60 assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h} with f | g | h
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
61 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} | id-t0 | id-t0 | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
62 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} | arrow-f | id-t0 | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
63 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} | arrow-g | id-t0 | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
64 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} | id-t1 | arrow-f | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
65 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} | id-t1 | arrow-g | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
66 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} | id-t1 | id-t1 | arrow-f = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
67 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} | id-t1 | id-t1 | arrow-g = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
68 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} | id-t1 | id-t1 | id-t1 = refl
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
69
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
70 TwoId : {c₁ c₂ : Level } (a : TwoObject {c₁} ) → (TwoHom {c₁} {c₂ } a a )
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
71 TwoId {_} {_} t0 = id-t0
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
72 TwoId {_} {_} t1 = id-t1
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
73
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
74 open import Relation.Binary
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
75 open import Relation.Binary.PropositionalEquality renaming ( cong to ≡-cong )
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
76
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
77 TwoCat : {c₁ c₂ : Level } → Category c₁ c₂ c₂
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
78 TwoCat {c₁} {c₂} = record {
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
79 Obj = TwoObject {c₁} ;
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
80 Hom = λ a b → ( TwoHom {c₁} {c₂ } a b ) ;
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
81 _o_ = λ{a} {b} {c} x y → _×_ {c₁ } { c₂} {a} {b} {c} x y ;
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
82 _≈_ = λ x y → x ≡ y ;
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
83 Id = λ{a} → TwoId {c₁ } { c₂} a ;
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
84 isCategory = record {
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
85 isEquivalence = record {refl = refl ; trans = trans ; sym = sym } ;
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
86 identityL = λ{a b f} → identityL {c₁} {c₂ } {a} {b} {f} ;
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
87 identityR = λ{a b f} → identityR {c₁} {c₂ } {a} {b} {f} ;
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
88 o-resp-≈ = λ{a b c f g h i} → o-resp-≈ {c₁} {c₂ } {a} {b} {c} {f} {g} {h} {i} ;
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
89 associative = λ{a b c d f g h } → assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h}
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
90 }
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
91 } where
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
92 identityL : {c₁ c₂ : Level } {A B : TwoObject {c₁}} {f : ( TwoHom {c₁} {c₂ } A B) } → ((TwoId B) × f) ≡ f
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
93 identityL {c₁} {c₂} {a} {b} {f} with f
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
94 identityL {c₁} {c₂} {t1} {t1} | id-t1 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
95 identityL {c₁} {c₂} {t0} {t0} | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
96 identityL {c₁} {c₂} {t0} {t1} | arrow-f = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
97 identityL {c₁} {c₂} {t0} {t1} | arrow-g = refl
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
98 identityR : {c₁ c₂ : Level } {A B : TwoObject {c₁}} {f : ( TwoHom {c₁} {c₂ } A B) } → ( f × TwoId A ) ≡ f
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
99 identityR {c₁} {c₂} {_} {_} {f} with f
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
100 identityR {c₁} {c₂} {t1} {t1} | id-t1 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
101 identityR {c₁} {c₂} {t0} {t0} | id-t0 = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
102 identityR {c₁} {c₂} {t0} {t1} | arrow-f = refl
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
103 identityR {c₁} {c₂} {t0} {t1} | arrow-g = refl
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
104 o-resp-≈ : {c₁ c₂ : Level } {A B C : TwoObject {c₁} } {f g : ( TwoHom {c₁} {c₂ } A B)} {h i : ( TwoHom B C)} →
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
105 f ≡ g → h ≡ i → ( h × f ) ≡ ( i × g )
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
106 o-resp-≈ {c₁} {c₂} {a} {b} {c} {f} {g} {h} {i} f==g h==i =
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
107 let open ≡-Reasoning in begin
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
108 ( h × f )
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
109 ≡⟨ refl ⟩
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
110 comp (h) (f)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
111 ≡⟨ cong (λ x → comp ( h ) x ) f==g ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
112 comp (h) (g)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
113 ≡⟨ cong (λ x → comp x ( g ) ) h==i ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
114 comp (i) (g)
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
115 ≡⟨ refl ⟩
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
116 ( i × g )
449
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
117
156e64d1bce0 on goinhg ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 448
diff changeset
118
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
119 indexFunctor : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( a b : Obj A) ( f g : Hom A a b ) → Functor (TwoCat {c₁} {c₂}) A
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
120 indexFunctor {c₁} {c₂} {ℓ} A a b f g = record {
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 FObj = λ a → fobj a
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 ; FMap = λ {a} {b} f → fmap {a} {b} f
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 ; isFunctor = record {
453
3c2ce4474d92 try incomplete pattern for discrete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 451
diff changeset
124 identity = λ{x} → identity x
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 ; distr = λ {a} {b} {c} {f} {g} → distr1 {a} {b} {c} {f} {g}
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 ; ≈-cong = λ {a} {b} {c} {f} → ≈-cong {a} {b} {c} {f}
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 }
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 } where
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
129 T = TwoCat {c₁} {c₂}
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
130 fobj : Obj T → Obj A
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
131 fobj t0 = a
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
132 fobj t1 = b
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
133 fmap : {x y : Obj T } → (Hom T x y ) → Hom A (fobj x) (fobj y)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
134 fmap {t0} {t0} id-t0 = id1 A a
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
135 fmap {t1} {t1} id-t1 = id1 A b
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
136 fmap {t0} {t1} arrow-f = f
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
137 fmap {t0} {t1} arrow-g = g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
138 ≈-cong : {a : Obj T} {b : Obj T} {f g : Hom T a b} → T [ f ≈ g ] → A [ fmap f ≈ fmap g ]
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
139 ≈-cong {a} {b} {f} {.f} refl = let open ≈-Reasoning A in refl-hom
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
140 identity : (x : Obj T ) -> A [ fmap (id1 T x) ≈ id1 A (fobj x) ]
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
141 identity t0 = let open ≈-Reasoning A in refl-hom
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
142 identity t1 = let open ≈-Reasoning A in refl-hom
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
143 distr1 : {a : Obj T} {b : Obj T} {c : Obj T} {f : Hom T a b} {g : Hom T b c} →
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
144 A [ fmap (T [ g o f ]) ≈ A [ fmap g o fmap f ] ]
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
145 distr1 {a} {b} {c} {f} {g} with f | g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
146 distr1 {t0} {t0} {t0} {f} {g} | id-t0 | id-t0 = let open ≈-Reasoning A in sym-hom idL
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
147 distr1 {t1} {t1} {t1} {f} {g} | id-t1 | id-t1 = let open ≈-Reasoning A in begin
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
148 id1 A b
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
149 ≈↑⟨ idL ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
150 id1 A b o id1 A b
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
151
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
152 distr1 {t0} {t0} {t1} {f} {g} | id-t0 | arrow-f = let open ≈-Reasoning A in begin
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
153 fmap (comp arrow-f id-t0)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
154 ≈⟨⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
155 fmap arrow-f
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
156 ≈↑⟨ idR ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
157 fmap arrow-f o id1 A a
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
158
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
159 distr1 {t0} {t0} {t1} {f} {g} | id-t0 | arrow-g = let open ≈-Reasoning A in begin
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
160 fmap (comp arrow-g id-t0)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
161 ≈⟨⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
162 fmap arrow-g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
163 ≈↑⟨ idR ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
164 fmap arrow-g o id1 A a
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
165
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
166 distr1 {t0} {t1} {t1} {f} {g} | arrow-f | id-t1 = let open ≈-Reasoning A in begin
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
167 fmap (comp id-t1 arrow-f)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
168 ≈⟨⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
169 fmap arrow-f
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
170 ≈↑⟨ idL ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
171 id1 A b o fmap arrow-f
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
172
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
173 distr1 {t0} {t1} {t1} {f} {g} | arrow-g | id-t1 = let open ≈-Reasoning A in begin
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
174 fmap (comp id-t1 arrow-g)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
175 ≈⟨⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
176 fmap arrow-g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
177 ≈↑⟨ idL ⟩
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
178 id1 A b o fmap arrow-g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
179
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
180
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 --- Equalizer
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 --- f
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 --- e -----→
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 --- c -----→ a b
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 --- ^ / -----→
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 --- |k h g
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 --- | /
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 --- | / ^
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 --- | / |
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 --- |/ | Γ
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 --- d _ |
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 --- |\ |
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 --- \ K af
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 --- \ -----→
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 --- \ t0 t1
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 --- -----→
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 --- ag
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 ---
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 ---
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
200
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 open Complete
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 open Limit
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 open NTrans
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
204
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
205 equlimit : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) {a b : Obj A} -> (f g : Hom A a b) (comp : Complete A (TwoCat {c₁} {c₂} )) ->
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
206 Hom A ( limit-c comp (indexFunctor {c₁} {c₂} {ℓ} A a b f g)) a
456
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
207 equlimit {c₁} {c₂} {ℓ} A {a} {b} f g comp = ? -- TMap (limit-u comp (indexFunctor {c₁} {c₂} {ℓ} A a b f g)) t0
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
208
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
209 lim-to-equ : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ)
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
210 (comp : Complete A (TwoCat {c₁} {c₂} ) )
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 → {a b : Obj A} (f g : Hom A a b )
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
212 → (fe=ge : A [ A [ f o (equlimit A f g comp ) ] ≈ A [ g o (equlimit A f g comp ) ] ] )
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
213 → IsEqualizer A (equlimit A f g comp ) f g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
214 lim-to-equ {c₁} {c₂} {ℓ} A comp {a} {b} f g fe=ge = record {
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
215 fe=ge = fe=ge
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 ; k = λ {d} h fh=gh → k {d} h fh=gh
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 ; ek=h = λ {d} {h} {fh=gh} → ek=h d h fh=gh
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 ; uniqueness = λ {d} {h} {fh=gh} {k'} → uniquness d h fh=gh k'
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 } where
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
220 I = TwoCat {c₁} {c₂}
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 Γ : Functor I A
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
222 Γ = indexFunctor {c₁} {c₂} {ℓ} A a b f g
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
223 c = limit-c comp Γ
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
224 k : {d : Obj A} (h : Hom A d a) → A [ A [ f o h ] ≈ A [ g o h ] ] → Hom A d c
456
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
225 nmap : (x : Obj I ) ( d : Obj (A) ) (h : Hom A d a ) → Hom A (FObj (K A I d) x) (FObj Γ x)
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
226 nmap x d h with x
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
227 ... | t0 = h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
228 ... | t1 = A [ f o h ]
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
229 commute1 : {x y : Obj I} {f' : Hom I x y} (d : Obj A) (h : Hom A d a ) → A [ A [ f o h ] ≈ A [ g o h ] ]
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
230 → A [ A [ FMap Γ f' o nmap x d h ] ≈ A [ nmap y d h o FMap (K A I d) f' ] ]
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
231 commute1 {x} {y} {f'} d h fh=gh with f'
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
232 commute1 {t0} {t1} {f'} d h fh=gh | arrow-f = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
233 f o h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
234 ≈↑⟨ idR ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
235 (f o h ) o id1 A d
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
236
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
237 commute1 {t0} {t1} {f'} d h fh=gh | arrow-g = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
238 g o h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
239 ≈↑⟨ fh=gh ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
240 f o h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
241 ≈↑⟨ idR ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
242 (f o h ) o id1 A d
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
243
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
244 commute1 {t0} {t0} {f'} d h fh=gh | id-t0 = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
245 id1 A a o h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
246 ≈⟨ idL ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
247 h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
248 ≈↑⟨ idR ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
249 h o id1 A d
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
250
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
251 commute1 {t1} {t1} {f'} d h fh=gh | id-t1 = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
252 id1 A b o ( f o h )
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
253 ≈⟨ idL ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
254 f o h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
255 ≈↑⟨ idR ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
256 ( f o h ) o id1 A d
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
257
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
258 nat1 : (d : Obj A) → (h : Hom A d a ) → A [ A [ f o h ] ≈ A [ g o h ] ] → NTrans I A (K A I d) Γ
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
259 nat1 d h fh=gh = record {
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
260 TMap = λ x → nmap x d h ;
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
261 isNTrans = record {
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
262 commute = λ {x} {y} {f'} → commute1 {x} {y} {f'} d h fh=gh
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
263 }
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
264 }
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
265 e = equlimit A f g comp
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
266 eqlim = isLimit comp Γ (nat1 c e fe=ge )
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
267 k {d} h fh=gh = limit eqlim d (nat1 d h fh=gh )
455
55a9b6177ed4 on going ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 454
diff changeset
268 ek=h : (d : Obj A ) (h : Hom A d a ) → ( fh=gh : A [ A [ f o h ] ≈ A [ g o h ] ] ) → A [ A [ e o k h fh=gh ] ≈ h ]
456
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
269 ek=h d h fh=gh = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
270 e o k h fh=gh
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
271 ≈⟨ t0f=t eqlim {d} {nat1 d h fh=gh} {t0} ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
272 h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
273
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
274 uniq-nat : {i : Obj I} → (d : Obj A ) (h : Hom A d a ) ( k' : Hom A d c )
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
275 ( fh=gh : A [ A [ f o h ] ≈ A [ g o h ] ]) → A [ A [ e o k' ] ≈ h ] →
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
276 A [ A [ TMap (nat1 c e fe=ge ) i o k' ] ≈ TMap (nat1 d h fh=gh) i ]
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
277 uniq-nat {t0} d h k' fh=gh ek'=h = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
278 (nmap t0 c e ) o k'
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
279 ≈⟨⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
280 e o k'
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
281 ≈⟨ ek'=h ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
282 h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
283 ≈⟨⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
284 nmap t0 d h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
285
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
286 uniq-nat {t1} d h k' fh=gh ek'=h = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
287 (nmap t1 c e ) o k'
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
288 ≈⟨⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
289 (f o e ) o k'
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
290 ≈↑⟨ assoc ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
291 f o ( e o k' )
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
292 ≈⟨ cdr ek'=h ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
293 f o h
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
294 ≈⟨⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
295 TMap (nat1 d h fh=gh) t1
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
296
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
297 uniquness : (d : Obj A ) (h : Hom A d a ) → ( fh=gh : A [ A [ f o h ] ≈ A [ g o h ] ] ) →
448
c2616de4d208 discrete again with negation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 ( k' : Hom A d c )
456
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
299 → A [ A [ e o k' ] ≈ h ] → A [ k h fh=gh ≈ k' ]
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
300 uniquness d h fh=gh k' ek'=h = let open ≈-Reasoning A in begin
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
301 k h fh=gh
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
302 ≈⟨ limit-uniqueness eqlim k' ( λ{i} → uniq-nat {i} d h k' fh=gh ek'=h ) ⟩
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
303 k'
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
304
4d97955ea419 limit with nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 455
diff changeset
305