annotate comparison-functor.agda @ 648:10f2057c8bff

use module
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 04 Jul 2017 10:16:07 +0900
parents d3cd28a71b3f
children a5f2ca67e7c5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
98
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 -- -- -- -- -- -- -- --
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 -- Comparison Functor of Kelisli Category
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 -- defines U_K and F_K as a resolution of Monad
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 -- checks Adjointness
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 --
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 -- Shinji KONO <kono@ie.u-ryukyu.ac.jp>
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 -- -- -- -- -- -- -- --
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 open import Category -- https://github.com/konn/category-agda
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 open import Level
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 --open import Category.HomReasoning
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 open import HomReasoning
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 open import cat-utility
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open import Category.Cat
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 open import Relation.Binary.Core
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 module comparison-functor
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 { c₁ c₂ ℓ : Level} { A : Category c₁ c₂ ℓ }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 { T : Functor A A }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 { η : NTrans A A identityFunctor T }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 { μ : NTrans A A (T ○ T) T }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 { M' : Monad A T η μ }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 {c₁' c₂' ℓ' : Level} ( B : Category c₁' c₂' ℓ' )
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 { U_K : Functor B A } { F_K : Functor A B }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 { η_K : NTrans A A identityFunctor ( U_K ○ F_K ) }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 { ε_K : NTrans B B ( F_K ○ U_K ) identityFunctor }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 { μ_K' : NTrans A A (( U_K ○ F_K ) ○ ( U_K ○ F_K )) ( U_K ○ F_K ) }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 ( AdjK : Adjunction A B U_K F_K η_K ε_K )
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 ( RK : MResolution A B T U_K F_K {η_K} {ε_K} {μ_K'} AdjK )
465
d3cd28a71b3f clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 301
diff changeset
30 where
98
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 open import adj-monad
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
99
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
34 T_K = U_K ○ F_K
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
35
98
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 μ_K : NTrans A A (( U_K ○ F_K ) ○ ( U_K ○ F_K )) ( U_K ○ F_K )
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 μ_K = UεF A B U_K F_K ε_K
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 M : Monad A (U_K ○ F_K ) η_K μ_K
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 M = Adj2Monad A B {U_K} {F_K} {η_K} {ε_K} AdjK
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41
152
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 130
diff changeset
42 open import kleisli {c₁} {c₂} {ℓ} {A} { U_K ○ F_K } { η_K } { μ_K } { M }
98
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 open Functor
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 open NTrans
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 open KleisliHom
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 open Adjunction
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 open MResolution
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
50 kfmap : {a b : Obj A} (f : KHom a b) → Hom B (FObj F_K a) (FObj F_K b)
98
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 kfmap {_} {b} f = B [ TMap ε_K (FObj F_K b) o FMap F_K (KMap f) ]
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 K_T : Functor KleisliCategory B
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 K_T = record {
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 FObj = FObj F_K
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 ; FMap = kfmap
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 ; isFunctor = record
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 { ≈-cong = ≈-cong
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 ; identity = identity
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 ; distr = distr1
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 }
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 } where
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 identity : {a : Obj A} → B [ kfmap (K-id {a}) ≈ id1 B (FObj F_K a) ]
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 identity {a} = let open ≈-Reasoning (B) in
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 begin
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 kfmap (K-id {a})
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 TMap ε_K (FObj F_K a) o FMap F_K (KMap (K-id {a}))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 TMap ε_K (FObj F_K a) o FMap F_K (TMap η_K a)
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 ≈⟨ IsAdjunction.adjoint2 (isAdjunction AdjK) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 id1 B (FObj F_K a)
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
74 ≈-cong : {a b : Obj A} → {f g : KHom a b} → A [ KMap f ≈ KMap g ] → B [ kfmap f ≈ kfmap g ]
98
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 ≈-cong {a} {b} {f} {g} f≈g = let open ≈-Reasoning (B) in
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 begin
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 kfmap f
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 TMap ε_K (FObj F_K b) o FMap F_K (KMap f)
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 ≈⟨ cdr ( fcong F_K f≈g) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 TMap ε_K (FObj F_K b) o FMap F_K (KMap g)
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 kfmap g
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 distr1 : {a b c : Obj A} {f : KHom a b} {g : KHom b c} → B [ kfmap (g * f) ≈ (B [ kfmap g o kfmap f ] )]
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 distr1 {a} {b} {c} {f} {g} = let open ≈-Reasoning (B) in
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 begin
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 kfmap (g * f)
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 TMap ε_K (FObj F_K c) o FMap F_K (KMap (g * f))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 TMap ε_K (FObj F_K c) o FMap F_K (A [ TMap μ_K c o A [ FMap ( U_K ○ F_K ) (KMap g) o KMap f ] ] )
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 ≈⟨ cdr ( distr F_K ) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 TMap ε_K (FObj F_K c) o ( FMap F_K (TMap μ_K c) o ( FMap F_K (A [ FMap ( U_K ○ F_K ) (KMap g) o KMap f ])))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 ≈⟨ cdr (cdr ( distr F_K )) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 TMap ε_K (FObj F_K c) o ( FMap F_K (TMap μ_K c) o (( FMap F_K (FMap ( U_K ○ F_K ) (KMap g))) o (FMap F_K (KMap f))))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 ≈⟨ cdr assoc ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 TMap ε_K (FObj F_K c) o ((( FMap F_K (TMap μ_K c) o ( FMap F_K (FMap (U_K ○ F_K) (KMap g))))) o (FMap F_K (KMap f)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 TMap ε_K (FObj F_K c) o (( FMap F_K ( FMap U_K ( TMap ε_K ( FObj F_K c ) )) o
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 ( FMap F_K (FMap (U_K ○ F_K) (KMap g)))) o (FMap F_K (KMap f)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 ≈⟨ sym (cdr assoc) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 TMap ε_K (FObj F_K c) o (( FMap F_K ( FMap U_K ( TMap ε_K ( FObj F_K c ) ))) o
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 (( FMap F_K (FMap (U_K ○ F_K) (KMap g))) o (FMap F_K (KMap f))))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 ≈⟨ assoc ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 (TMap ε_K (FObj F_K c) o ( FMap F_K ( FMap U_K ( TMap ε_K ( FObj F_K c ) )))) o
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 (( FMap F_K (FMap (U_K ○ F_K) (KMap g))) o (FMap F_K (KMap f)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 ≈⟨ car (sym (nat ε_K)) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 (TMap ε_K (FObj F_K c) o ( TMap ε_K (FObj (F_K ○ U_K) (FObj F_K c)))) o
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 (( FMap F_K (FMap (U_K ○ F_K) (KMap g))) o (FMap F_K (KMap f)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 ≈⟨ sym assoc ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 TMap ε_K (FObj F_K c) o (( TMap ε_K (FObj (F_K ○ U_K) (FObj F_K c))) o
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 ((( FMap F_K (FMap (U_K ○ F_K) (KMap g)))) o (FMap F_K (KMap f))))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 ≈⟨ cdr assoc ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 TMap ε_K (FObj F_K c) o ((( TMap ε_K (FObj (F_K ○ U_K) (FObj F_K c))) o
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 (( FMap F_K (FMap (U_K ○ F_K) (KMap g))))) o (FMap F_K (KMap f)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 ≈⟨ cdr ( car (
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 begin
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 TMap ε_K (FObj (F_K ○ U_K) (FObj F_K c)) o ((FMap F_K (FMap (U_K ○ F_K) (KMap g))))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 TMap ε_K (FObj (F_K ○ U_K) (FObj F_K c)) o (FMap (F_K ○ U_K) (FMap F_K (KMap g)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 ≈⟨ sym (nat ε_K) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 ( FMap F_K (KMap g)) o (TMap ε_K (FObj F_K b))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 )) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 TMap ε_K (FObj F_K c) o ((( FMap F_K (KMap g)) o (TMap ε_K (FObj F_K b))) o FMap F_K (KMap f))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 ≈⟨ cdr (sym assoc) ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 TMap ε_K (FObj F_K c) o (( FMap F_K (KMap g)) o (TMap ε_K (FObj F_K b) o FMap F_K (KMap f)))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 ≈⟨ assoc ⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 (TMap ε_K (FObj F_K c) o FMap F_K (KMap g)) o (TMap ε_K (FObj F_K b) o FMap F_K (KMap f))
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 ≈⟨⟩
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 kfmap g o kfmap f
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133
b0ba34a27783 generated version of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
135 Lemma-K1 : {a b : Obj A} ( f : Hom A a b ) → B [ FMap K_T ( FMap F_T f) ≈ FMap F_K f ]
99
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
136 Lemma-K1 {a} {b} f = let open ≈-Reasoning (B) in
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
137 begin
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
138 FMap K_T ( FMap F_T f)
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
139 ≈⟨⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
140 TMap ε_K (FObj F_K b) o FMap F_K (KMap( FMap F_T f))
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
141 ≈⟨⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
142 TMap ε_K (FObj F_K b) o FMap F_K (A [ TMap η_K b o f ])
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
143 ≈⟨ cdr ( distr F_K) ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
144 TMap ε_K (FObj F_K b) o (FMap F_K (TMap η_K b) o FMap F_K f )
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
145 ≈⟨ assoc ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
146 (TMap ε_K (FObj F_K b) o FMap F_K (TMap η_K b)) o FMap F_K f
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
147 ≈⟨ car ( IsAdjunction.adjoint2 (isAdjunction AdjK)) ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
148 id1 B (FObj F_K b) o FMap F_K f
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
149 ≈⟨ idL ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
150 FMap F_K f
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
151
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
152
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
153 Lemma-K2 : {a b : Obj A} ( f : KHom a b ) → A [ FMap U_K ( FMap K_T f) ≈ FMap U_T f ]
99
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
154 Lemma-K2 {a} {b} f = let open ≈-Reasoning (A) in
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
155 begin
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
156 FMap U_K ( FMap K_T f)
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
157 ≈⟨⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
158 FMap U_K ( B [ TMap ε_K (FObj F_K b) o FMap F_K (KMap f) ] )
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
159 ≈⟨ distr U_K ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
160 FMap U_K ( TMap ε_K (FObj F_K b)) o FMap U_K (FMap F_K (KMap f) )
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
161 ≈⟨⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
162 TMap μ_K b o FMap T_K (KMap f)
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
163 ≈⟨⟩ -- the definition
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
164 FMap U_T f
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
165
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
166
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
167 Lemma-K3 : (b : Obj A) → B [ FMap K_T (record { KMap = (TMap η_K b) }) ≈ id1 B (FObj F_K b) ]
99
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
168 Lemma-K3 b = let open ≈-Reasoning (B) in
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
169 begin
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
170 FMap K_T (record { KMap = (TMap η_K b) })
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
171 ≈⟨⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
172 TMap ε_K (FObj F_K b) o FMap F_K (TMap η_K b)
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
173 ≈⟨ IsAdjunction.adjoint2 (isAdjunction AdjK) ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
174 id1 B (FObj F_K b)
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
175
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
176
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
177 Lemma-K4 : (b c : Obj A) (g : Hom A b (FObj T_K c)) →
128
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
178 B [ FMap K_T ( record { KMap = A [ (TMap η_K (FObj T_K c)) o g ] }) ≈ FMap F_K g ]
99
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
179 Lemma-K4 b c g = let open ≈-Reasoning (B) in
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
180 begin
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
181 FMap K_T ( record { KMap = A [ (TMap η_K (FObj T_K c)) o g ] })
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
182 ≈⟨⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
183 TMap ε_K (FObj F_K (FObj T_K c)) o FMap F_K (A [ (TMap η_K (FObj T_K c)) o g ])
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
184 ≈⟨ cdr (distr F_K) ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
185 TMap ε_K (FObj F_K (FObj T_K c)) o ( FMap F_K (TMap η_K (FObj T_K c)) o FMap F_K g )
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
186 ≈⟨ assoc ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
187 (TMap ε_K (FObj F_K (FObj T_K c)) o ( FMap F_K (TMap η_K (FObj T_K c)))) o FMap F_K g
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
188 ≈⟨ car ( IsAdjunction.adjoint2 (isAdjunction AdjK)) ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
189 id1 B (FObj F_K (FObj T_K c)) o FMap F_K g
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
190 ≈⟨ idL ⟩
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
191 FMap F_K g
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
192
bd542a1caf08 uniquness of comparison functor
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 98
diff changeset
193
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
194 -- Lemma-K5 : (a : Obj A) → FObj U_K ( FObj K_T a ) = U_T a
128
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
195
300
d6a6dd305da2 arrow and lambda fix
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 152
diff changeset
196 Lemma-K6 : (b c : Obj A) (g : KHom b c) → A [ FMap U_K ( FMap K_T g ) ≈ FMap U_T g ]
128
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
197 Lemma-K6 b c g = let open ≈-Reasoning (A) in
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
198 begin
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
199 FMap U_K ( FMap K_T g )
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
200 ≈⟨⟩
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
201 FMap U_K ( B [ TMap ε_K ( FObj F_K c ) o FMap F_K (KMap g) ] )
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
202 ≈⟨ distr U_K ⟩
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
203 FMap U_K ( TMap ε_K ( FObj F_K c )) o FMap U_K ( FMap F_K (KMap g) )
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
204 ≈⟨⟩
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
205 TMap μ_K c o FMap U_K ( FMap F_K (KMap g) )
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
206 ≈⟨⟩
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
207 FMap U_T g
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
208
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
209
276f33602700 Comparison Functor all done.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 99
diff changeset
210