cat/src/Cat/Category/Properties.agda

81 lines
3.2 KiB
Agda
Raw Normal View History

{-# OPTIONS --allow-unsolved-metas #-}
module Cat.Category.Properties where
open import Agda.Primitive
open import Data.Product
open import Cubical.PathPrelude
open import Cat.Category
open import Cat.Functor
open import Cat.Categories.Sets
module _ { ' : Level} { : Category '} { A B : .Category.Object } {X : .Category.Object} (f : .Category.Arrow A B) where
open Category
open IsCategory (isCategory)
iso-is-epi : Isomorphism { = } f Epimorphism { = } {X = X} f
iso-is-epi (f- , left-inv , right-inv) g₀ g₁ eq =
begin
g₀ ≡⟨ sym (proj₁ ident)
g₀ 𝟙 ≡⟨ cong (_⊕_ g₀) (sym right-inv)
g₀ (f f-) ≡⟨ assoc
(g₀ f) f- ≡⟨ cong (λ φ φ f-) eq
(g₁ f) f- ≡⟨ sym assoc
g₁ (f f-) ≡⟨ cong (_⊕_ g₁) right-inv
g₁ 𝟙 ≡⟨ proj₁ ident
g₁
iso-is-mono : Isomorphism { = } f Monomorphism { = } {X = X} f
iso-is-mono (f- , (left-inv , right-inv)) g₀ g₁ eq =
begin
g₀ ≡⟨ sym (proj₂ ident)
𝟙 g₀ ≡⟨ cong (λ φ φ g₀) (sym left-inv)
(f- f) g₀ ≡⟨ sym assoc
f- (f g₀) ≡⟨ cong (_⊕_ f-) eq
f- (f g₁) ≡⟨ assoc
(f- f) g₁ ≡⟨ cong (λ φ φ g₁) left-inv
𝟙 g₁ ≡⟨ proj₂ ident
g₁
iso-is-epi-mono : Isomorphism { = } f Epimorphism { = } {X = X} f × Monomorphism { = } {X = X} f
iso-is-epi-mono iso = iso-is-epi iso , iso-is-mono iso
{-
epi-mono-is-not-iso : { '} ¬ (( : Category {} {'}) {A B X : Object } (f : Arrow A B ) Epimorphism { = } {X = X} f Monomorphism { = } {X = X} f Isomorphism { = } f)
epi-mono-is-not-iso f =
let k = f {!!} {!!} {!!} {!!}
in {!!}
-}
2018-01-21 20:29:15 +00:00
module _ { '} ( : Category ') {{hasProducts : HasProducts }} (B C : .Category.Object) where
open Category
open HasProducts hasProducts
open Product
prod-obj : (A B : .Object) .Object
prod-obj A B = Product.obj (product A B)
-- The product mentioned in awodey in Def 6.1 is not the regular product of arrows.
-- It's a "parallel" product
×A : {A A' B B' : .Object} .Arrow A A' .Arrow B B'
.Arrow (prod-obj A B) (prod-obj A' B')
×A {A = A} {A' = A'} {B = B} {B' = B'} a b = arrowProduct (product A' B')
( ._⊕_ a ((product A B) .proj₁))
( ._⊕_ b ((product A B) .proj₂))
IsExponential : {Cᴮ : .Object} .Arrow (prod-obj Cᴮ B) C Set ( ')
IsExponential eval = (A : .Object) (f : .Arrow (prod-obj A B) C)
∃![ f~ ] ( ._⊕_ eval (×A f~ ( .𝟙)) f)
record Exponential : Set ( ') where
field
-- obj ≡ Cᴮ
obj : .Object
eval : .Arrow ( prod-obj obj B ) C
{{isExponential}} : IsExponential eval
_⇑_ = Exponential
2018-01-21 20:29:15 +00:00
-- yoneda : ∀ { '} → { : Category '} → Functor (Sets ⇑ (Opposite ))
-- yoneda = {!!}