Mercurial > hg > Members > kono > Proof > category
annotate limit-to.agda @ 433:25478a0ba66b
functor constraint does not work well on distribution law
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 26 Mar 2016 20:00:34 +0900 |
parents | 688066ac172e |
children | 3fdf0aedc21d |
rev | line source |
---|---|
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
1 open import Category -- https://github.com/konn/category-agda |
350 | 2 open import Level |
3 | |
403 | 4 module limit-to where |
350 | 5 |
6 open import cat-utility | |
7 open import HomReasoning | |
8 open import Relation.Binary.Core | |
401
e4c10d6375f6
Maybe Category to-limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
400
diff
changeset
|
9 open import Data.Maybe |
350 | 10 open Functor |
11 | |
12 | |
401
e4c10d6375f6
Maybe Category to-limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
400
diff
changeset
|
13 |
e4c10d6375f6
Maybe Category to-limit
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
400
diff
changeset
|
14 |
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
15 -- If we have limit then we have equalizer |
350 | 16 --- two objects category |
17 --- | |
18 --- f | |
431 | 19 --- -----→ |
350 | 20 --- 0 1 |
431 | 21 --- -----→ |
366 | 22 --- g |
387 | 23 |
350 | 24 |
355
8fd085379380
add DataCategory Universal mapping
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
354
diff
changeset
|
25 |
385 | 26 data TwoObject {c₁ : Level} : Set c₁ where |
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
27 t0 : TwoObject |
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
28 t1 : TwoObject |
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
29 |
424
4329525f5085
fix imit-to-edu for MaybeCat / TwoCat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
423
diff
changeset
|
30 -- constrainted arrow |
4329525f5085
fix imit-to-edu for MaybeCat / TwoCat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
423
diff
changeset
|
31 -- we need inverse of f to complete cases |
431 | 32 data Arrow {c₁ c₂ : Level } ( t00 t11 : TwoObject {c₁} ) : TwoObject {c₁} → TwoObject {c₁} → Set c₂ where |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
33 id-t0 : Arrow t00 t11 t00 t00 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
34 id-t1 : Arrow t00 t11 t11 t11 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
35 arrow-f : Arrow t00 t11 t00 t11 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
36 arrow-g : Arrow t00 t11 t00 t11 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
37 inv-f : Arrow t00 t11 t11 t00 |
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
38 |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
39 record TwoHom {c₁ c₂ : Level} (a b : TwoObject {c₁} ) : Set c₂ where |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
40 field |
422 | 41 hom : Maybe ( Arrow {c₁} {c₂} t0 t1 a b ) |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
42 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
43 open TwoHom |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
44 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
45 -- arrow composition |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
46 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
47 |
431 | 48 comp : ∀ {c₁ c₂} → {a b c : TwoObject {c₁}} → Maybe ( Arrow {c₁} {c₂} t0 t1 b c ) → Maybe ( Arrow {c₁} {c₂} t0 t1 a b ) → Maybe ( Arrow {c₁} {c₂} t0 t1 a c ) |
422 | 49 comp {_} {_} {_} {_} {_} nothing _ = nothing |
50 comp {_} {_} {_} {_} {_} (just _ ) nothing = nothing | |
51 comp {_} {_} {t0} {t1} {t1} (just id-t1 ) ( just arrow-f ) = just arrow-f | |
52 comp {_} {_} {t0} {t1} {t1} (just id-t1 ) ( just arrow-g ) = just arrow-g | |
53 comp {_} {_} {t1} {t1} {t1} (just id-t1 ) ( just id-t1 ) = just id-t1 | |
54 comp {_} {_} {t1} {t1} {t0} (just inv-f ) ( just id-t1 ) = just inv-f | |
55 comp {_} {_} {t0} {t0} {t1} (just arrow-f ) ( just id-t0 ) = just arrow-f | |
56 comp {_} {_} {t0} {t0} {t1} (just arrow-g ) ( just id-t0 ) = just arrow-g | |
57 comp {_} {_} {t0} {t0} {t0} (just id-t0 ) ( just id-t0 ) = just id-t0 | |
58 comp {_} {_} {t1} {t0} {t0} (just id-t0 ) ( just inv-f ) = just inv-f | |
59 comp {_} {_} {_} {_} {_} (just _ ) ( just _ ) = nothing | |
60 | |
61 | |
431 | 62 _×_ : ∀ {c₁ c₂} → {a b c : TwoObject {c₁}} → ( TwoHom {c₁} {c₂} b c ) → ( TwoHom {c₁} {c₂} a b ) → ( TwoHom {c₁} {c₂} a c ) |
422 | 63 _×_ {c₁} {c₂} {a} {b} {c} f g = record { hom = comp {c₁} {c₂} {a} {b} {c} (hom f) (hom g ) } |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
64 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
65 |
431 | 66 _==_ : ∀{ c₁ c₂ a b } → Rel (Maybe (Arrow {c₁} {c₂} t0 t1 a b )) (c₂) |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
67 _==_ = Eq _≡_ |
414
28249d32b700
Maybe does not help conflict ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
413
diff
changeset
|
68 |
431 | 69 map2hom : ∀{ c₁ c₂ } → {a b : TwoObject {c₁}} → Maybe ( Arrow {c₁} {c₂} t0 t1 a b ) → TwoHom {c₁} {c₂ } a b |
422 | 70 map2hom {_} {_} {t1} {t1} (just id-t1) = record { hom = just id-t1 } |
71 map2hom {_} {_} {t0} {t1} (just arrow-f) = record { hom = just arrow-f } | |
72 map2hom {_} {_} {t0} {t1} (just arrow-g) = record { hom = just arrow-g } | |
73 map2hom {_} {_} {t0} {t0} (just id-t0) = record { hom = just id-t0 } | |
74 map2hom {_} {_} {_} {_} _ = record { hom = nothing } | |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
75 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
76 record TwoHom1 {c₁ c₂ : Level} (a : TwoObject {c₁} ) (b : TwoObject {c₁} ) : Set c₂ where |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
77 field |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
78 Map : TwoHom {c₁} {c₂ } a b |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
79 iso-Map : Map ≡ map2hom ( hom Map ) |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
80 |
422 | 81 open TwoHom1 |
82 | |
431 | 83 ==refl : ∀{ c₁ c₂ a b } → ∀ {x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → x == x |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
84 ==refl {_} {_} {_} {_} {just x} = just refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
85 ==refl {_} {_} {_} {_} {nothing} = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
86 |
431 | 87 ==sym : ∀{ c₁ c₂ a b } → ∀ {x y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → x == y → y == x |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
88 ==sym (just x≈y) = just (≡-sym x≈y) |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
89 ==sym nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
90 |
431 | 91 ==trans : ∀{ c₁ c₂ a b } → ∀ {x y z : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) } → |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
92 x == y → y == z → x == z |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
93 ==trans (just x≈y) (just y≈z) = just (≡-trans x≈y y≈z) |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
94 ==trans nothing nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
95 |
431 | 96 ==cong : ∀{ c₁ c₂ a b c d } → ∀ {x y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → |
97 (f : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) → Maybe (Arrow {c₁} {c₂} t0 t1 c d ) ) → x == y → f x == f y | |
422 | 98 ==cong { c₁} {c₂} {a} {b } {c} {d} {nothing} {nothing} f nothing = ==refl |
99 ==cong { c₁} {c₂} {a} {b } {c} {d} {just x} {just .x} f (just refl) = ==refl | |
420
3e44951b9bdb
refl in free-monoid trouble
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
100 |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
101 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
102 module ==-Reasoning {c₁ c₂ : Level} where |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
103 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
104 infixr 2 _∎ |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
105 infixr 2 _==⟨_⟩_ _==⟨⟩_ |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
106 infix 1 begin_ |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
107 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
108 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
109 data _IsRelatedTo_ {c₁ c₂ : Level} {a b : TwoObject {c₁} } (x y : (Maybe (Arrow {c₁} {c₂} t0 t1 a b ))) : |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
110 Set c₂ where |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
111 relTo : (x≈y : x == y ) → x IsRelatedTo y |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
112 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
113 begin_ : { a b : TwoObject {c₁} } {x : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) } {y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} → |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
114 x IsRelatedTo y → x == y |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
115 begin relTo x≈y = x≈y |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
116 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
117 _==⟨_⟩_ : { a b : TwoObject {c₁} } (x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )) {y z : Maybe (Arrow {c₁} {c₂} t0 t1 a b ) } → |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
118 x == y → y IsRelatedTo z → x IsRelatedTo z |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
119 _ ==⟨ x≈y ⟩ relTo y≈z = relTo (==trans x≈y y≈z) |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
120 |
422 | 121 |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
122 _==⟨⟩_ : { a b : TwoObject {c₁} }(x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )) {y : Maybe (Arrow {c₁} {c₂} t0 t1 a b )} |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
123 → x IsRelatedTo y → x IsRelatedTo y |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
124 _ ==⟨⟩ x≈y = x≈y |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
125 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
126 _∎ : { a b : TwoObject {c₁} }(x : Maybe (Arrow {c₁} {c₂} t0 t1 a b )) → x IsRelatedTo x |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
127 _∎ _ = relTo ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
128 |
410 | 129 |
422 | 130 -- TwoHom1Eq : {c₁ c₂ : Level } {a b : TwoObject {c₁} } {f g : ( TwoHom1 {c₁} {c₂ } a b)} → |
131 -- hom (Map f) == hom (Map g) → f == g | |
132 -- TwoHom1Eq = ? | |
133 | |
406
2fbd92ddecb5
non recorded arrow does not work
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
405
diff
changeset
|
134 |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
135 -- f g h |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
136 -- d <- c <- b <- a |
420
3e44951b9bdb
refl in free-monoid trouble
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
137 -- |
3e44951b9bdb
refl in free-monoid trouble
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
138 -- It can be proved without Arrow constraints |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
139 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
140 assoc-× : {c₁ c₂ : Level } {a b c d : TwoObject {c₁} } |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
141 {f : (TwoHom {c₁} {c₂ } c d )} → |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
142 {g : (TwoHom {c₁} {c₂ } b c )} → |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
143 {h : (TwoHom {c₁} {c₂ } a b )} → |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
144 hom ( f × (g × h)) == hom ((f × g) × h ) |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
145 assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h} with hom f | hom g | hom h |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
146 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
147 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
148 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
149 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
150 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
151 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
152 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
153 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
154 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
155 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
156 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
157 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
158 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
159 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
160 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t0} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
161 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | nothing | _ | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
162 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
163 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
164 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
165 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
166 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
167 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
168 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
169 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
170 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
171 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
172 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
173 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
174 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
175 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
176 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t0} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
177 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | just _ | nothing | _ = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
178 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | just id-t0 | just id-t0 | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
179 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just arrow-f | just id-t0 | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
180 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just arrow-g | just id-t0 | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
181 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-f | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
182 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-g | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
183 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | just arrow-f = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
184 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | just arrow-g = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
185 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | just id-t1 = ==refl |
424
4329525f5085
fix imit-to-edu for MaybeCat / TwoCat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
423
diff
changeset
|
186 -- remaining all failure case (except inf-f case ) |
418 | 187 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t0} {f} {g} {h} | just id-t0 | just id-t0 | nothing = nothing |
188 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t0} {f} {g} {h} | just id-t0 | just id-t0 | nothing = nothing | |
189 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | nothing = nothing | |
190 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t1} {f} {g} {h} | just id-t1 | just id-t1 | nothing = nothing | |
191 assoc-× {c₁} {c₂} {t0} {t1} {t0} {t0} {f} {g} {h} | just id-t0 | just inv-f | nothing = nothing | |
192 assoc-× {c₁} {c₂} {t1} {t1} {t0} {t0} {f} {g} {h} | just id-t0 | just inv-f | nothing = nothing | |
193 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t1} {f} {g} {h} | just arrow-f | just id-t0 | nothing = nothing | |
194 assoc-× {c₁} {c₂} {t1} {t0} {t0} {t1} {f} {g} {h} | just arrow-g | just id-t0 | nothing = nothing | |
195 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just arrow-f | just id-t0 | nothing = nothing | |
196 assoc-× {c₁} {c₂} {t0} {t0} {t0} {t1} {f} {g} {h} | just arrow-g | just id-t0 | nothing = nothing | |
197 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-f | nothing = nothing | |
198 assoc-× {c₁} {c₂} {t0} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-g | nothing = nothing | |
199 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-f | nothing = nothing | |
200 assoc-× {c₁} {c₂} {t1} {t0} {t1} {t1} {f} {g} {h} | just id-t1 | just arrow-g | nothing = nothing | |
201 assoc-× {c₁} {c₂} {t0} {t1} {t1} {t0} {f} {g} {h} | just inv-f | just id-t1 | nothing = nothing | |
202 assoc-× {c₁} {c₂} {t1} {t1} {t1} {t0} {f} {g} {h} | just inv-f | just id-t1 | nothing = nothing | |
203 assoc-× {_} {_} {t0} {t0} {t1} {t0} {_} {_} {_} | (just _) | (just _) | nothing = nothing | |
204 assoc-× {_} {_} {t0} {t1} {t0} {t1} {_} {_} {_} | (just _) | (just _) | nothing = nothing | |
205 assoc-× {_} {_} {t1} {t0} {t1} {t0} {_} {_} {_} | (just _) | (just _) | nothing = nothing | |
206 assoc-× {_} {_} {t1} {t1} {t0} {t1} {_} {_} {_} | (just _) | (just _) | nothing = nothing | |
207 assoc-× {_} {_} {t0} {t0} {t1} {t0} {_} {_} {_} | (just _) | (just arrow-f) | (just id-t0) = nothing | |
208 assoc-× {_} {_} {t0} {t0} {t1} {t0} {_} {_} {_} | (just _) | (just arrow-g) | (just id-t0) = nothing | |
209 assoc-× {_} {_} {t0} {t1} {t0} {t0} {_} {_} {_} | (just id-t0) | (just inv-f) | (just _) = nothing | |
210 assoc-× {_} {_} {t0} {t1} {t0} {t1} {_} {_} {_} | (just _) | (just _) | (just _) = nothing | |
211 assoc-× {_} {_} {t0} {t1} {t1} {t0} {_} {_} {_} | (just inv-f) | (just id-t1) | (just arrow-f) = nothing | |
212 assoc-× {_} {_} {t0} {t1} {t1} {t0} {_} {_} {_} | (just inv-f) | (just id-t1) | (just arrow-g) = nothing | |
213 assoc-× {_} {_} {t1} {t0} {t0} {t0} {_} {_} {_} | (just id-t0) | (just id-t0) | (just inv-f) = ==refl | |
214 assoc-× {_} {_} {t1} {t0} {t0} {t1} {_} {_} {_} | (just arrow-f) | (just id-t0) | (just inv-f) = nothing | |
215 assoc-× {_} {_} {t1} {t0} {t0} {t1} {_} {_} {_} | (just arrow-g) | (just id-t0) | (just inv-f) = nothing | |
216 assoc-× {_} {_} {t1} {t0} {t1} {t0} {_} {_} {_} | (just _) | (just _) | (just _) = nothing | |
217 assoc-× {_} {_} {t1} {t0} {t1} {t1} {_} {_} {_} | (just id-t1) | (just arrow-f) | (just _) = nothing | |
218 assoc-× {_} {_} {t1} {t0} {t1} {t1} {_} {_} {_} | (just id-t1) | (just arrow-g) | (just _) = nothing | |
219 assoc-× {_} {_} {t1} {t1} {t0} {t0} {_} {_} {_} | (just id-t0) | (just inv-f) | (just id-t1) = ==refl | |
220 assoc-× {_} {_} {t1} {t1} {t0} {t1} {_} {_} {_} | (just arrow-f) | (just inv-f) | (just id-t1) = ==refl | |
221 assoc-× {_} {_} {t1} {t1} {t0} {t1} {_} {_} {_} | (just arrow-g) | (just inv-f) | (just id-t1) = ==refl | |
222 assoc-× {_} {_} {t1} {t1} {t1} {t0} {_} {_} {_} | (just inv-f) | (just id-t1) | (just id-t1) = ==refl | |
223 | |
404 | 224 |
409 | 225 |
431 | 226 TwoId : {c₁ c₂ : Level } (a : TwoObject {c₁} ) → (TwoHom {c₁} {c₂ } a a ) |
422 | 227 TwoId {_} {_} t0 = record { hom = just id-t0 } |
228 TwoId {_} {_} t1 = record { hom = just id-t1 } | |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
229 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
230 open import maybeCat |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
231 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
232 -- identityL {c₁} {c₂} {_} {b} {nothing} = let open ==-Reasoning {c₁} {c₂} in |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
233 -- begin |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
234 -- (TwoId b × nothing) |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
235 -- ==⟨ {!!} ⟩ |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
236 -- nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
237 -- ∎ |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
238 |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
239 open import Relation.Binary |
431 | 240 TwoCat : {c₁ c₂ ℓ : Level } → Category c₁ c₂ c₂ |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
241 TwoCat {c₁} {c₂} {ℓ} = record { |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
242 Obj = TwoObject {c₁} ; |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
243 Hom = λ a b → ( TwoHom {c₁} {c₂ } a b ) ; |
431 | 244 _o_ = λ{a} {b} {c} x y → _×_ {c₁ } { c₂} {a} {b} {c} x y ; |
245 _≈_ = λ x y → hom x == hom y ; | |
246 Id = λ{a} → TwoId {c₁ } { c₂} a ; | |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
247 isCategory = record { |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
248 isEquivalence = record {refl = ==refl ; trans = ==trans ; sym = ==sym } ; |
431 | 249 identityL = λ{a b f} → identityL {c₁} {c₂ } {a} {b} {f} ; |
250 identityR = λ{a b f} → identityR {c₁} {c₂ } {a} {b} {f} ; | |
251 o-resp-≈ = λ{a b c f g h i} → o-resp-≈ {c₁} {c₂ } {a} {b} {c} {f} {g} {h} {i} ; | |
252 associative = λ{a b c d f g h } → assoc-× {c₁} {c₂} {a} {b} {c} {d} {f} {g} {h} | |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
253 } |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
254 } where |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
255 identityL : {c₁ c₂ : Level } {A B : TwoObject {c₁}} {f : ( TwoHom {c₁} {c₂ } A B) } → hom ((TwoId B) × f) == hom f |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
256 identityL {c₁} {c₂} {_} {_} {f} with hom f |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
257 identityL {c₁} {c₂} {t0} {t0} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
258 identityL {c₁} {c₂} {t0} {t1} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
259 identityL {c₁} {c₂} {t1} {t0} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
260 identityL {c₁} {c₂} {t1} {t1} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
261 identityL {c₁} {c₂} {t1} {t0} {_} | just inv-f = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
262 identityL {c₁} {c₂} {t1} {t1} {_} | just id-t1 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
263 identityL {c₁} {c₂} {t0} {t0} {_} | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
264 identityL {c₁} {c₂} {t0} {t1} {_} | just arrow-f = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
265 identityL {c₁} {c₂} {t0} {t1} {_} | just arrow-g = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
266 identityR : {c₁ c₂ : Level } {A B : TwoObject {c₁}} {f : ( TwoHom {c₁} {c₂ } A B) } → hom ( f × TwoId A ) == hom f |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
267 identityR {c₁} {c₂} {_} {_} {f} with hom f |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
268 identityR {c₁} {c₂} {t0} {t0} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
269 identityR {c₁} {c₂} {t0} {t1} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
270 identityR {c₁} {c₂} {t1} {t0} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
271 identityR {c₁} {c₂} {t1} {t1} {_} | nothing = nothing |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
272 identityR {c₁} {c₂} {t1} {t0} {_} | just inv-f = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
273 identityR {c₁} {c₂} {t1} {t1} {_} | just id-t1 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
274 identityR {c₁} {c₂} {t0} {t0} {_} | just id-t0 = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
275 identityR {c₁} {c₂} {t0} {t1} {_} | just arrow-f = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
276 identityR {c₁} {c₂} {t0} {t1} {_} | just arrow-g = ==refl |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
277 o-resp-≈ : {c₁ c₂ : Level } {A B C : TwoObject {c₁} } {f g : ( TwoHom {c₁} {c₂ } A B)} {h i : ( TwoHom B C)} → |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
278 hom f == hom g → hom h == hom i → hom ( h × f ) == hom ( i × g ) |
422 | 279 o-resp-≈ {c₁} {c₂} {a} {b} {c} {f} {g} {h} {i} f==g h==i = |
280 let open ==-Reasoning {c₁} {c₂ } in begin | |
281 hom ( h × f ) | |
282 ==⟨⟩ | |
283 comp (hom h) (hom f) | |
431 | 284 ==⟨ ==cong (λ x → comp ( hom h ) x ) f==g ⟩ |
422 | 285 comp (hom h) (hom g) |
431 | 286 ==⟨ ==cong (λ x → comp x ( hom g ) ) h==i ⟩ |
422 | 287 comp (hom i) (hom g) |
288 ==⟨⟩ | |
289 hom ( i × g ) | |
290 ∎ | |
420
3e44951b9bdb
refl in free-monoid trouble
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
291 |
426 | 292 record Nil {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) : Set ( c₁ ⊔ c₂ ⊔ ℓ ) where |
293 field | |
431 | 294 nil : {a b : Obj A } → Hom A a b |
295 nil-id : {a : Obj A } → A [ nil {a} {a} ≈ id1 A a ] | |
296 nil-idL : {a b c : Obj A } → { f : Hom A a b } → A [ A [ nil {b} {c} o f ] ≈ nil {a} {c} ] | |
297 nil-idR : {a b c : Obj A } → { f : Hom A b c } → A [ A [ f o nil {a} {b} ] ≈ nil {a} {c} ] | |
426 | 298 |
299 open Nil | |
300 | |
431 | 301 justFunctor : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) → Nil A → Functor (MaybeCat A ) A |
426 | 302 justFunctor{c₁} {c₂} {ℓ} A none = record { |
303 FObj = λ a → fobj a | |
304 ; FMap = λ {a} {b} f → fmap {a} {b} f | |
305 ; isFunctor = record { | |
431 | 306 identity = λ{x} → identity {x} |
307 ; distr = λ {a} {b} {c} {f} {g} → distr2 {a} {b} {c} {f} {g} | |
308 ; ≈-cong = λ {a} {b} {c} {f} → ≈-cong {a} {b} {c} {f} | |
426 | 309 } |
310 } where | |
311 MA = MaybeCat A | |
431 | 312 fobj : Obj MA → Obj A |
313 fobj = λ x → x | |
314 fmap : {x y : Obj MA } → Hom MA x y → Hom A x y | |
426 | 315 fmap {x} {y} f with MaybeHom.hom f |
316 fmap {x} {y} _ | nothing = nil none | |
317 fmap {x} {y} _ | (just f) = f | |
431 | 318 identity : {x : Obj MA} → A [ fmap (id1 MA x) ≈ id1 A (fobj x) ] |
426 | 319 identity = let open ≈-Reasoning (A) in refl-hom |
320 distr2 : {a : Obj MA} {b : Obj MA} {c : Obj MA} {f : Hom MA a b} {g : Hom MA b c} → A [ fmap (MA [ g o f ]) ≈ A [ fmap g o fmap f ] ] | |
321 distr2 {a} {b} {c} {f} {g} with MaybeHom.hom f | MaybeHom.hom g | |
322 distr2 | nothing | nothing = let open ≈-Reasoning (A) in sym ( nil-idR none ) | |
323 distr2 | nothing | just ga = let open ≈-Reasoning (A) in sym ( nil-idR none ) | |
324 distr2 | just fa | nothing = let open ≈-Reasoning (A) in sym ( nil-idL none ) | |
325 distr2 | just f | just g = let open ≈-Reasoning (A) in refl-hom | |
326 ≈-cong : {a : Obj MA} {b : Obj MA} {f g : Hom MA a b} → MA [ f ≈ g ] → A [ fmap f ≈ fmap g ] | |
327 ≈-cong {a} {b} {f} {g} eq with MaybeHom.hom f | MaybeHom.hom g | |
328 ≈-cong {a} {b} {f} {g} nothing | nothing | nothing = let open ≈-Reasoning (A) in refl-hom | |
329 ≈-cong {a} {b} {f} {g} (just eq) | just _ | just _ = eq | |
330 | |
432
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
331 -- indexFunctor' : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (none : Nil A) ( a b : Obj A) ( f g : Hom A a b ) |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
332 -- → ( obj→ : Obj A -> TwoObject {c₁} ) |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
333 -- → ( hom→ : { a b : Obj A } -> Hom A a b -> Arrow t0 t0 (obj→ a) (obj→ b) ) |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
334 -- → ( { x y : Obj A } { h i : Hom A x y } -> A [ h ≈ i ] → hom→ h ≡ hom→ i ) |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
335 -- → Functor A A |
433
25478a0ba66b
functor constraint does not work well on distribution law
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
432
diff
changeset
|
336 -- this one does not work on fmap ( g o f ) ≈ ( fmap g o fmap f ) |
25478a0ba66b
functor constraint does not work well on distribution law
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
432
diff
changeset
|
337 -- because g o f can be arrow-f when g is arrow-g |
25478a0ba66b
functor constraint does not work well on distribution law
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
432
diff
changeset
|
338 -- ideneity and ≈-cong are easy |
432
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
339 |
388 | 340 |
431 | 341 indexFunctor : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (none : Nil A) ( a b : Obj A) ( f g : Hom A a b ) → Functor (TwoCat {c₁} {c₂} {c₂} ) A |
427 | 342 indexFunctor {c₁} {c₂} {ℓ} A none a b f g = record { |
343 FObj = λ a → fobj a | |
344 ; FMap = λ {a} {b} f → fmap {a} {b} f | |
345 ; isFunctor = record { | |
431 | 346 identity = λ{x} → identity {x} |
347 ; distr = λ {a} {b} {c} {f} {g} → distr1 {a} {b} {c} {f} {g} | |
348 ; ≈-cong = λ {a} {b} {c} {f} → ≈-cong {a} {b} {c} {f} | |
427 | 349 } |
350 } where | |
351 I = TwoCat {c₁} {c₂} {ℓ} | |
431 | 352 fobj : Obj I → Obj A |
427 | 353 fobj t0 = a |
354 fobj t1 = b | |
431 | 355 fmap : {x y : Obj I } → (TwoHom {c₁} {c₂} x y ) → Hom A (fobj x) (fobj y) |
427 | 356 fmap {x} {y} h with hom h |
357 fmap {t0} {t0} h | just id-t0 = id1 A a | |
358 fmap {t1} {t1} h | just id-t1 = id1 A b | |
359 fmap {t0} {t1} h | just arrow-f = f | |
360 fmap {t0} {t1} h | just arrow-g = g | |
361 fmap {_} {_} h | _ = nil none | |
362 open ≈-Reasoning A | |
363 ≈-cong : {a : Obj I} {b : Obj I} {f g : Hom I a b} → I [ f ≈ g ] → A [ fmap f ≈ fmap g ] | |
364 ≈-cong {a} {b} {f1} {g1} f≈g with hom f1 | hom g1 | |
365 ≈-cong {t0} {t0} {f1} {g1} nothing | nothing | nothing = refl-hom | |
366 ≈-cong {t0} {t1} {f1} {g1} nothing | nothing | nothing = refl-hom | |
367 ≈-cong {t1} {t0} {f1} {g1} nothing | nothing | nothing = refl-hom | |
368 ≈-cong {t1} {t1} {f1} {g1} nothing | nothing | nothing = refl-hom | |
369 ≈-cong {t0} {t0} {f1} {g1} (just refl) | just id-t0 | just id-t0 = refl-hom | |
370 ≈-cong {t1} {t1} {f1} {g1} (just refl) | just id-t1 | just id-t1 = refl-hom | |
371 ≈-cong {t0} {t1} {f1} {g1} (just refl) | just arrow-f | just arrow-f = refl-hom | |
372 ≈-cong {t0} {t1} {f1} {g1} (just refl) | just arrow-g | just arrow-g = refl-hom | |
373 ≈-cong {t1} {t0} {f1} {g1} (just refl) | just inv-f | just inv-f = refl-hom | |
374 identity : {x : Obj I} → A [ fmap ( id1 I x ) ≈ id1 A (fobj x) ] | |
375 identity {t0} = refl-hom | |
376 identity {t1} = refl-hom | |
377 distr1 : {a₁ : Obj I} {b₁ : Obj I} {c : Obj I} {f₁ : Hom I a₁ b₁} {g₁ : Hom I b₁ c} → | |
378 A [ fmap (I [ g₁ o f₁ ]) ≈ A [ fmap g₁ o fmap f₁ ] ] | |
379 distr1 {a1} {b1} {c1} {f1} {g1} with hom g1 | hom f1 | |
380 distr1 {t0} {t0} {t0} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
381 distr1 {t0} {t0} {t1} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
382 distr1 {t0} {t1} {t0} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
383 distr1 {t0} {t1} {t1} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
384 distr1 {t1} {t0} {t0} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
385 distr1 {t1} {t0} {t1} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
386 distr1 {t1} {t1} {t0} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
387 distr1 {t1} {t1} {t1} {f1} {g1} | nothing | nothing = sym ( nil-idR none ) | |
388 distr1 {t0} {t0} {t0} {f1} {g1} | nothing | just id-t0 = sym ( nil-idL none ) | |
389 distr1 {t0} {t0} {t1} {f1} {g1} | nothing | just id-t0 = sym ( nil-idL none ) | |
390 distr1 {t1} {t1} {t0} {f1} {g1} | nothing | just id-t1 = sym ( nil-idL none ) | |
391 distr1 {t1} {t1} {t1} {f1} {g1} | nothing | just id-t1 = sym ( nil-idL none ) | |
392 distr1 {t0} {t1} {t1} {f1} {g1} | nothing | just arrow-f = sym ( nil-idL none ) | |
393 distr1 {t0} {t1} {t0} {f1} {g1} | nothing | just arrow-f = sym ( nil-idL none ) | |
394 distr1 {t0} {t1} {t1} {f1} {g1} | nothing | just arrow-g = sym ( nil-idL none ) | |
395 distr1 {t0} {t1} {t0} {f1} {g1} | nothing | just arrow-g = sym ( nil-idL none ) | |
396 distr1 {t1} {t0} {t0} {f1} {g1} | nothing | just inv-f = sym ( nil-idL none ) | |
397 distr1 {t1} {t0} {t1} {f1} {g1} | nothing | just inv-f = sym ( nil-idL none ) | |
398 distr1 {t0} {t0} {t0} {f1} {g1} | just id-t0 | nothing = sym ( nil-idR none ) | |
399 distr1 {t1} {t0} {t0} {f1} {g1} | just id-t0 | nothing = sym ( nil-idR none ) | |
400 distr1 {t0} {t1} {t1} {f1} {g1} | just id-t1 | nothing = sym ( nil-idR none ) | |
401 distr1 {t1} {t1} {t1} {f1} {g1} | just id-t1 | nothing = sym ( nil-idR none ) | |
402 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-f | nothing = sym ( nil-idR none ) | |
403 distr1 {t1} {t0} {t1} {f1} {g1} | just arrow-f | nothing = sym ( nil-idR none ) | |
404 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-g | nothing = sym ( nil-idR none ) | |
405 distr1 {t1} {t0} {t1} {f1} {g1} | just arrow-g | nothing = sym ( nil-idR none ) | |
406 distr1 {t0} {t1} {t0} {f1} {g1} | just inv-f | nothing = sym ( nil-idR none ) | |
407 distr1 {t1} {t1} {t0} {f1} {g1} | just inv-f | nothing = sym ( nil-idR none ) | |
408 distr1 {t0} {t0} {t0} {f1} {g1} | just id-t0 | just id-t0 = sym idL | |
409 distr1 {t1} {t0} {t0} {f1} {g1} | just id-t0 | just inv-f = sym idL | |
410 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-f | just id-t0 = sym idR | |
411 distr1 {t0} {t0} {t1} {f1} {g1} | just arrow-g | just id-t0 = sym idR | |
412 distr1 {t1} {t1} {t1} {f1} {g1} | just id-t1 | just id-t1 = sym idL | |
413 distr1 {t0} {t1} {t1} {f1} {g1} | just id-t1 | just arrow-f = sym idL | |
414 distr1 {t0} {t1} {t1} {f1} {g1} | just id-t1 | just arrow-g = sym idL | |
415 distr1 {t1} {t1} {t0} {f1} {g1} | just inv-f | just id-t1 = sym ( nil-idL none ) | |
416 distr1 {t0} {t1} {t0} {_} {_} | (just inv-f) | (just _) = sym ( nil-idL none ) | |
417 distr1 {t1} {t0} {t1} {_} {_} | (just arrow-f) | (just _) = sym ( nil-idR none ) | |
418 distr1 {t1} {t0} {t1} {_} {_} | (just arrow-g) | (just _) = sym ( nil-idR none ) | |
419 | |
420 | |
365 | 421 |
387 | 422 --- Equalizer |
423 --- f | |
431 | 424 --- e -----→ |
425 --- c -----→ a b | |
426 --- ^ / -----→ | |
387 | 427 --- |k h g |
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
428 --- | / |
426 | 429 --- | / ^ |
430 --- | / | | |
431 --- |/ | Γ | |
432 --- d _ | | |
432
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
433 --- |\ | |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
434 --- \ K af |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
435 --- \ -----→ |
688066ac172e
add another method as a comment
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
436 --- \ t0 t1 |
431 | 437 --- -----→ |
426 | 438 --- ag |
439 --- | |
440 --- | |
387 | 441 |
350 | 442 open Limit |
352 | 443 |
431 | 444 I' : {c₁ c₂ ℓ : Level} → Category c₁ c₂ c₂ |
425 | 445 I' {c₁} {c₂} {ℓ} = TwoCat {c₁} {c₂} {ℓ} |
424
4329525f5085
fix imit-to-edu for MaybeCat / TwoCat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
423
diff
changeset
|
446 |
427 | 447 lim-to-equ : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( none : Nil A ) |
448 (lim : ( Γ : Functor (I' {c₁} {c₂} {ℓ}) A ) → {a0 : Obj A } | |
449 {u : NTrans I' A ( K A I' a0 ) Γ } → Limit A I' Γ a0 u ) -- completeness | |
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
450 → {a b c : Obj A} (f g : Hom A a b ) |
365 | 451 → (e : Hom A c a ) → (fe=ge : A [ A [ f o e ] ≈ A [ g o e ] ] ) → Equalizer A e f g |
427 | 452 lim-to-equ {c₁} {c₂} {ℓ } A none lim {a} {b} {c} f g e fe=ge = record { |
350 | 453 fe=ge = fe=ge |
454 ; k = λ {d} h fh=gh → k {d} h fh=gh | |
373 | 455 ; ek=h = λ {d} {h} {fh=gh} → ek=h d h fh=gh |
417
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
456 ; uniqueness = λ {d} {h} {fh=gh} {k'} → uniquness d h fh=gh k' |
1e76e611d454
with inv-f, distribution law passed.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
416
diff
changeset
|
457 } where |
428 | 458 open ≈-Reasoning A |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
459 I : Category c₁ c₂ c₂ |
425 | 460 I = I' {c₁} {c₂} {ℓ} |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
461 Γ : Functor I A |
427 | 462 Γ = indexFunctor {c₁} {c₂} {ℓ} A none a b f g |
431 | 463 nmap : (x : Obj I ) ( d : Obj (A) ) (h : Hom A d a ) → Hom A (FObj (K A I d) x) (FObj Γ x) |
427 | 464 nmap x d h with x |
465 ... | t0 = h | |
431 | 466 ... | t1 = A [ f o h ] |
467 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 ] ] | |
427 | 468 → A [ A [ FMap Γ f' o nmap x d h ] ≈ A [ nmap y d h o FMap (K A I d) f' ] ] |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
469 commute1 {x} {y} {f'} d h fh=gh with hom f' |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
470 commute1 {t0} {t0} {f'} d h fh=gh | nothing = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
471 nil none o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
472 ≈⟨ car ( nil-id none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
473 id1 A a o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
474 ≈⟨ idL ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
475 h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
476 ≈↑⟨ idR ⟩ |
428 | 477 h o id1 A d |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
478 ∎ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
479 commute1 {t0} {t1} {f'} d h fh=gh | nothing = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
480 nil none o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
481 ≈↑⟨ car ( nil-idL none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
482 (nil none o f ) o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
483 ≈⟨ car ( car ( nil-id none ) ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
484 (id1 A b o f ) o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
485 ≈⟨ car idL ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
486 f o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
487 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
488 (f o h ) o id1 A d |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
489 ∎ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
490 commute1 {t1} {t0} {f'} d h fh=gh | nothing = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
491 nil none o ( f o h ) |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
492 ≈⟨ assoc ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
493 ( nil none o f ) o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
494 ≈⟨ car ( nil-idL none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
495 nil none o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
496 ≈⟨ car ( nil-id none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
497 id1 A a o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
498 ≈⟨ idL ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
499 h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
500 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
501 h o id1 A d |
428 | 502 ∎ |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
503 commute1 {t1} {t1} {f'} d h fh=gh | nothing = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
504 nil none o ( f o h ) |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
505 ≈⟨ car ( nil-id none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
506 id1 A b o ( f o h ) |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
507 ≈⟨ idL ⟩ |
428 | 508 f o h |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
509 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
510 ( f o h ) o id1 A d |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
511 ∎ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
512 commute1 {t1} {t0} {f'} d h fh=gh | just inv-f = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
513 nil none o ( f o h ) |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
514 ≈⟨ assoc ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
515 ( nil none o f ) o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
516 ≈⟨ car ( nil-idL none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
517 nil none o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
518 ≈⟨ car ( nil-id none ) ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
519 id1 A a o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
520 ≈⟨ idL ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
521 h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
522 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
523 h o id1 A d |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
524 ∎ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
525 commute1 {t0} {t1} {f'} d h fh=gh | just arrow-f = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
526 f o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
527 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
528 (f o h ) o id1 A d |
428 | 529 ∎ |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
530 commute1 {t0} {t1} {f'} d h fh=gh | just arrow-g = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
531 g o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
532 ≈↑⟨ fh=gh ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
533 f o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
534 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
535 (f o h ) o id1 A d |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
536 ∎ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
537 commute1 {t0} {t0} {f'} d h fh=gh | just id-t0 = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
538 id1 A a o h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
539 ≈⟨ idL ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
540 h |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
541 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
542 h o id1 A d |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
543 ∎ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
544 commute1 {t1} {t1} {f'} d h fh=gh | just id-t1 = begin |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
545 id1 A b o ( f o h ) |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
546 ≈⟨ idL ⟩ |
428 | 547 f o h |
429
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
548 ≈↑⟨ idR ⟩ |
02eefa110eae
nat commute in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
428
diff
changeset
|
549 ( f o h ) o id1 A d |
428 | 550 ∎ |
551 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) Γ | |
552 nat1 d h fh=gh = record { | |
415
dd086f5fb29f
same conflict again ...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
414
diff
changeset
|
553 TMap = λ x → nmap x d h ; |
350 | 554 isNTrans = record { |
431 | 555 commute = λ {x} {y} {f'} → commute1 {x} {y} {f'} d h fh=gh |
350 | 556 } |
557 } | |
430 | 558 eqlim = lim Γ {c} {nat1 c e fe=ge } |
350 | 559 k : {d : Obj A} (h : Hom A d a) → A [ A [ f o h ] ≈ A [ g o h ] ] → Hom A d c |
430 | 560 k {d} h fh=gh = limit eqlim d (nat1 d h fh=gh ) |
431 | 561 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 ] |
430 | 562 ek=h d h fh=gh = begin |
563 e o k h fh=gh | |
564 ≈⟨ t0f=t eqlim {d} {nat1 d h fh=gh} {t0} ⟩ | |
565 h | |
566 ∎ | |
431 | 567 uniq-nat : {i : Obj I} → (d : Obj A ) (h : Hom A d a ) ( k' : Hom A d c ) → A [ A [ e o k' ] ≈ h ] → A [ A [ nmap i c e o k' ] ≈ nmap i d h ] |
430 | 568 uniq-nat {t0} d h k' ek'=h = begin |
569 nmap t0 c e o k' | |
570 ≈⟨⟩ | |
571 e o k' | |
572 ≈⟨ ek'=h ⟩ | |
573 h | |
574 ≈⟨⟩ | |
575 nmap t0 d h | |
576 ∎ | |
577 uniq-nat {t1} d h k' ek'=h = begin | |
578 nmap t1 c e o k' | |
579 ≈⟨⟩ | |
580 (f o e ) o k' | |
581 ≈↑⟨ assoc ⟩ | |
582 f o ( e o k' ) | |
583 ≈⟨ cdr ek'=h ⟩ | |
584 f o h | |
585 ≈⟨⟩ | |
586 nmap t1 d h | |
587 ∎ | |
431 | 588 uniquness : (d : Obj A ) (h : Hom A d a ) → ( fh=gh : A [ A [ f o h ] ≈ A [ g o h ] ] ) → |
372
b4855a3ebd34
add more lemma in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
371
diff
changeset
|
589 ( k' : Hom A d c ) |
431 | 590 → A [ A [ e o k' ] ≈ h ] → A [ k h fh=gh ≈ k' ] |
430 | 591 uniquness d h fh=gh k' ek'=h = begin |
592 k h fh=gh | |
431 | 593 ≈⟨ limit-uniqueness eqlim {d} {nat1 d h fh=gh } {k'} ( λ{i} → uniq-nat {i} d h k' ek'=h ) ⟩ |
430 | 594 k' |
595 ∎ | |
368
b18585089d2e
add more parameter to nat in lim-to-equ
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
367
diff
changeset
|
596 |
372
b4855a3ebd34
add more lemma in limit-to
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
371
diff
changeset
|
597 |
430 | 598 |