{-# OPTIONS --warning=error #-} open import LogicalFormulae open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import Naturals open import Vectors postulate extensionality : {a b : _} {S : Set a}{T : S → Set b} {f g : (x : S) → T x} → ((x : S) → f x ≡ g x) → f ≡ g record Category {a b : _} : Set (lsuc (a ⊔ b)) where field objects : Set a arrows : objects → objects → Set b id : (x : objects) → arrows x x _∘_ : {x y z : objects} → arrows y z → arrows x y → arrows x z rightId : {x y : objects} → (f : arrows x y) → (id y) ∘ f ≡ f leftId : {x y : objects} → (f : arrows x y) → f ∘ (id x) ≡ f associative : {x y z w : objects} → (f : arrows z w) → (g : arrows y z) → (h : arrows x y) → (f ∘ (g ∘ h)) ≡ (f ∘ g) ∘ h dual : {a b : _} → Category {a} {b} → Category {a} {b} dual record { objects = objects ; arrows = arrows ; id = id ; _∘_ = _∘_ ; rightId = rightId ; leftId = leftId ; associative = associative } = record { objects = objects ; arrows = λ i j → arrows j i ; id = id ; _∘_ = λ {x y z} g f → f ∘ g ; rightId = λ {x y} f → leftId f ; leftId = λ {x y} f → rightId f ; associative = λ {x y z w} f g h → equalityCommutative (associative h g f) } SET : {a : _} → Category {lsuc a} {a} SET {a} = record { objects = Set a ; arrows = λ i j → (i → j) ; id = λ X x → x ; _∘_ = λ g f x → g (f x) ; rightId = λ f → refl ; leftId = λ f → refl ; associative = λ f g h → refl } ≡Unique : {a : _} {X : Set a} → {a b : X} → (p1 p2 : a ≡ b) → (p1 ≡ p2) ≡Unique refl refl = refl NatPreorder : Category {lzero} {lzero} NatPreorder = record { objects = ℕ ; arrows = λ m n → m ≤N n ; id = λ x → inr refl ; _∘_ = λ f g → leqTransitive g f ; rightId = λ x