module Cat.Displayed.Functor.Total where

Total functor🔗

Given displayed categories and and a displayed functor over we can recover an ordinary functor between total categories.

  ∫ᶠ : Functor (∫ ℰ) (∫ ℱ)
  ∫ᶠ .F₀ (x , x') = ₀ F x , ₀' F' x'
  ∫ᶠ .F₁ (∫hom f f') = ∫hom _ (₁' F' f')
  ∫ᶠ .F-id = ∫Hom-path ℱ _ (F' .F-id')
  ∫ᶠ .F-∘ (∫hom f f') (∫hom g g') = ∫Hom-path ℱ _ (F' .F-∘')

The total functor respects the projection πᶠ to the base category so that

commutes.

  ∫ᶠ-preserves-base : F F∘ (πᶠ ℰ) ≡ (πᶠ ℱ) F∘ ∫ᶠ
  ∫ᶠ-preserves-base = Functor-path (λ x → refl) (λ f → refl)

Indeed, a displayed functor over can be thought of as a repackaging of the data of a functor for which this diagram commutes.

The total functor of the displayed identity functor Id' is of course the ordinary identity functor Id.

  ∫ᶠId'≅Id : ∫ᶠ (Id' {ℰ = ℰ}) ≅ⁿ Id
  ∫ᶠId'≅Id = to-natural-iso record where
    eta x = ∫ℰ.id
    inv x = ∫ℰ.id
    eta∘inv x = ∫ℰ.idl ∫ℰ.id
    inv∘eta x = ∫ℰ.idl ∫ℰ.id
    natural x y f =
      f ∫ℰ.∘ ∫ℰ.id  ≡⟨ ∫ℰ.idr f ⟩≡
      f             ≡˘⟨ ∫ℰ.idl f ⟩≡˘
      ∫ℰ.id ∫ℰ.∘ f  ∎

Similarly, the composite of two total functors is the total of the composite.

  ∫ᶠ∘ : ∫ᶠ (F' F∘' G') ≅ⁿ ∫ᶠ F' F∘ ∫ᶠ G'
  ∫ᶠ∘ = to-natural-iso record where
    eta x = ∫𝒢.id
    inv x = ∫𝒢.id
    eta∘inv x = ∫𝒢.idl ∫𝒢.id
    inv∘eta x = ∫𝒢.idl ∫𝒢.id
    natural x y f =
      ₁ (∫ᶠ F' F∘ ∫ᶠ G') f ∫𝒢.∘ ∫𝒢.id ≡⟨ ∫𝒢.idr (₁ (∫ᶠ F' F∘ ∫ᶠ G') f) ⟩≡
      ₁ (∫ᶠ (F' F∘' G')) f            ≡˘⟨ ∫𝒢.idl (₁ (∫ᶠ F' F∘ ∫ᶠ G') f) ⟩≡˘
      ∫𝒢.id ∫𝒢.∘ ₁ (∫ᶠ (F' F∘' G')) f ∎

Total natural transformations🔗

Suppose we have an additional displayed functor over and a displayed natural transformation over We can then similarly recover an ordinary natural transformation between total functors:

  ∫ⁿ : ∫ᶠ F' => ∫ᶠ G'
  ∫ⁿ = record where
    η (x , x') = ∫hom _ (η' x')
    is-natural (x , x') (y , y') (∫hom f f') = ∫Hom-path ℱ _ (is-natural' x' y' f')

Applying the projection πᶠ to the total natural transformation gives back in the following sense:

  ∫ⁿ-preserves-base : PathP
    (λ i → ∫ᶠ-preserves-base F' i => ∫ᶠ-preserves-base G' i)
    (ηⁿ ◂ πᶠ ℰ) (πᶠ ℱ ▸ ∫ⁿ)
  ∫ⁿ-preserves-base = Nat-pathp
    (∫ᶠ-preserves-base F') (∫ᶠ-preserves-base G') λ x → refl