{-# OPTIONS --safe --cubical-compatible --guardedness --exact-split --double-check #-}
module ALMA.SecondPass.ContCatEquivFunctor where
open import Agda.Primitive using (Level)
open import Agda.Builtin.Equality using (_≡_)
open import Relation.Binary.PropositionalEquality.Core using (cong; sym; trans)
open import Data.Product.Base using (_,_)
open import Data.Container.Core using (shape)
open import Categories.Category.Core using (Category)
open import Categories.Functor.Core using (Functor)
open import Categories.Functor using (id; _∘F_)
open import Categories.NaturalTransformation.Core
using (NaturalTransformation; _∘ᵥ_; _∘ʳ_)
open import Categories.NaturalTransformation.NaturalIsomorphism
using (NaturalIsomorphism; unitorʳ; associator)
open import ALMA.Cosmos.ContCategory using (ContCat)
open import ALMA.Cosmos.ContCategoryLemmas using (shape-eq-from-≈sr)
open import ALMA.Cosmos.ContCatEquiv using (ShapeCat)
module _ {o h e o′ ℓ′ e′ s p : Level}
{C : Category o h e}
{D : Category o′ ℓ′ e′}
(FC : Functor C (ContCat s p))
(FD : Functor D (ContCat s p))
(baseFunctor : Functor C D)
(containerNat : NaturalTransformation FC (FD ∘F baseFunctor)) where
record ContCatEquivFunctor : Set where
idContCatEquivFunctor : ∀ {o h e s p} {C : Category o h e}
(FC : Functor C (ContCat s p))
→ ContCatEquivFunctor FC FC id (NaturalIsomorphism.F⇐G unitorʳ)
idContCatEquivFunctor FC = record {}
compContCatEquivFunctor : ∀ {o h e o′ ℓ′ e′ o″ ℓ″ e″ s p}
{C : Category o h e}
{D : Category o′ ℓ′ e′}
{E : Category o″ ℓ″ e″}
(FC : Functor C (ContCat s p))
(FD : Functor D (ContCat s p))
(FE : Functor E (ContCat s p))
{bg : Functor D E} {bf : Functor C D}
{ng : NaturalTransformation FD (FE ∘F bg)}
{nf : NaturalTransformation FC (FD ∘F bf)}
→ ContCatEquivFunctor FD FE bg ng
→ ContCatEquivFunctor FC FD bf nf
→ ContCatEquivFunctor FC FE (bg ∘F bf)
( NaturalIsomorphism.F⇒G (associator bf bg FE)
∘ᵥ (ng ∘ʳ bf)
∘ᵥ nf
)
compContCatEquivFunctor _ _ _ _ _ = record {}
mkContCatEquivFunctor : ∀ {o h e o′ ℓ′ e′ s p}
{C : Category o h e} {D : Category o′ ℓ′ e′}
(F : Functor C D)
(FC : Functor C (ContCat s p))
(FD : Functor D (ContCat s p))
(α : NaturalTransformation FC (FD ∘F F))
→ ContCatEquivFunctor FC FD F α
mkContCatEquivFunctor _ _ _ _ = record {}
module ShapeCatMorphism {o h e o′ ℓ′ e′ s p}
{C : Category o h e} {D : Category o′ ℓ′ e′}
{FC : Functor C (ContCat s p)} {FD : Functor D (ContCat s p)}
{H : Functor C D}
{α : NaturalTransformation FC (FD ∘F H)}
(cf : ContCatEquivFunctor FC FD H α)
where
private
open NaturalTransformation α
module H = Functor H
module FC = Functor FC
module FD = Functor FD
S : Functor (ShapeCat C FC) (ShapeCat D FD)
S = record
{ F₀ = λ { (A , s) → (H.₀ A , shape (η A) s) }
; F₁ = λ { {(A , s)} {(B , t)} (f , p) →
let
comm-shape : shape (η B) (shape (FC.F₁ f) s) ≡ shape (FD.F₁ (H.F₁ f)) (shape (η A) s)
comm-shape = shape-eq-from-≈sr (commute f) s
q : shape (FD.F₁ (H.F₁ f)) (shape (η A) s) ≡ shape (η B) t
q = trans (sym comm-shape) (cong (shape (η B)) p)
in (H.F₁ f , q) }
; identity = λ { {A , s} → H.identity }
; homomorphism = λ { {f = _} {g = _} → H.homomorphism }
; F-resp-≈ = λ { {f = _} {g = _} f≈g → H.F-resp-≈ f≈g }
}