annotate src/CCC.agda @ 975:f8fba4f1dcfa

char-m=⊤
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 01 Mar 2021 17:01:00 +0900
parents 5731ffd6cf7a
children 8ffdc897f29b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
779
6b4bd02efd80 CCC start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 open import Level
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
2 open import Category
779
6b4bd02efd80 CCC start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 module CCC where
6b4bd02efd80 CCC start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
5
779
6b4bd02efd80 CCC start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 open import HomReasoning
6b4bd02efd80 CCC start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 open import cat-utility
780
b44c1c6ce646 CCC in Hom form
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 779
diff changeset
8 open import Relation.Binary.PropositionalEquality
779
6b4bd02efd80 CCC start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
10
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
11 open import HomReasoning
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
12
784
f27d966939f8 add CCC hom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 783
diff changeset
13 record IsCCC {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ)
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
14 ( 1 : Obj A )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
15 ( ○ : (a : Obj A ) → Hom A a 1 )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
16 ( _∧_ : Obj A → Obj A → Obj A )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
17 ( <_,_> : {a b c : Obj A } → Hom A c a → Hom A c b → Hom A c (a ∧ b) )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
18 ( π : {a b : Obj A } → Hom A (a ∧ b) a )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
19 ( π' : {a b : Obj A } → Hom A (a ∧ b) b )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
20 ( _<=_ : (a b : Obj A ) → Obj A )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
21 ( _* : {a b c : Obj A } → Hom A (a ∧ b) c → Hom A a (c <= b) )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
22 ( ε : {a b : Obj A } → Hom A ((a <= b ) ∧ b) a )
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
23 : Set ( c₁ ⊔ c₂ ⊔ ℓ ) where
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
24 field
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
25 -- cartesian
793
f37f11e1b871 Hom a,b = Hom 1 b^a
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 789
diff changeset
26 e2 : {a : Obj A} → ∀ { f : Hom A a 1 } → A [ f ≈ ○ a ]
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
27 e3a : {a b c : Obj A} → { f : Hom A c a }{ g : Hom A c b } → A [ A [ π o < f , g > ] ≈ f ]
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
28 e3b : {a b c : Obj A} → { f : Hom A c a }{ g : Hom A c b } → A [ A [ π' o < f , g > ] ≈ g ]
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
29 e3c : {a b c : Obj A} → { h : Hom A c (a ∧ b) } → A [ < A [ π o h ] , A [ π' o h ] > ≈ h ]
785
a67959bcd44b ccc → hom on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 784
diff changeset
30 π-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
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
31 -- closed
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
32 e4a : {a b c : Obj A} → { h : Hom A (c ∧ b) a } → A [ A [ ε o < A [ (h *) o π ] , π' > ] ≈ h ]
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
33 e4b : {a b c : Obj A} → { k : Hom A c (a <= b ) } → A [ ( A [ ε o < A [ k o π ] , π' > ] ) * ≈ k ]
787
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 785
diff changeset
34 *-cong : {a b c : Obj A} → { f f' : Hom A (a ∧ b) c } → A [ f ≈ f' ] → A [ f * ≈ f' * ]
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
35 open ≈-Reasoning A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
36 e'2 : ○ 1 ≈ id1 A 1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
37 e'2 = begin
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
38 ○ 1
793
f37f11e1b871 Hom a,b = Hom 1 b^a
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 789
diff changeset
39 ≈↑⟨ e2 ⟩
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
40 id1 A 1
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
41
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
42 e''2 : {a b : Obj A} {f : Hom A a b } → ( ○ b o f ) ≈ ○ a
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
43 e''2 {a} {b} {f} = begin
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
44 ○ b o f
793
f37f11e1b871 Hom a,b = Hom 1 b^a
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 789
diff changeset
45 ≈⟨ e2 ⟩
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
46 ○ a
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
47
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
48 π-id : {a b : Obj A} → < π , π' > ≈ id1 A (a ∧ b )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
49 π-id {a} {b} = begin
789
4e1e2f7199c8 CCC Hom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 787
diff changeset
50 < π , π' >
4e1e2f7199c8 CCC Hom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 787
diff changeset
51 ≈↑⟨ π-cong idR idR ⟩
4e1e2f7199c8 CCC Hom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 787
diff changeset
52 < π o id1 A (a ∧ b) , π' o id1 A (a ∧ b) >
4e1e2f7199c8 CCC Hom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 787
diff changeset
53 ≈⟨ e3c ⟩
4e1e2f7199c8 CCC Hom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 787
diff changeset
54 id1 A (a ∧ b )
4e1e2f7199c8 CCC Hom done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 787
diff changeset
55
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
56 distr-π : {a b c d : Obj A} {f : Hom A c a }{g : Hom A c b } {h : Hom A d c } → ( < f , g > o h ) ≈ < ( f o h ) , ( g o h ) >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
57 distr-π {a} {b} {c} {d} {f} {g} {h} = begin
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
58 < f , g > o h
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
59 ≈↑⟨ e3c ⟩
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
60 < π o < f , g > o h , π' o < f , g > o h >
785
a67959bcd44b ccc → hom on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 784
diff changeset
61 ≈⟨ π-cong assoc assoc ⟩
a67959bcd44b ccc → hom on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 784
diff changeset
62 < ( π o < f , g > ) o h , (π' o < f , g > ) o h >
a67959bcd44b ccc → hom on going
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 784
diff changeset
63 ≈⟨ π-cong (car e3a ) (car e3b) ⟩
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
64 < f o h , g o h >
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
65
794
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
66 _×_ : { a b c d : Obj A } ( f : Hom A a c ) (g : Hom A b d ) → Hom A (a ∧ b) ( c ∧ d )
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
67 f × g = < ( f o π ) , (g o π' ) >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
68 π-exchg : {a b c : Obj A} {f : Hom A c a }{g : Hom A c b } → < π' , π > o < f , g > ≈ < g , f >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
69 π-exchg {a} {b} {c} {f} {g} = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
70 < π' , π > o < f , g >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
71 ≈⟨ distr-π ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
72 < π' o < f , g > , π o < f , g > >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
73 ≈⟨ π-cong e3b e3a ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
74 < g , f >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
76 π'π : {a b : Obj A} → < π' , π > o < π' , π > ≈ id1 A (a ∧ b)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
77 π'π = trans-hom π-exchg π-id
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
78 exchg-π : {a b c d : Obj A} {f : Hom A c a }{g : Hom A d b } → < f o π , g o π' > o < π' , π > ≈ < f o π' , g o π >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
79 exchg-π {a} {b} {c} {d} {f} {g} = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
80 < f o π , g o π' > o < π' , π >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
81 ≈⟨ distr-π ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
82 < (f o π) o < π' , π > , (g o π' ) o < π' , π > >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
83 ≈↑⟨ π-cong assoc assoc ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
84 < f o (π o < π' , π > ) , g o (π' o < π' , π >)>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
85 ≈⟨ π-cong (cdr e3a) (cdr e3b) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
86 < f o π' , g o π >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
87
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
88 distr-* : {a b c d : Obj A } { h : Hom A (a ∧ b) c } { k : Hom A d a } → ( h * o k ) ≈ ( h o < ( k o π ) , π' > ) *
794
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
89 distr-* {a} {b} {c} {d} {h} {k} = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
90 h * o k
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
91 ≈↑⟨ e4b ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
92 ( ε o < (h * o k ) o π , π' > ) *
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
93 ≈⟨ *-cong ( begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
94 ε o < (h * o k ) o π , π' >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
95 ≈↑⟨ cdr ( π-cong assoc refl-hom ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
96 ε o ( < h * o ( k o π ) , π' > )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
97 ≈↑⟨ cdr ( π-cong (cdr e3a) e3b ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
98 ε o ( < h * o ( π o < k o π , π' > ) , π' o < k o π , π' > > )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
99 ≈⟨ cdr ( π-cong assoc refl-hom) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
100 ε o ( < (h * o π) o < k o π , π' > , π' o < k o π , π' > > )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
101 ≈↑⟨ cdr ( distr-π ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
102 ε o ( < h * o π , π' > o < k o π , π' > )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
103 ≈⟨ assoc ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
104 ( ε o < h * o π , π' > ) o < k o π , π' >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
105 ≈⟨ car e4a ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
106 h o < k o π , π' >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
107 ∎ ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
108 ( h o < k o π , π' > ) *
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
109
794
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
110 α : {a b c : Obj A } → Hom A (( a ∧ b ) ∧ c ) ( a ∧ ( b ∧ c ) )
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
111 α = < ( π o π ) , < ( π' o π ) , π' > >
794
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
112 α' : {a b c : Obj A } → Hom A ( a ∧ ( b ∧ c ) ) (( a ∧ b ) ∧ c )
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
113 α' = < < π , ( π o π' ) > , ( π' o π' ) >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
114 β : {a b c d : Obj A } { f : Hom A a b} { g : Hom A a c } { h : Hom A a d } → ( α o < < f , g > , h > ) ≈ < f , < g , h > >
794
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
115 β {a} {b} {c} {d} {f} {g} {h} = begin
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
116 α o < < f , g > , h >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
117 ≈⟨⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
118 ( < ( π o π ) , < ( π' o π ) , π' > > ) o < < f , g > , h >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
119 ≈⟨ distr-π ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
120 < ( ( π o π ) o < < f , g > , h > ) , ( < ( π' o π ) , π' > o < < f , g > , h > ) >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
121 ≈⟨ π-cong refl-hom distr-π ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
122 < ( ( π o π ) o < < f , g > , h > ) , ( < ( ( π' o π ) o < < f , g > , h > ) , ( π' o < < f , g > , h > ) > ) >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
123 ≈↑⟨ π-cong assoc ( π-cong assoc refl-hom ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
124 < ( π o (π o < < f , g > , h >) ) , ( < ( π' o ( π o < < f , g > , h > ) ) , ( π' o < < f , g > , h > ) > ) >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
125 ≈⟨ π-cong (cdr e3a ) ( π-cong (cdr e3a ) e3b ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
126 < ( π o < f , g > ) , < ( π' o < f , g > ) , h > >
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
127 ≈⟨ π-cong e3a ( π-cong e3b refl-hom ) ⟩
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
128 < f , < g , h > >
967
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 965
diff changeset
129
794
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 793
diff changeset
130
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
131
784
f27d966939f8 add CCC hom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 783
diff changeset
132 record CCC {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) : Set ( c₁ ⊔ c₂ ⊔ ℓ ) where
781
340708e8d54f fix for 2.5.4.2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 780
diff changeset
133 field
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
134 1 : Obj A
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
135 ○ : (a : Obj A ) → Hom A a 1
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
136 _∧_ : Obj A → Obj A → Obj A
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
137 <_,_> : {a b c : Obj A } → Hom A c a → Hom A c b → Hom A c (a ∧ b)
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
138 π : {a b : Obj A } → Hom A (a ∧ b) a
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
139 π' : {a b : Obj A } → Hom A (a ∧ b) b
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
140 _<=_ : (a b : Obj A ) → Obj A
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
141 _* : {a b c : Obj A } → Hom A (a ∧ b) c → Hom A a (c <= b)
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
142 ε : {a b : Obj A } → Hom A ((a <= b ) ∧ b) a
784
f27d966939f8 add CCC hom
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 783
diff changeset
143 isCCC : IsCCC A 1 ○ _∧_ <_,_> π π' _<=_ _* ε
781
340708e8d54f fix for 2.5.4.2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 780
diff changeset
144
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
145 ----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
146 --
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
147 -- Sub Object Classifier as Topos
954
6aa6cbf630a0 fix Burroni
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 953
diff changeset
148 -- pull back on
963
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
149 -- ○ b
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
150 -- b -----------→ 1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
151 -- | |
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
152 -- m | | ⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
153 -- ↓ char m ↓
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
154 -- a -----------→ Ω
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
155 -- h
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
156 --
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
157 open Equalizer
963
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
158 open import equalizer
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
159
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
160 record Mono {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) {b a : Obj A} (mono : Hom A b a) : Set (c₁ ⊔ c₂ ⊔ ℓ) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
161 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
162 isMono : {c : Obj A} ( f g : Hom A c b ) → A [ A [ mono o f ] ≈ A [ mono o g ] ] → A [ f ≈ g ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
163
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
164 open Mono
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
165
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
166 record IsTopos {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (c : CCC A)
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
167 ( Ω : Obj A )
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
168 ( ⊤ : Hom A (CCC.1 c) Ω )
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
169 (Ker : {a : Obj A} → ( h : Hom A a Ω ) → Equalizer A h (A [ ⊤ o (CCC.○ c a) ]))
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
170 (char : {a b : Obj A} → (m : Hom A b a) → Mono A m → Hom A a Ω) : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
171 field
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
172 char-ker : {a b : Obj A } {h : Hom A a Ω} (m : Hom A b a) → (mono : Mono A m)
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
173 → A [ char m mono ≈ h ]
954
6aa6cbf630a0 fix Burroni
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 953
diff changeset
174 ker-char : {a b : Obj A} → (m : Hom A b a) → (mono : Mono A m) → Iso A b ( equalizer-c (Ker ( char m mono )))
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
175
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
176 record Topos {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (c : CCC A) : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
177 field
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
178 Ω : Obj A
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
179 ⊤ : Hom A (CCC.1 c) Ω
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
180 Ker : {a : Obj A} → ( h : Hom A a Ω ) → Equalizer A h (A [ ⊤ o (CCC.○ c a) ])
952
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 950
diff changeset
181 char : {a b : Obj A} → (m : Hom A b a ) → Mono A m → Hom A a Ω
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
182 isTopos : IsTopos A c Ω ⊤ Ker char
950
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
183 ker : {a : Obj A} → ( h : Hom A a Ω ) → Hom A ( equalizer-c (Ker h) ) a
bd32a37784b0 Topos start
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 949
diff changeset
184 ker h = equalizer (Ker h)
973
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 967
diff changeset
185 Monik : {a : Obj A} (h : Hom A a Ω) → Mono A (equalizer (Ker h))
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 967
diff changeset
186 Monik h = record { isMono = λ f g → monic (Ker h ) }
975
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
187 char-m=⊤ : {a b : Obj A} → (m : Hom A b a) → (mono : Mono A m) → A [ A [ char m mono o m ] ≈ A [ ⊤ o CCC.○ c b ] ]
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
188 char-m=⊤ {a} {b} m mono = begin
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
189 char m mono o m ≈⟨ car (IsTopos.char-ker isTopos m mono) ⟩
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
190 (⊤ o CCC.○ c a) o m ≈↑⟨ assoc ⟩
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
191 ⊤ o (CCC.○ c a o m ) ≈⟨ cdr (IsCCC.e2 (CCC.isCCC c)) ⟩
f8fba4f1dcfa char-m=⊤
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 974
diff changeset
192 ⊤ o CCC.○ c b ∎ where open ≈-Reasoning A
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
193
963
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
194 record NatD {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( 1 : Obj A) : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
195 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
196 Nat : Obj A
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
197 nzero : Hom A 1 Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
198 nsuc : Hom A Nat Nat
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
199
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
200 open NatD
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
201
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
202 record IsToposNat {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( 1 : Obj A) (TNat : NatD A 1 )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
203 ( gNat : (nat : NatD A 1 ) → Hom A (Nat TNat) (Nat nat) )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
204 : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
205 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
206 izero : (nat : NatD A 1 ) → A [ A [ gNat nat o nzero TNat ] ≈ nzero nat ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
207 isuc : (nat : NatD A 1 ) → A [ A [ gNat nat o nsuc TNat ] ≈ A [ nsuc nat o gNat nat ] ]
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
208
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
209 record ToposNat {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( 1 : Obj A) : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
210 field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
211 TNat : NatD A 1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
212 gNat : (nat : NatD A 1 ) → Hom A (Nat TNat) (Nat nat)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 954
diff changeset
213 isToposN : IsToposNat A 1 TNat gNat
783
bded2347efa4 CCC by equation
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 781
diff changeset
214