annotate Comma1.agda @ 648:10f2057c8bff

use module
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 04 Jul 2017 10:16:07 +0900
parents 65e6906782bb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 open import Level
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 open import Category
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
3 module Comma1 {c₁ c₂ ℓ c₁' c₂' ℓ' : Level} {A : Category c₁ c₂ ℓ} {C : Category c₁' c₂' ℓ'}
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
4 ( F : Functor A C ) ( G : Functor A C ) where
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import HomReasoning
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 open import cat-utility
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
9 --
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
10 -- F G
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
11 -- A -> C <- A
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
12 --
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 open Functor
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 record CommaObj : Set ( c₁ ⊔ c₂' ) where
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 field
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 obj : Obj A
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
19 hom : Hom C ( FObj F obj ) ( FObj G obj )
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 open CommaObj
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 record CommaHom ( a b : CommaObj ) : Set ( c₂ ⊔ ℓ' ) where
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 field
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 arrow : Hom A ( obj a ) ( obj b )
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
26 comm : C [ C [ FMap G arrow o hom a ] ≈ C [ hom b o FMap F arrow ] ]
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 open CommaHom
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 _∙_ : {a b c : CommaObj } → CommaHom b c → CommaHom a b → CommaHom a c
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 _∙_ {a} {b} {c} f g = record {
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 arrow = A [ arrow f o arrow g ] ;
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 comm = comm1
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 } where
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
35 comm1 : C [ C [ FMap G (A [ arrow f o arrow g ] ) o hom a ] ≈ C [ hom c o FMap F (A [ arrow f o arrow g ]) ] ]
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
36 comm1 = let open ≈-Reasoning C in begin
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
37 FMap G (A [ arrow f o arrow g ] ) o hom a
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
38 ≈⟨ car ( distr G ) ⟩
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
39 ( FMap G (arrow f) o FMap G (arrow g )) o hom a
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
40 ≈↑⟨ assoc ⟩
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
41 FMap G (arrow f) o ( FMap G (arrow g ) o hom a )
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
42 ≈⟨ cdr ( comm g ) ⟩
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
43 FMap G (arrow f) o ( hom b o FMap F (arrow g ) )
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
44 ≈⟨ assoc ⟩
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
45 ( FMap G (arrow f) o hom b) o FMap F (arrow g )
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
46 ≈⟨ car ( comm f ) ⟩
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
47 ( hom c o FMap F (arrow f) ) o FMap F (arrow g )
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
48 ≈↑⟨ assoc ⟩
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
49 hom c o ( FMap F (arrow f) o FMap F (arrow g ) )
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
50 ≈↑⟨ cdr ( distr F) ⟩
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
51 hom c o FMap F (A [ arrow f o arrow g ])
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
52
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 CommaId : { a : CommaObj } → CommaHom a a
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 CommaId {a} = record { arrow = id1 A ( obj a ) ;
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 comm = comm2 } where
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
57 comm2 : C [ C [ FMap G (id1 A (obj a)) o hom a ] ≈ C [ hom a o FMap F (id1 A (obj a)) ] ]
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
58 comm2 = let open ≈-Reasoning C in begin
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
59 FMap G (id1 A (obj a)) o hom a
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
60 ≈⟨ car ( IsFunctor.identity ( isFunctor G ) ) ⟩
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
61 id1 C (FObj G (obj a)) o hom a
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
62 ≈⟨ idL ⟩
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
63 hom a
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
64 ≈↑⟨ idR ⟩
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
65 hom a o id1 C (FObj F (obj a))
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
66 ≈↑⟨ cdr ( IsFunctor.identity ( isFunctor F ) )⟩
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
67 hom a o FMap F (id1 A (obj a))
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
68
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
69
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
70 _⋍_ : { a b : CommaObj } ( f g : CommaHom a b ) → Set ℓ
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
71 f ⋍ g = A [ arrow f ≈ arrow g ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
72
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
73
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 isCommaCategory : IsCategory CommaObj CommaHom _⋍_ _∙_ CommaId
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 isCommaCategory = record {
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
76 isEquivalence = record { refl = let open ≈-Reasoning (A) in refl-hom ;
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
77 sym = let open ≈-Reasoning (A) in sym ;
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
78 trans = let open ≈-Reasoning (A) in trans-hom
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
79 }
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
80 ; identityL = let open ≈-Reasoning (A) in idL
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
81 ; identityR = let open ≈-Reasoning (A) in idR
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
82 ; o-resp-≈ = IsCategory.o-resp-≈ ( Category.isCategory A )
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
83 ; associative = IsCategory.associative ( Category.isCategory A )
479
a5034bdf6f38 Comma Category with A B C
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 478
diff changeset
84 }
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
85
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
86 CommaCategory : Category (c₂' ⊔ c₁) (ℓ' ⊔ c₂) ℓ
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
87 CommaCategory = record { Obj = CommaObj
478
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
88 ; Hom = CommaHom
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
89 ; _o_ = _∙_
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
90 ; _≈_ = _⋍_
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
91 ; Id = CommaId
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
92 ; isCategory = isCommaCategory
dc24ac6ebdb3 Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 477
diff changeset
93 }
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
95 open NTrans
477
bcf941e20737 add Comma category
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
480
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
97 nat-lemma : NTrans A C F G → Functor A CommaCategory
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
98 nat-lemma n = record {
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
99 FObj = λ x → fobj x ;
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
100 FMap = λ {a} {b} f → fmap {a} {b} f ;
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
101 isFunctor = record {
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
102 identity = λ{x} → identity x
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
103 ; distr = λ {a} {b} {c} {f} {g} → distr1 {a} {b} {c} {f} {g}
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
104 ; ≈-cong = λ {a} {b} {c} {f} → ≈-cong {a} {b} {c} {f}
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
105 }
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
106 } where
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
107 fobj : Obj A → Obj CommaCategory
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
108 fobj x = record { obj = x ; hom = TMap n x }
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
109 fmap : {a b : Obj A } → Hom A a b → Hom CommaCategory (fobj a) (fobj b )
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
110 fmap f = record { arrow = f ; comm = IsNTrans.commute (isNTrans n ) }
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
111 ≈-cong : {a : Obj A} {b : Obj A} {f g : Hom A a b} → A [ f ≈ g ] → CommaCategory [ fmap f ≈ fmap g ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
112 ≈-cong {a} {b} {f} {g} f=g = f=g
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
113 identity : (x : Obj A ) -> CommaCategory [ fmap (id1 A x) ≈ id1 CommaCategory (fobj x) ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
114 identity x = let open ≈-Reasoning (A) in begin
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
115 arrow (fmap (id1 A x))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
116 ≈⟨⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
117 id1 A x
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
118 ≈⟨⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
119 arrow (id1 CommaCategory (fobj x))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
120
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
121 distr1 : {a : Obj A} {b : Obj A} {c : Obj A} {f : Hom A a b} {g : Hom A b c} →
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
122 CommaCategory [ fmap (A [ g o f ]) ≈ CommaCategory [ fmap g o fmap f ] ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
123 distr1 = let open ≈-Reasoning (A) in refl-hom
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
124
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
125 nat-f : Functor A C → Functor A CommaCategory → Functor A C
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
126 nat-f F N = record {
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
127 FObj = λ x → FObj F ( obj ( FObj N x )) ;
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
128 FMap = λ {a} {b} f → FMap F (arrow (FMap N f)) ;
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
129 isFunctor = record {
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
130 identity = λ{x} → identity x
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
131 ; distr = λ {a} {b} {c} {f} {g} → distr1 {a} {b} {c} {f} {g}
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
132 ; ≈-cong = λ {a} {b} {f} {g} → ≈-cong {a} {b} {f} {g}
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
133 }
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
134 } where
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
135 identity : (x : Obj A ) -> C [ FMap F (arrow (FMap N (id1 A x))) ≈ id1 C (FObj F (obj (FObj N x))) ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
136 identity x = let open ≈-Reasoning (C) in begin
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
137 FMap F (arrow (FMap N (id1 A x)))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
138 ≈⟨ fcong F ( IsFunctor.identity ( isFunctor N) ) ⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
139 FMap F (id1 A (obj (FObj N x)))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
140 ≈⟨ IsFunctor.identity ( isFunctor F ) ⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
141 id1 C (FObj F (obj (FObj N x)))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
142
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
143 distr1 : {a : Obj A} {b : Obj A} {c : Obj A} {f : Hom A a b} {g : Hom A b c} →
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
144 C [ FMap F (arrow (FMap N (A [ g o f ]))) ≈
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
145 C [ FMap F (arrow (FMap N g)) o FMap F (arrow (FMap N f)) ] ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
146 distr1 {a} {b} {c} {f} {g} = let open ≈-Reasoning (C) in begin
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
147 FMap F (arrow (FMap N (A [ g o f ])))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
148 ≈⟨ fcong F ( IsFunctor.distr ( isFunctor N) ) ⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
149 FMap F (A [ arrow (FMap N g ) o arrow (FMap N f ) ] )
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
150 ≈⟨ ( IsFunctor.distr ( isFunctor F ) ) ⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
151 FMap F (arrow (FMap N g)) o FMap F (arrow (FMap N f))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
152
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
153 ≈-cong : {a : Obj A} {b : Obj A} {f g : Hom A a b} → A [ f ≈ g ] → C [ FMap F (arrow (FMap N f)) ≈ FMap F (arrow (FMap N g)) ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
154 ≈-cong {a} {b} {f} {g} f=g = let open ≈-Reasoning (C) in begin
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
155 FMap F (arrow (FMap N f))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
156 ≈⟨ fcong F (( IsFunctor.≈-cong ( isFunctor N) ) f=g ) ⟩
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
157 FMap F (arrow (FMap N g))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
158
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
159
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
160 nat-lemma← : ( N : Functor A CommaCategory ) → NTrans A C (nat-f F N) (nat-f G N)
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
161 nat-lemma← N = record {
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
162 TMap = λ (a : Obj A ) → tmap1 a
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
163 ; isNTrans = record {
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
164 commute = λ {a} {b} {f} → commute2 {a} {b} {f}
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
165 }
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
166 } where
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
167 tmap1 : (a : Obj A ) → Hom C (FObj F (obj ( FObj N a))) (FObj G (obj ( FObj N a)))
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
168 tmap1 a = hom (FObj N a)
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
169 commute2 : {a b : Obj A } {f : Hom A a b } →
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
170 C [ C [ FMap G ( arrow ( FMap N f)) o tmap1 a ] ≈ C [ tmap1 b o FMap F ( arrow ( FMap N f )) ] ]
08f9c8a59ff4 add Comma1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 479
diff changeset
171 commute2 {a} {b} {f} = comm ( FMap N f )
481
65e6906782bb Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
172
65e6906782bb Completeness of Comma Category begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 480
diff changeset
173