963
|
1 module ToposEx where
|
|
2 open import CCC
|
|
3 open import Level
|
|
4 open import Category
|
|
5 open import cat-utility
|
|
6 open import HomReasoning
|
|
7
|
|
8 open Topos
|
|
9 open Equalizer
|
|
10
|
|
11 -- ○ b
|
|
12 -- b -----------→ 1
|
|
13 -- | |
|
|
14 -- m | | ⊤
|
|
15 -- ↓ char m ↓
|
|
16 -- a -----------→ Ω
|
|
17 -- h
|
964
|
18 --
|
|
19 -- Ker t h : Equalizer A h (A [ ⊤ o (○ a) ])
|
963
|
20
|
|
21 topos-pullback : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( 1 : Obj A) (○ : (a : Obj A ) → Hom A a 1)
|
|
22 → (e2 : {a : Obj A} → ∀ { f : Hom A a 1 } → A [ f ≈ ○ a ] )
|
|
23 → (t : Topos A 1 ○ ) → {a : Obj A} → (h : Hom A a (Ω t)) → Pullback A h (⊤ t)
|
|
24 topos-pullback A 1 ○ e2 t {a} h = record {
|
|
25 ab = equalizer-c (Ker t h) -- b
|
|
26 ; π1 = equalizer (Ker t h) -- m
|
|
27 ; π2 = ○ ( equalizer-c (Ker t h) ) -- ○ b
|
|
28 ; isPullback = record {
|
|
29 commute = comm
|
|
30 ; pullback = λ {d} {p1} {p2} eq → IsEqualizer.k (isEqualizer (Ker t h)) p1 (lemma1 p1 p2 eq )
|
964
|
31 ; π1p=π1 = IsEqualizer.ek=h (isEqualizer (Ker t h))
|
|
32 ; π2p=π2 = λ {d} {p1'} {p2'} {eq} → lemma2 eq
|
|
33 ; uniqueness = uniq
|
963
|
34 }
|
|
35 } where
|
|
36 open ≈-Reasoning A
|
|
37 comm : A [ A [ h o equalizer (Ker t h) ] ≈ A [ ⊤ t o ○ (equalizer-c (Ker t h)) ] ]
|
|
38 comm = begin
|
964
|
39 h o equalizer (Ker t h) ≈⟨ IsEqualizer.fe=ge (isEqualizer (Ker t h)) ⟩
|
|
40 (⊤ t o ○ a ) o equalizer (Ker t h) ≈↑⟨ assoc ⟩
|
|
41 ⊤ t o (○ a o equalizer (Ker t h)) ≈⟨ cdr e2 ⟩
|
963
|
42 ⊤ t o ○ (equalizer-c (Ker t h)) ∎
|
|
43 lemma1 : {d : Obj A} (p1 : Hom A d a) (p2 : Hom A d 1) (eq : A [ A [ h o p1 ] ≈ A [ ⊤ t o p2 ] ] )
|
|
44 → A [ A [ h o p1 ] ≈ A [ A [ ⊤ t o ○ a ] o p1 ] ]
|
|
45 lemma1 {d} p1 p2 eq = begin
|
|
46 h o p1 ≈⟨ eq ⟩
|
|
47 ⊤ t o p2 ≈⟨ cdr e2 ⟩
|
|
48 ⊤ t o (○ d) ≈↑⟨ cdr e2 ⟩
|
|
49 ⊤ t o ( ○ a o p1 ) ≈⟨ assoc ⟩
|
|
50 (⊤ t o ○ a ) o p1 ∎
|
964
|
51 lemma2 : {d : Obj A} {p1' : Hom A d a} {p2' : Hom A d 1} (eq : A [ A [ h o p1' ] ≈ A [ ⊤ t o p2' ] ] )
|
|
52 → A [ A [ ○ (equalizer-c (Ker t h)) o IsEqualizer.k (isEqualizer (Ker t h)) p1'(lemma1 p1' p2' eq) ] ≈ p2' ]
|
|
53 lemma2 {d} {p1'} {p2'} eq = begin
|
|
54 ○ (equalizer-c (Ker t h)) o IsEqualizer.k (isEqualizer (Ker t h)) p1'(lemma1 p1' p2' eq) ≈⟨ e2 ⟩
|
|
55 ○ d ≈↑⟨ e2 ⟩
|
|
56 p2' ∎
|
|
57 uniq : {d : Obj A} (p' : Hom A d (equalizer-c (Ker t h))) {π1' : Hom A d a} {π2' : Hom A d 1} {eq : A [ A [ h o π1' ] ≈ A [ ⊤ t o π2' ] ]}
|
|
58 {π1p=π1' : A [ A [ equalizer (Ker t h) o p' ] ≈ π1' ]} {π2p=π2' : A [ A [ ○ (equalizer-c (Ker t h)) o p' ] ≈ π2' ]}
|
|
59 → A [ IsEqualizer.k (isEqualizer (Ker t h)) π1' (lemma1 π1' π2' eq) ≈ p' ]
|
|
60 uniq {d} (p') {p1'} {p2'} {eq} {pe1} {pe2} = begin
|
|
61 IsEqualizer.k (isEqualizer (Ker t h)) p1' (lemma1 p1' p2' eq) ≈⟨ IsEqualizer.uniqueness (isEqualizer (Ker t h)) pe1 ⟩
|
|
62 p' ∎
|
963
|
63
|
965
|
64 topos-m-pullback : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) ( 1 : Obj A) (○ : (a : Obj A ) → Hom A a 1)
|
|
65 → (e2 : {a : Obj A} → ∀ { f : Hom A a 1 } → A [ f ≈ ○ a ] )
|
|
66 → (t : Topos A 1 ○ ) → {a b : Obj A} → (m : Hom A b a) → (mono : Mono A m ) → Pullback A (char t m mono ) (⊤ t)
|
|
67 topos-m-pullback A 1 ○ e2 t {a} {b} m mono = topos-pullback A 1 ○ e2 t {a} (char t m mono)
|
964
|
68
|
965
|
69 ---
|
|
70 ---
|
|
71 ---
|
|
72
|
|
73 -- SubObjectFunctor : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) → ( 1 : Obj A) (○ : (a : Obj A ) → Hom A a 1)
|
|
74 -- → (e2 : {a : Obj A} → ∀ { f : Hom A a 1 } → A [ f ≈ ○ a ] ) → (t : Topos A 1 ○ ) → Functor A A
|
|
75 -- SubObjectFunctor A 1 ○ e2 t = record {
|
|
76 -- FObj = λ x → Ω t
|
|
77 -- ; FMap = {!!}
|
|
78 -- ; isFunctor = record {
|
|
79 -- identity = {!!}
|
|
80 -- ; distr = {!!}
|
|
81 -- ; ≈-cong = {!!}
|
|
82 -- }
|
|
83 -- }
|
|
84
|
971
|
85 module _ {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (c : CCC A) (t : Topos A (CCC.1 c) (CCC.○ c) ) where
|
|
86 open ≈-Reasoning A
|
|
87 open CCC.CCC c
|
965
|
88
|
971
|
89 δmono : {b : Obj A } → Mono A < id1 A b , id1 A b >
|
|
90 δmono = record {
|
|
91 isMono = m1
|
|
92 } where
|
|
93 m1 : {d b : Obj A} (f g : Hom A d b) → A [ A [ < id1 A b , id1 A b > o f ] ≈ A [ < id1 A b , id1 A b > o g ] ] → A [ f ≈ g ]
|
|
94 m1 {d} {b} f g = {!!}
|
965
|
95
|
971
|
96 prop32→ : {a b : Obj A}→ (f g : Hom A a b )
|
|
97 → A [ f ≈ g ] → A [ A [ char t < id1 A b , id1 A b > δmono o < f , g > ] ≈ A [ ⊤ t o ○ a ] ]
|
|
98 prop32→ = {!!}
|
|
99
|
|
100 prop23→ : {a b : Obj A}→ (f g : Hom A a b )
|
|
101 → A [ A [ char t < id1 A b , id1 A b > δmono o < f , g > ] ≈ A [ ⊤ t o ○ a ] ] → A [ f ≈ g ]
|
|
102 prop23→ = {!!}
|
|
103
|
|
104 N : (n : ToposNat A 1 ) → Obj A
|
|
105 N n = NatD.Nat (ToposNat.TNat n)
|
|
106
|
|
107 record prop33 (n : ToposNat A 1 ) {a : Obj A} (f : Hom A 1 a ) ( h : Hom A (N n ∧ a) a ) : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where
|
|
108 field
|
|
109 g : Hom A (N n) a
|
|
110 g0=f : A [ A [ g o NatD.nzero (ToposNat.TNat n) ] ≈ f ]
|
|
111 gs=h : A [ A [ g o NatD.nsuc (ToposNat.TNat n) ] ≈ A [ h o < id1 A _ , g > ] ]
|
|
112
|
|
113 cor33 : (n : ToposNat A 1 )
|
|
114 → ( {a : Obj A} (f : Hom A 1 a ) ( h : Hom A (N n ∧ a) a ) → prop33 n f h )
|
|
115 → coProduct A 1 ( NatD.Nat (ToposNat.TNat n) ) -- N ≅ N + 1
|
|
116 cor33 n p = record {
|
|
117 coproduct = N n
|
|
118 ; κ1 = NatD.nzero (ToposNat.TNat n)
|
|
119 ; κ2 = id1 A (N n)
|
|
120 ; isProduct = record {
|
|
121 _+_ = λ {a} f g → prop33.g ( p {a} f π' )
|
|
122 ; κ1fxg=f = λ {a} {f} {g} → prop33.g0=f (p f π' )
|
|
123 ; κ2fxg=g = λ {a} {f} {g} → ?
|
|
124 ; uniqueness = {!!}
|
|
125 ; +-cong = {!!}
|
|
126
|
|
127 }
|
|
128 }
|