annotate CCCGraph1.agda @ 881:da0a1dd0c2ee

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 11 Apr 2020 17:29:45 +0900
parents 543ceeb10191
children 6c69d48e6015
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
832
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 open import Level
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 open import Category
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 module CCCgraph1 where
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 open import HomReasoning
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import cat-utility
838
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
7 open import Relation.Binary.PropositionalEquality hiding ( [_] )
832
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 open import CCC
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 open import graph
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 module ccc-from-graph {c₁ c₂ : Level} (G : Graph {c₁} {c₂} ) where
838
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
12 open import Relation.Binary.PropositionalEquality hiding ( [_] )
841
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 840
diff changeset
13 open import Relation.Binary.Core
832
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open Graph
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 data Objs : Set (c₁ ⊔ c₂) where
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 atom : (vertex G) → Objs
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ⊤ : Objs
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 _∧_ : Objs → Objs → Objs
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 _<=_ : Objs → Objs → Objs
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
837
d809e2502be4 concat defined
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 836
diff changeset
22 data Arrow : Objs → Objs → Set (c₁ ⊔ c₂) where --- case i
832
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 arrow : {a b : vertex G} → (edge G) a b → Arrow (atom a) (atom b)
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 π : {a b : Objs } → Arrow ( a ∧ b ) a
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 π' : {a b : Objs } → Arrow ( a ∧ b ) b
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 ε : {a b : Objs } → Arrow ((a <= b) ∧ b ) a
837
d809e2502be4 concat defined
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 836
diff changeset
27 _* : {a b c : Objs } → Arrow (c ∧ b ) a → Arrow c ( a <= b ) --- case v
832
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
a115daa7d30e separete
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 data Arrows : (b c : Objs ) → Set ( c₁ ⊔ c₂ ) where
837
d809e2502be4 concat defined
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 836
diff changeset
30 id : ( a : Objs ) → Arrows a a --- case i
844
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 843
diff changeset
31 ○ : ( a : Objs ) → Arrows a ⊤ --- case i
876
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
32 <_,_> : {a b c : Objs } → Arrows c a → Arrows c b → Arrows c (a ∧ b) -- case iii
837
d809e2502be4 concat defined
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 836
diff changeset
33 iv : {b c d : Objs } ( f : Arrow d c ) ( g : Arrows b d ) → Arrows b c -- cas iv
833
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 832
diff changeset
34
852
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 851
diff changeset
35 _・_ : {a b c : Objs } (f : Arrows b c ) → (g : Arrows a b) → Arrows a c
876
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
36 id a ・ g = g
853
efdb09dc9972 idempotent of eval
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 852
diff changeset
37 ○ a ・ g = ○ _
876
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
38 < f , g > ・ h = < f ・ h , g ・ h >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
39 iv f g ・ h = iv f ( g ・ h )
868
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 867
diff changeset
40
876
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
41 identityR : {A B : Objs} {f : Arrows A B} → (f ・ id A) ≡ f
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
42 identityR {a} {a} {id a} = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
43 identityR {a} {⊤} {○ a} = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
44 identityR {a} {_} {< f , f₁ >} = cong₂ (λ j k → < j , k > ) identityR identityR
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
45 identityR {a} {b} {iv f g} = cong (λ k → iv f k ) identityR
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
46 identityL : {A B : Objs} {f : Arrows A B} → (id B ・ f) ≡ f
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
47 identityL = refl
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
48 associative : {a b c d : Objs} (f : Arrows c d) (g : Arrows b c) (h : Arrows a b) →
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
49 (f ・ (g ・ h)) ≡ ((f ・ g) ・ h)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
50 associative (id a) g h = refl
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
51 associative (○ a) g h = refl
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
52 associative < f , f₁ > g h = cong₂ (λ j k → < j , k > ) (associative f g h) (associative f₁ g h)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
53 associative (iv f f1) g h = cong (λ k → iv f k ) ( associative f1 g h )
864
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 863
diff changeset
54
838
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
55 PL : Category (c₁ ⊔ c₂) (c₁ ⊔ c₂) (c₁ ⊔ c₂)
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
56 PL = record {
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
57 Obj = Objs;
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
58 Hom = λ a b → Arrows a b ;
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
59 _o_ = λ{a} {b} {c} x y → x ・ y ;
876
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 870
diff changeset
60 _≈_ = λ x y → x ≡ y ;
838
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
61 Id = λ{a} → id a ;
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
62 isCategory = record {
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
63 isEquivalence = record {refl = refl ; trans = trans ; sym = sym } ;
842
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 841
diff changeset
64 identityL = λ {a b f} → identityL {a} {b} {f} ;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 841
diff changeset
65 identityR = λ {a b f} → identityR {a} {b} {f} ;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 841
diff changeset
66 o-resp-≈ = λ {a b c f g h i} → o-resp-≈ {a} {b} {c} {f} {g} {h} {i} ;
838
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
67 associative = λ{a b c d f g h } → associative f g h
be4b8e70fa8e add category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 837
diff changeset
68 }
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
69 } where
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
70 o-resp-≈ : {A B C : Objs} {f g : Arrows A B} {h i : Arrows B C} →
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
71 f ≡ g → h ≡ i → (h ・ f) ≡ (i ・ g)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
72 o-resp-≈ refl refl = refl
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
73
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
74
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
75 eval : {a b : Objs } (f : Arrows a b ) → Arrows a b
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
76 eval (id a) = id a
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
77 eval (○ a) = ○ a
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
78 eval < f , f₁ > = < eval f , eval f₁ >
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
79 eval (iv f (id a)) = iv f (id a)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
80 eval (iv f (○ a)) = iv f (○ a)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
81 eval (iv π < g , h >) = eval g
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
82 eval (iv π' < g , h >) = eval h
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
83 eval (iv ε < g , h >) = iv ε < eval g , eval h >
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
84 eval (iv (f *) < g , h >) = iv (f *) < eval g , eval h >
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
85 eval (iv f (iv g h)) with eval (iv g h)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
86 eval (iv f (iv g h)) | id a = iv f (id a)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
87 eval (iv f (iv g h)) | ○ a = iv f (○ a)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
88 eval (iv π (iv g h)) | < t , t₁ > = t
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
89 eval (iv π' (iv g h)) | < t , t₁ > = t₁
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
90 eval (iv ε (iv g h)) | < t , t₁ > = iv ε < t , t₁ >
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
91 eval (iv (f *) (iv g h)) | < t , t₁ > = iv (f *) < t , t₁ >
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
92 eval (iv f (iv g h)) | iv f1 t = iv f (iv f1 t)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
93
879
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 878
diff changeset
94 refl-<l> : {a b c : Objs} → { f f1 : Arrows a b } { g g1 : Arrows a c } → < f , g > ≡ < f1 , g1 > → f ≡ f1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 878
diff changeset
95 refl-<l> refl = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 878
diff changeset
96
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 878
diff changeset
97 refl-<r> : {a b c : Objs} → { f f1 : Arrows a b } { g g1 : Arrows a c } → < f , g > ≡ < f1 , g1 > → g ≡ g1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 878
diff changeset
98 refl-<r> refl = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 878
diff changeset
99
880
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
100 idem-eval : {a b : Objs } (f : Arrows a b ) → eval (eval f) ≡ eval f
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
101 idem-eval (id a) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
102 idem-eval (○ a) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
103 idem-eval < f , f₁ > = cong₂ ( λ j k → < j , k > ) (idem-eval f) (idem-eval f₁)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
104 idem-eval (iv f (id a)) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
105 idem-eval (iv f (○ a)) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
106 idem-eval (iv π < g , g₁ >) = idem-eval g
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
107 idem-eval (iv π' < g , g₁ >) = idem-eval g₁
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
108 idem-eval (iv ε < f , f₁ >) = cong₂ ( λ j k → iv ε < j , k > ) (idem-eval f) (idem-eval f₁)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
109 idem-eval (iv (x *) < f , f₁ >) = cong₂ ( λ j k → iv (x *) < j , k > ) (idem-eval f) (idem-eval f₁)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
110 idem-eval (iv f (iv g h)) with eval (iv g h) | idem-eval (iv g h) | inspect eval (iv g h)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
111 idem-eval (iv f (iv g h)) | id a | m | _ = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
112 idem-eval (iv f (iv g h)) | ○ a | m | _ = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
113 idem-eval (iv π (iv g h)) | < t , t₁ > | m | _ = refl-<l> m
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
114 idem-eval (iv π' (iv g h)) | < t , t₁ > | m | _ = refl-<r> m
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
115 idem-eval (iv ε (iv g h)) | < t , t₁ > | m | _ = cong ( λ k → iv ε k ) m
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
116 idem-eval (iv (f *) (iv g h)) | < t , t₁ > | m | _ = cong ( λ k → iv (f *) k ) m
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
117 idem-eval (iv f (iv g h)) | iv f₁ t | m | record { eq = ee } = trans lemma (cong ( λ k → iv f k ) m ) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
118 lemma : eval (iv f (iv f₁ t)) ≡ iv f (eval (iv f₁ t))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
119 lemma = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
120
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
121 PL1 : Category (c₁ ⊔ c₂) (c₁ ⊔ c₂) (c₁ ⊔ c₂)
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
122 PL1 = record {
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
123 Obj = Objs;
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
124 Hom = λ a b → Arrows a b ;
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
125 _o_ = λ{a} {b} {c} x y → x ・ y ;
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
126 _≈_ = λ x y → eval x ≡ eval y ;
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
127 Id = λ{a} → id a ;
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
128 isCategory = record {
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
129 isEquivalence = record {refl = refl ; trans = trans ; sym = sym } ;
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
130 identityL = λ {a b f} → cong (λ k → eval k ) (identityL {a} {b} {f});
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
131 identityR = λ {a b f} → cong (λ k → eval k ) (identityR {a} {b} {f});
878
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 877
diff changeset
132 o-resp-≈ = λ {a b c f g h i} → ore {a} {b} {c} f g h i ;
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
133 associative = λ{a b c d f g h } → cong (λ k → eval k ) (associative f g h )
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
134 }
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
135 } where
880
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
136 iv-e : { a b c : Objs } → (x : Arrow b c ) ( g : Arrows a b ) → eval (iv x g) ≡ iv x (eval g)
881
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
137 iv-e = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
138 iv-e-arrow : { a : Objs } → {b c : vertex G } → (x : edge G b c ) ( g : Arrows a (atom b) )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
139 → eval (iv (arrow x) g) ≡ iv (arrow x) (eval g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
140 iv-e-arrow x (id (atom _)) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
141 iv-e-arrow x (iv f g) with eval (iv f g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
142 iv-e-arrow x (iv f g) | id (atom _) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
143 iv-e-arrow x (iv f g) | iv f₁ t = refl
880
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
144 iv-d : { a b c : Objs } → (x : Arrow b c ) ( g : Arrows a b ) → eval (iv x g) ≡ eval (iv x (eval g))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
145 iv-d (arrow x) g = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
146 eval (iv (arrow x) g)
881
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
147 ≡⟨ iv-e-arrow x g ⟩
880
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
148 iv (arrow x) (eval g)
881
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
149 ≡⟨ cong (λ k → iv (arrow x) k ) ( sym ( idem-eval g) ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
150 iv (arrow x) (eval (eval g))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 880
diff changeset
151 ≡⟨ sym (iv-e-arrow x (eval g)) ⟩
880
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
152 eval (iv (arrow x) (eval g))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
153 ∎ where open ≡-Reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
154 iv-d π (id _) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
155 iv-d π < g , g₁ > = sym (idem-eval g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
156 iv-d π (iv f g) = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
157 iv-d π' (id _) = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
158 iv-d π' < g , g₁ > = sym (idem-eval g₁)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
159 iv-d π' (iv f g) = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
160 iv-d ε g = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
161 iv-d (x *) g = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
162 d-eval : {A B C : Objs} (f : Arrows B C) (g : Arrows A B) →
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
163 eval (f ・ g) ≡ eval (eval f ・ eval g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
164 d-eval (id a) g = sym (idem-eval g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
165 d-eval (○ a) g = refl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
166 d-eval < f , f₁ > g = cong₂ (λ j k → < j , k > ) (d-eval f g) (d-eval f₁ g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
167 d-eval (iv x (id a)) g = iv-d x g
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
168 d-eval (iv (x *) (○ a)) g = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
169 d-eval (iv π < f , f₁ >) g = d-eval f g
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
170 d-eval (iv π' < f , f₁ >) g = d-eval f₁ g
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
171 d-eval (iv ε < f , f₁ >) g = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
172 d-eval (iv (x *) < f , f₁ >) g = {!!}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
173 d-eval (iv x (iv f f₁)) g = {!!}
878
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 877
diff changeset
174 ore : {A B C : Objs} (f g : Arrows A B) (h i : Arrows B C) →
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
175 eval f ≡ eval g → eval h ≡ eval i → eval (h ・ f) ≡ eval (i ・ g)
880
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
176 ore f g h i f=g h=i = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
177 eval (h ・ f)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
178 ≡⟨ d-eval h f ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
179 eval (eval h ・ eval f)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
180 ≡⟨ cong₂ (λ j k → eval ( j ・ k )) h=i f=g ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
181 eval (eval i ・ eval g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
182 ≡⟨ sym ( d-eval i g ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
183 eval (i ・ g)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
184 ∎ where open ≡-Reasoning
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 879
diff changeset
185
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
186
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
187 fmap : {A B : Obj PL} → Hom PL A B → Hom PL A B
878
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 877
diff changeset
188 fmap f = {!!}
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
189
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
190 PLCCC : Functor PL PL
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
191 PLCCC = record {
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
192 FObj = λ x → x
878
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 877
diff changeset
193 ; FMap = fmap
877
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
194 ; isFunctor = record {
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
195 identity = {!!}
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
196 ; distr = {!!}
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
197 ; ≈-cong = {!!}
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
198 }
66dfc4f80ba3 o-resp remains
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 876
diff changeset
199 }