annotate free-monoid.agda @ 185:173d078ee443

Yoneda join
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 28 Aug 2013 21:51:59 +0900
parents 6626a7cd9129
children 58ee98bbb333
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
167
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
1 -- Free Monoid and it's Universal Mapping
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
2 ---- using Sets and forgetful functor
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
3
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
4 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp>
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
5
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import Category -- https://github.com/konn/category-agda
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 open import Level
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 module free-monoid { c c₁ c₂ ℓ : Level } where
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 open import Category.Sets
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 open import Category.Cat
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 open import HomReasoning
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 open import cat-utility
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open import Relation.Binary.Core
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 open import Relation.Binary.PropositionalEquality
178
6626a7cd9129 Yoneda Functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170
diff changeset
16 open import universal-mapping
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
18 -- from https://github.com/danr/Agda-projects/blob/master/Category-Theory/FreeMonoid.agda
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 infixr 40 _::_
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
21 data List (A : Set c ) : Set c where
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 [] : List A
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 _::_ : A -> List A -> List A
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 infixl 30 _++_
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
27 _++_ : {A : Set c } -> List A -> List A -> List A
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 [] ++ ys = ys
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 (x :: xs) ++ ys = x :: (xs ++ ys)
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 ≡-cong = Relation.Binary.PropositionalEquality.cong
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
33 list-id-l : { A : Set c } -> { x : List A } -> [] ++ x ≡ x
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
34 list-id-l {_} {_} = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
35 list-id-r : { A : Set c } -> { x : List A } -> x ++ [] ≡ x
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
36 list-id-r {_} {[]} = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
37 list-id-r {A} {x :: xs} = ≡-cong ( \y -> x :: y ) ( list-id-r {A} {xs} )
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
38 list-assoc : {A : Set c} -> { xs ys zs : List A } ->
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
39 ( xs ++ ( ys ++ zs ) ) ≡ ( ( xs ++ ys ) ++ zs )
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
40 list-assoc {_} {[]} {_} {_} = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
41 list-assoc {A} {x :: xs} {ys} {zs} = ≡-cong ( \y -> x :: y )
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
42 ( list-assoc {A} {xs} {ys} {zs} )
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
43 list-o-resp-≈ : {A : Set c} -> {f g : List A } → {h i : List A } →
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
44 f ≡ g → h ≡ i → (h ++ f) ≡ (i ++ g)
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
45 list-o-resp-≈ {A} refl refl = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
46 list-isEquivalence : {A : Set c} -> IsEquivalence {_} {_} {List A } _≡_
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
47 list-isEquivalence {A} = -- this is the same function as A's equivalence but has different types
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
48 record { refl = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
49 ; sym = sym
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
50 ; trans = trans
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
51 }
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 open import Algebra.FunctionProperties using (Op₁; Op₂)
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
54 open import Algebra.Structures
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
55 open import Data.Product
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 record ≡-Monoid : Set (suc c) where
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 infixl 7 _∙_
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 field
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 Carrier : Set c
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 _∙_ : Op₂ Carrier
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 ε : Carrier
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 isMonoid : IsMonoid _≡_ _∙_ ε
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 open ≡-Monoid
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 record Monomorph ( a b : ≡-Monoid ) : Set (suc c) where
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 field
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 morph : Carrier a -> Carrier b
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 identity : morph (ε a) ≡ ε b
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
72 homo : ∀{x y} -> morph ( _∙_ a x y ) ≡ ( _∙_ b (morph x ) (morph y) )
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 open Monomorph
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
76 _+_ : { a b c : ≡-Monoid } -> Monomorph b c -> Monomorph a b -> Monomorph a c
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
77 _+_ {a} {b} {c} f g = record {
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 morph = \x -> morph f ( morph g x ) ;
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 identity = identity1 ;
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
80 homo = homo1
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 } where
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 identity1 : morph f ( morph g (ε a) ) ≡ ε c
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 -- morph f (ε b) = ε c , morph g (ε a) ) ≡ ε b
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 -- morph f morph g (ε a) ) ≡ morph f (ε b) = ε c
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 identity1 = trans ( ≡-cong (morph f ) ( identity g ) ) ( identity f )
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
86 homo1 : ∀{x y} -> morph f ( morph g ( _∙_ a x y )) ≡ ( _∙_ c (morph f (morph g x )) (morph f (morph g y) ) )
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 -- ∀{x y} -> morph f ( morph g ( _∙_ a x y )) ≡ morph f ( ( _∙_ c (morph g x )) (morph g y) )
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
88 -- ∀{x y} -> morph f ( ( _∙_ c (morph g x )) (morph g y) )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
89 -- ≡ ( _∙_ c (morph f (morph g x )) (morph f (morph g y) ) )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
90 homo1 = trans (≡-cong (morph f ) ( homo g) ) ( homo f )
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
92 M-id : { a : ≡-Monoid } -> Monomorph a a
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
93 M-id = record { morph = \x -> x ; identity = refl ; homo = refl }
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
95 _==_ : { a b : ≡-Monoid } -> Monomorph a b -> Monomorph a b -> Set c
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
96 _==_ f g = morph f ≡ morph g
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
97
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
98 isMonoids : IsCategory ≡-Monoid Monomorph _==_ _+_ (M-id)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
99 isMonoids = record { isEquivalence = isEquivalence1
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
100 ; identityL = refl
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
101 ; identityR = refl
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
102 ; associative = refl
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
103 ; o-resp-≈ = \{a} {b} {c} {f} {g} {h} {i} -> o-resp-≈ {a} {b} {c} {f} {g} {h} {i}
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
104 }
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
105 where
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
106 o-resp-≈ : {a b c : ≡-Monoid } {f g : Monomorph a b } → {h i : Monomorph b c } →
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
107 f == g → h == i → (h + f) == (i + g)
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
108 o-resp-≈ {A} refl refl = refl
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
109 isEquivalence1 : { a b : ≡-Monoid } -> IsEquivalence {_} {_} {Monomorph a b} _==_
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
110 isEquivalence1 = -- this is the same function as A's equivalence but has different types
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
111 record { refl = refl
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
112 ; sym = sym
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
113 ; trans = trans
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
114 }
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
115 Monoids : Category _ _ _
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
116 Monoids =
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
117 record { Obj = ≡-Monoid
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
118 ; Hom = Monomorph
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
119 ; _o_ = _+_
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
120 ; _≈_ = _==_
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
121 ; Id = M-id
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
122 ; isCategory = isMonoids
155
d9cbaa749be6 Monoids done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 154
diff changeset
123 }
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
125 A = Sets {c}
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
126 B = Monoids
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
128 open Functor
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
130 U : Functor B A
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
131 U = record {
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
132 FObj = \m -> Carrier m ;
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
133 FMap = \f -> morph f ;
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
134 isFunctor = record {
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
135 ≈-cong = \x -> x
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
136 ; identity = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
137 ; distr = refl
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
138 }
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
139 }
154
744be443e232 on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
141 -- FObj
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
142 list : (a : Set c) -> ≡-Monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
143 list a = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
144 Carrier = List a
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
145 ; _∙_ = _++_
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
146 ; ε = []
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
147 ; isMonoid = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
148 identity = ( ( \x -> list-id-l {a} ) , ( \x -> list-id-r {a} ) ) ;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
149 isSemigroup = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
150 assoc = \x -> \y -> \z -> sym ( list-assoc {a} {x} {y} {z} )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
151 ; isEquivalence = list-isEquivalence
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
152 ; ∙-cong = \x -> \y -> list-o-resp-≈ y x
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
153 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
154 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
155 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
156
156
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
157 Generator : Obj A -> Obj B
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
158 Generator s = list s
b15c1435cfcc list is monoid now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 155
diff changeset
159
157
34a152235ddd solution of universal mapping for free monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 156
diff changeset
160 -- solution
34a152235ddd solution of universal mapping for free monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 156
diff changeset
161
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
162 open UniversalMapping
158
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 157
diff changeset
163
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
164 Φ : {a : Obj A } {b : Obj B} { f : Hom A a (FObj U b) } → List a -> Carrier b
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
165 Φ {a} {b} {f} [] = ε b
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
166 Φ {a} {b} {f} ( x :: xs ) = _∙_ b ( f x ) (Φ {a} {b} {f} xs )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
167
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
168 solution : (a : Obj A ) (b : Obj B) ( f : Hom A a (FObj U b) ) → Hom B (Generator a ) b
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
169 solution a b f = record {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
170 morph = \(l : List a) -> Φ l ;
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
171 identity = refl ;
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
172 homo = \{x y} -> homo1 x y
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
173 } where
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
174 _*_ : Carrier b -> Carrier b -> Carrier b
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
175 _*_ f g = _∙_ b f g
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
176 homo1 : (x y : Carrier (Generator a)) → Φ ((Generator a ∙ x) y) ≡ (b ∙ Φ x) (Φ y)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
177 homo1 [] y = sym (proj₁ ( IsMonoid.identity ( isMonoid b) ) (Φ y))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
178 homo1 (x :: xs) y = let open ≡-Reasoning in
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
179 sym ( begin
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
180 (Φ {a} {b} {f} (x :: xs)) * (Φ {a} {b} {f} y)
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
181 ≡⟨⟩
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
182 ((f x) * (Φ {a} {b} {f} xs)) * (Φ {a} {b} {f} y)
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
183 ≡⟨ ( IsMonoid.assoc ( isMonoid b )) _ _ _ ⟩
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
184 (f x) * ( (Φ {a} {b} {f} xs) * (Φ {a} {b} {f} y) )
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
185 ≡⟨ sym ( (IsMonoid.∙-cong (isMonoid b)) refl (homo1 xs y )) ⟩
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
186 (f x) * ( Φ {a} {b} {f} ( xs ++ y ) )
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
187 ≡⟨⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
188 Φ {a} {b} {f} ( x :: ( xs ++ y ) )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
189 ≡⟨⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
190 Φ {a} {b} {f} ( (x :: xs) ++ y )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
191 ≡⟨⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
192 Φ {a} {b} {f} ((Generator a ∙ x :: xs) y)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
193 ∎ )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
194
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
195 eta : (a : Obj A) → Hom A a ( FObj U (Generator a) )
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
196 eta a = \( x : a ) -> x :: []
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
197
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
198 -- Functional Extensionality Axiom (We cannot prove this in Agda / Coq, just assumming )
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
199 -- postulate extensionality : { a b : Obj A } {f g : Hom A a b } → (∀ {x} → (f x ≡ g x)) → ( f ≡ g )
170
721cf9d9f5e3 use functional extensionality in library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
200 postulate extensionality : Relation.Binary.PropositionalEquality.Extensionality c c
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
201
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
202 FreeMonoidUniveralMapping : UniversalMapping A B U Generator eta
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
203 FreeMonoidUniveralMapping =
157
34a152235ddd solution of universal mapping for free monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 156
diff changeset
204 record {
160
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
205 _* = \{a b} -> \f -> solution a b f ;
157
34a152235ddd solution of universal mapping for free monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 156
diff changeset
206 isUniversalMapping = record {
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
207 universalMapping = \{a b f} -> universalMapping {a} {b} {f} ;
167
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
208 uniquness = \{a b f g} -> uniquness {a} {b} {f} {g}
157
34a152235ddd solution of universal mapping for free monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 156
diff changeset
209 }
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
210 } where
160
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
211 universalMapping : {a : Obj A } {b : Obj B} { f : Hom A a (FObj U b) } → FMap U ( solution a b f ) o eta a ≡ f
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
212 universalMapping {a} {b} {f} = let open ≡-Reasoning in
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
213 begin
160
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
214 FMap U ( solution a b f ) o eta a
161
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 160
diff changeset
215 ≡⟨⟩
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
216 ( λ (x : a ) → Φ {a} {b} {f} (eta a x) )
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
217 ≡⟨⟩
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
218 ( λ (x : a ) → Φ {a} {b} {f} ( x :: [] ) )
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
219 ≡⟨⟩
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
220 ( λ (x : a ) → _∙_ b ( f x ) (Φ {a} {b} {f} [] ) )
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
221 ≡⟨⟩
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
222 ( λ (x : a ) → _∙_ b ( f x ) ( ε b ) )
170
721cf9d9f5e3 use functional extensionality in library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
223 ≡⟨ ≡-cong ( \ g -> ( ( λ (x : a ) → g x ) )) (extensionality {a} lemma-ext1) ⟩
162
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
224 ( λ (x : a ) → f x )
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
225 ≡⟨⟩
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
226 f
18ab1be1ebb5 mapping done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 161
diff changeset
227 ∎ where
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
228 lemma-ext1 : ∀( x : a ) -> _∙_ b ( f x ) ( ε b ) ≡ f x
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
229 lemma-ext1 x = ( proj₂ ( IsMonoid.identity ( isMonoid b) ) ) (f x)
159
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 158
diff changeset
230 uniquness : {a : Obj A } {b : Obj B} { f : Hom A a (FObj U b) } →
160
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 159
diff changeset
231 { g : Hom B (Generator a) b } → (FMap U g) o (eta a ) ≡ f → B [ solution a b f ≈ g ]
163
bc47179e3c9c uniqueness continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 162
diff changeset
232 uniquness {a} {b} {f} {g} eq =
170
721cf9d9f5e3 use functional extensionality in library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
233 extensionality lemma-ext2 where
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
234 lemma-ext2 : ( ∀( x : List a ) -> (morph ( solution a b f)) x ≡ (morph g) x )
163
bc47179e3c9c uniqueness continue...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 162
diff changeset
235 -- (morph ( solution a b f)) [] ≡ (morph g) [] )
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
236 lemma-ext2 [] = let open ≡-Reasoning in
164
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
237 begin
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
238 (morph ( solution a b f)) []
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
239 ≡⟨ identity ( solution a b f) ⟩
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
240 ε b
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
241 ≡⟨ sym ( identity g ) ⟩
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
242 (morph g) []
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
243
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
244 lemma-ext2 (x :: xs) = let open ≡-Reasoning in
164
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
245 begin
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
246 (morph ( solution a b f)) ( x :: xs )
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
247 ≡⟨ homo ( solution a b f) {x :: []} {xs} ⟩
164
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
248 _∙_ b ((morph ( solution a b f)) ( x :: []) ) ((morph ( solution a b f)) xs )
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
249 ≡⟨ ≡-cong ( \ k -> (_∙_ b ((morph ( solution a b f)) ( x :: []) ) k )) (lemma-ext2 xs ) ⟩
164
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
250 _∙_ b ((morph ( solution a b f)) ( x :: []) ) ((morph g) ( xs ))
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
251 ≡⟨ ≡-cong ( \k -> ( _∙_ b ( k x ) ((morph g) ( xs )) )) (
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
252 begin
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
253 ( \x -> (morph ( solution a b f)) ( x :: [] ) )
170
721cf9d9f5e3 use functional extensionality in library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 169
diff changeset
254 ≡⟨ extensionality {a} lemma-ext3 ⟩
164
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
255 ( \x -> (morph g) ( x :: [] ) )
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
256
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
257 ) ⟩
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
258 _∙_ b ((morph g) ( x :: [] )) ((morph g) ( xs ))
168
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 167
diff changeset
259 ≡⟨ sym ( homo g ) ⟩
164
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
260 (morph g) ( x :: xs )
ab186f0e7b7a on going...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 163
diff changeset
261 ∎ where
169
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
262 lemma-ext3 : ∀( x : a ) -> (morph ( solution a b f)) (x :: []) ≡ (morph g) ( x :: [] )
44bf6e78f891 builtin extensionality
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 168
diff changeset
263 lemma-ext3 x = let open ≡-Reasoning in
166
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
264 begin
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
265 (morph ( solution a b f)) (x :: [])
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
266 ≡⟨ ( proj₂ ( IsMonoid.identity ( isMonoid b) )(f x) ) ⟩
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
267 f x
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
268 ≡⟨ sym ( ≡-cong (\f -> f x ) eq ) ⟩
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
269 (morph g) ( x :: [] )
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
270
2246a7d67ba3 two yellow remain...
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 165
diff changeset
271
178
6626a7cd9129 Yoneda Functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170
diff changeset
272 open NTrans
6626a7cd9129 Yoneda Functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170
diff changeset
273 -- fm-ε b = Φ
6626a7cd9129 Yoneda Functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170
diff changeset
274 fm-ε : NTrans B B ( ( FunctorF A B FreeMonoidUniveralMapping) ○ U) identityFunctor
6626a7cd9129 Yoneda Functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170
diff changeset
275 fm-ε = nat-ε A B {U} {Generator} {eta} FreeMonoidUniveralMapping
6626a7cd9129 Yoneda Functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 170
diff changeset
276 -- TMap fm-ε
157
34a152235ddd solution of universal mapping for free monoid
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 156
diff changeset
277
167
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
278 adjoint = UMAdjunction A B U Generator eta FreeMonoidUniveralMapping
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
279
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
280
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
281
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
282
c3863043c4a3 Free Monoid and Universal mapping problem done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 166
diff changeset
283