# HG changeset patch # User Shinji KONO # Date 1620546747 -32400 # Node ID 10b4d04b734f1063ca2717c2b152594ca25ac911 # Parent 2755bac8d8b92691b81c4104778c13f36c6605cb fix topos char iso diff -r 2755bac8d8b9 -r 10b4d04b734f src/CCC.agda --- a/src/CCC.agda Sun May 09 00:20:48 2021 +0900 +++ b/src/CCC.agda Sun May 09 16:52:27 2021 +0900 @@ -190,6 +190,9 @@ open Mono +eMonic : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) {b a : Obj A} { f g : Hom A b a } → (equ : Equalizer A f g ) → Mono A (equalizer equ) +eMonic A equ = record { isMono = λ f g → monic equ } + iso-mono : {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) {a b c : Obj A } {m : Hom A a b} ( mono : Mono A m ) (i : Iso A a c ) → Mono A (A [ m o Iso.≅← i ] ) iso-mono A {a} {b} {c} {m} mono i = record { isMono = λ {d} f g → im f g } where im : {d : Obj A} (f g : Hom A d c ) → A [ A [ A [ m o Iso.≅← i ] o f ] ≈ A [ A [ m o Iso.≅← i ] o g ] ] → A [ f ≈ g ] @@ -246,27 +249,15 @@ (char : {a b : Obj A} → (m : Hom A b a) → Mono A m → Hom A a Ω) : Set ( suc c₁ ⊔ suc c₂ ⊔ suc ℓ ) where field ker-m : {a b : Obj A} → (m : Hom A b a ) → (mono : Mono A m) → IsEqualizer A m (char m mono) (A [ ⊤ o (CCC.○ c a) ]) - char-iso : {a b : Obj A } {m : Hom A a b} {h : Hom A b Ω}( mono : Mono A m ) → ( i : Iso A a (equalizer-c (Ker h)) ) - → A [ char (A [ m o Iso.≅← i ]) (iso-mono A mono i) ≈ h ] - char-cong : {a b : Obj A } { m m' : Hom A b a } { mono : Mono A m } { mono' : Mono A m' } + char-uniqueness : {a b : Obj A } {h : Hom A a Ω} + → A [ char (equalizer (Ker h)) (record { isMono = λ f g → monic (Ker h)}) ≈ h ] + char-iso : {a a' b : Obj A} → (p : Hom A a b ) (q : Hom A a' b ) → (mp : Mono A p) →(mq : Mono A q) → + Iso A a a' → A [ char p mp ≈ char q mq ] + char-cong : {a b : Obj A } { m m' : Hom A b a } { mono : Mono A m } { mono' : Mono A m' } → A [ m ≈ m' ] → A [ char m mono ≈ char m' mono' ] + char-cong {a} {b} {m} {m'} {mo} {mo'} m=m' = char-iso m m' mo mo' (≡-iso A _) ker : {a : Obj A} → ( h : Hom A a Ω ) → Hom A ( equalizer-c (Ker h) ) a ker h = equalizer (Ker h) - char-uniqueness : {a b : Obj A } {h : Hom A a Ω} - → A [ char (equalizer (Ker h)) (record { isMono = λ f g → monic (Ker h)}) ≈ h ] - char-uniqueness {a} {b} {h} = begin - char (equalizer (Ker h)) (record { isMono = λ f g → monic (Ker h)}) ≈⟨ char-cong ( - begin - equalizer (Ker h) ≈↑⟨ idR ⟩ - equalizer (Ker h) o id1 A _ ≈↑⟨ cdr (idR) ⟩ - equalizer (Ker h) o ( id1 A _ o id1 A _ ) ≈⟨ assoc ⟩ - (equalizer (Ker h) o Iso.≅→ (≡-iso A _)) o Iso.≅← (≡-iso A _) ∎ ) ⟩ - char ( ( equalizer (Ker h) o Iso.≅→ (≡-iso A _)) o Iso.≅← (≡-iso A _) ) (iso-mono A (≡-mono→ h) (≡-iso A _)) ≈⟨ char-iso (≡-mono→ h) (≡-iso A _) ⟩ - h ∎ where - open ≈-Reasoning A - ≡-mono→ : {a : Obj A } (h : Hom A a Ω) → - Mono A ( equalizer (Ker h) o (Iso.≅→ (≡-iso A (equalizer-c (Ker h))))) - ≡-mono→ {a} h = iso-mono→ A (record { isMono = λ f g → monic (Ker h)} ) (≡-iso A _) 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 ] ] char-m=⊤ {a} {b} m mono = begin char m mono o m ≈⟨ IsEqualizer.fe=ge (ker-m m mono) ⟩ diff -r 2755bac8d8b9 -r 10b4d04b734f src/CCCSets.agda --- a/src/CCCSets.agda Sun May 09 00:20:48 2021 +0900 +++ b/src/CCCSets.agda Sun May 09 16:52:27 2021 +0900 @@ -137,7 +137,8 @@ ; char = λ m mono → tchar m mono ; isTopos = record { char-uniqueness = λ {a} {b} {h} → extensionality Sets ( λ x → uniq h x ) - ; ker-m = λ m mono → equalizerIso _ _ (tker (tchar m mono)) m (isol m mono) + ; char-iso = iso-m + ; ker-m = ker-iso } } where -- @@ -200,10 +201,11 @@ s2i : {a b : Obj (Sets {c}) } (m : Hom Sets b a) → (mono : Mono Sets m ) → (e : sequ a Bool (tchar m mono) (λ _ → true )) → image m (equ e) s2i {a} {b} m mono (elem y eq) with lem (image m y) ... | case1 im = im - isol : {a b : Obj (Sets {c}) } (m : Hom Sets b a) → (mono : Mono Sets m ) → IsoL Sets m (λ (e : sequ a Bool (tchar m mono) (λ _ → true )) → equ e ) - isol {a} {b} m mono = record { iso-L = record { ≅→ = b→s ; ≅← = b←s ; - iso→ = extensionality Sets ( λ x → iso1 x ) - ; iso← = extensionality Sets ( λ x → iso2 x) } ; iso≈L = extensionality Sets ( λ s → iso3 s ) } where + iso-m : {a a' b : Obj Sets} (p : Hom Sets a b) (q : Hom Sets a' b) (mp : Mono Sets p) (mq : Mono Sets q) → + Iso Sets a a' → Sets [ tchar p mp ≈ tchar q mq ] + iso-m {a} {a'} {b} p q mp mq i = {!!} + ker-iso : {a b : Obj Sets} (m : Hom Sets b a) (mono : Mono Sets m) → IsEqualizer Sets m (tchar m mono) (Sets [ (λ _ → true) o CCC.○ sets a ]) + ker-iso {a} {b} m mono = equalizerIso _ _ (tker (tchar m mono)) m isol (extensionality Sets ( λ x → iso4 x)) where b→s : Hom Sets b (sequ a Bool (tchar m mono) (λ _ → true)) b→s x = b2s m mono x b←s : Hom Sets (sequ a Bool (tchar m mono) (λ _ → true)) b @@ -219,6 +221,11 @@ i2b m (isImage x) ≡⟨⟩ x ∎ where open ≡-Reasoning iso1 x | false | record { eq = eq1 } = ⊥-elim ( tchar¬Img m mono (m x) eq1 (isImage x)) + iso4 : (x : b ) → (Sets [ Equalizer.equalizer (tker (tchar m mono)) o b→s ]) x ≡ m x + iso4 x = begin + equ (b2s m mono x) ≡⟨ sym (iso3 (b2s m mono x)) ⟩ + m (b←s (b2s m mono x)) ≡⟨ cong (λ k → m k ) (iso1 x) ⟩ + m x ∎ where open ≡-Reasoning iso2 : (x : sequ a Bool (tchar m mono) (λ _ → true) ) → (Sets [ b→s o b←s ]) x ≡ id1 Sets (sequ a Bool (tchar m mono) (λ _ → true)) x iso2 (elem y eq) = begin b→s ( b←s (elem y eq)) ≡⟨⟩ @@ -240,7 +247,10 @@ ... | true | record {eq = eq1} = refl ... | false | record { eq = eq1 } with tchar¬Img m mono (m x) eq1 ... | t = ⊥-elim (t (isImage x)) - + isol : Iso Sets b (Equalizer.equalizer-c (tker (tchar m mono))) + isol = record { ≅→ = b→s ; ≅← = b←s ; + iso→ = extensionality Sets ( λ x → iso1 x ) + ; iso← = extensionality Sets ( λ x → iso2 x) } -- ; iso≈L = extensionality Sets ( λ s → iso3 s ) } where open import Polynominal (Sets {c} ) (sets {c}) A = Sets {c} Ω = Bool diff -r 2755bac8d8b9 -r 10b4d04b734f src/ToposIL.agda --- a/src/ToposIL.agda Sun May 09 00:20:48 2021 +0900 +++ b/src/ToposIL.agda Sun May 09 16:52:27 2021 +0900 @@ -4,7 +4,7 @@ open import cat-utility open import HomReasoning open import Data.List hiding ( [_] ) -module ToposIL {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (c : CCC A) where +module ToposIL {c₁ c₂ ℓ : Level} (A : Category c₁ c₂ ℓ) (c : CCC A) (n : ToposNat A (CCC.1 c)) where open Topos open Equalizer @@ -115,62 +115,67 @@ tl01 : {a b : Obj A} (p q : Poly a (Topos.Ω t) b ) → p ⊢ q → q ⊢ p → A [ Poly.f p ≈ Poly.f q ] tl01 {a} {b} p q p