{-# OPTIONS --without-K --safe #-} open import Categories.Category.Core open import Categories.Object.Terminal hiding (up-to-iso) module Categories.Object.NaturalNumbers {o β e} (π : Category o β e) (π-Terminal : Terminal π) where open import Level open import Categories.Morphism π open import Categories.Morphism.Reasoning π open Category π open HomReasoning open Equiv open Terminal π-Terminal record IsNNO (N : Obj) : Set (o β β β e) where field z : β€ β N s : N β N universal : β {A} β β€ β A β A β A β N β A z-commute : β {A} {q : β€ β A} {f : A β A} β q β universal q f β z s-commute : β {A} {q : β€ β A} {f : A β A} β f β universal q f β universal q f β s unique : β {A} {q : β€ β A} {f : A β A} {u : N β A} β q β u β z β f β u β u β s β u β universal q f Ξ· : universal z s β id Ξ· = βΊ (unique (βΊ identityΛ‘) id-comm) universal-cong : β {A} β {f fβ² : β€ β A} β {g gβ² : A β A} β f β fβ² β g β gβ² β universal f g β universal fβ² gβ² universal-cong fβfβ² gβgβ² = unique (βΊ fβfβ² β z-commute) (β-resp-βΛ‘ (βΊ gβgβ²) β s-commute) record NNO : Set (o β β β e) where field N : Obj isNNO : IsNNO N open IsNNO isNNO public open NNO module _ (N : NNO) (Nβ² : NNO) where private module N = NNO N module Nβ² = NNO Nβ² up-to-iso : N.N β Nβ².N up-to-iso = record { from = N.universal Nβ².z Nβ².s ; to = Nβ².universal N.z N.s ; iso = record { isoΛ‘ = universal-β N Nβ² ; isoΚ³ = universal-β Nβ² N } } where universal-β : β (N Nβ² : NNO) β universal Nβ² (z N) (s N) β universal N (z Nβ²) (s Nβ²) β id universal-β N Nβ² = unique N (z-commute Nβ² β pushΚ³ (z-commute N)) (pullΛ‘ (s-commute Nβ²) β assoc β β-resp-βΚ³ (s-commute N) β βΊ assoc) β (Ξ· N)