779
|
1 open import Level
|
|
2 open import Category
|
|
3 module CCC where
|
|
4
|
|
5 open import HomReasoning
|
|
6 open import cat-utility
|
780
|
7 open import Relation.Binary.PropositionalEquality
|
779
|
8
|
783
|
9
|
|
10 open import HomReasoning
|
|
11
|
784
|
12 record IsCCC {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ)
|
783
|
13 ( 1 : Obj A )
|
|
14 ( ○ : (a : Obj A ) → Hom A a 1 )
|
|
15 ( _∧_ : Obj A → Obj A → Obj A )
|
|
16 ( <_,_> : {a b c : Obj A } → Hom A c a → Hom A c b → Hom A c (a ∧ b) )
|
|
17 ( π : {a b : Obj A } → Hom A (a ∧ b) a )
|
|
18 ( π' : {a b : Obj A } → Hom A (a ∧ b) b )
|
|
19 ( _<=_ : (a b : Obj A ) → Obj A )
|
|
20 ( _* : {a b c : Obj A } → Hom A (a ∧ b) c → Hom A a (c <= b) )
|
|
21 ( ε : {a b : Obj A } → Hom A ((a <= b ) ∧ b) a )
|
|
22 : Set ( c₁ ⊔ c₂ ⊔ ℓ ) where
|
|
23 field
|
|
24 -- cartesian
|
|
25 e2 : {a : Obj A} → ∀ ( f : Hom A a 1 ) → A [ f ≈ ○ a ]
|
|
26 e3a : {a b c : Obj A} → { f : Hom A c a }{ g : Hom A c b } → A [ A [ π o < f , g > ] ≈ f ]
|
|
27 e3b : {a b c : Obj A} → { f : Hom A c a }{ g : Hom A c b } → A [ A [ π' o < f , g > ] ≈ g ]
|
|
28 e3c : {a b c : Obj A} → { h : Hom A c (a ∧ b) } → A [ < A [ π o h ] , A [ π' o h ] > ≈ h ]
|
785
|
29 π-cong : {a b c : Obj A} → { f f' : Hom A c a }{ g g' : Hom A c b } → A [ f ≈ f' ] → A [ g ≈ g' ] → A [ < f , g > ≈ < f' , g' > ]
|
783
|
30 -- closed
|
|
31 e4a : {a b c : Obj A} → { h : Hom A (c ∧ b) a } → A [ A [ ε o < A [ (h *) o π ] , π' > ] ≈ h ]
|
|
32 e4b : {a b c : Obj A} → { k : Hom A c (a <= b ) } → A [ ( A [ ε o < A [ k o π ] , π' > ] ) * ≈ k ]
|
779
|
33
|
783
|
34 e'2 : A [ ○ 1 ≈ id1 A 1 ]
|
|
35 e'2 = let open ≈-Reasoning A in begin
|
|
36 ○ 1
|
|
37 ≈↑⟨ e2 (id1 A 1 ) ⟩
|
|
38 id1 A 1
|
|
39 ∎
|
|
40 e''2 : {a b : Obj A} {f : Hom A a b } → A [ A [ ○ b o f ] ≈ ○ a ]
|
|
41 e''2 {a} {b} {f} = let open ≈-Reasoning A in begin
|
|
42 ○ b o f
|
|
43 ≈⟨ e2 (○ b o f) ⟩
|
|
44 ○ a
|
|
45 ∎
|
|
46 distr : {a b c d : Obj A} {f : Hom A c a }{g : Hom A c b } {h : Hom A d c } → A [ A [ < f , g > o h ] ≈ < A [ f o h ] , A [ g o h ] > ]
|
|
47 distr {a} {b} {c} {d} {f} {g} {h} = let open ≈-Reasoning A in begin
|
|
48 < f , g > o h
|
|
49 ≈↑⟨ e3c ⟩
|
|
50 < π o < f , g > o h , π' o < f , g > o h >
|
785
|
51 ≈⟨ π-cong assoc assoc ⟩
|
|
52 < ( π o < f , g > ) o h , (π' o < f , g > ) o h >
|
|
53 ≈⟨ π-cong (car e3a ) (car e3b) ⟩
|
783
|
54 < f o h , g o h >
|
|
55 ∎
|
|
56 _×_ : { a b c d e : Obj A } ( f : Hom A a d ) (g : Hom A b e ) ( h : Hom A c (a ∧ b) ) → Hom A c ( d ∧ e )
|
|
57 f × g = λ h → < A [ f o A [ π o h ] ] , A [ g o A [ π' o h ] ] >
|
|
58
|
784
|
59 record CCC {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) : Set ( c₁ ⊔ c₂ ⊔ ℓ ) where
|
781
|
60 field
|
783
|
61 1 : Obj A
|
|
62 ○ : (a : Obj A ) → Hom A a 1
|
|
63 _∧_ : Obj A → Obj A → Obj A
|
|
64 <_,_> : {a b c : Obj A } → Hom A c a → Hom A c b → Hom A c (a ∧ b)
|
|
65 π : {a b : Obj A } → Hom A (a ∧ b) a
|
|
66 π' : {a b : Obj A } → Hom A (a ∧ b) b
|
|
67 _<=_ : (a b : Obj A ) → Obj A
|
|
68 _* : {a b c : Obj A } → Hom A (a ∧ b) c → Hom A a (c <= b)
|
|
69 ε : {a b : Obj A } → Hom A ((a <= b ) ∧ b) a
|
784
|
70 isCCC : IsCCC A 1 ○ _∧_ <_,_> π π' _<=_ _* ε
|
781
|
71
|
783
|
72
|
|
73
|
|
74
|
|
75
|