module Cubical.Categories.Presheaf.Morphism where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Sigma
open import Cubical.Categories.Category
open import Cubical.Categories.Instances.Elements
open import Cubical.Categories.Instances.Lift
open import Cubical.Categories.Functor
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Instances.TotalCategory
open import Cubical.Categories.Isomorphism
open import Cubical.Categories.Limits
open import Cubical.Categories.NaturalTransformation
open import Cubical.Categories.Presheaf.Base
open import Cubical.Categories.Presheaf.Representable
open import Cubical.Categories.Displayed.Base
open import Cubical.Categories.Displayed.Functor
open import Cubical.Categories.Displayed.Instances.Element
open import Cubical.Categories.Displayed.HLevels
private
variable
ℓc ℓc' ℓd ℓd' ℓp ℓq : Level
open Category
open Contravariant
open Functor
open NatTrans
open UniversalElement
module _ {C : Category ℓc ℓc'}{D : Category ℓd ℓd'}
(F : Functor C D)
(P : Presheaf C ℓp)
(Q : Presheaf D ℓq) where
private
module P = PresheafNotation P
module Q = PresheafNotation Q
PshHom : Type (ℓ-max (ℓ-max (ℓ-max ℓc ℓc') ℓp) ℓq)
PshHom =
PresheafCategory C (ℓ-max ℓp ℓq)
[ LiftF ℓq ∘F P , LiftF ℓp ∘F Q ∘F (F ^opF) ]
module _ (h : PshHom) where
pushEltF : Functor (∫ P) (∫ Q)
pushEltF = ∫F {F = F} (mkPropHomsFunctor (hasPropHomsElement Q)
(λ {x} z → h .N-ob x (lift z) .lower)
λ {x} {y} {f} {p} {p'} fp≡p' →
F ⟪ f ⟫ Q.⋆ (h .N-ob _ (lift p') .lower)
≡[ i ]⟨ h .N-hom f (~ i) (lift p') .lower ⟩
h .N-ob _ (lift (f P.⋆ p')) .lower
≡[ i ]⟨ h .N-ob _ (lift (fp≡p' i)) .lower ⟩
h .N-ob _ (lift p) .lower
∎)
preservesRepresentation : ∀ (η : UniversalElement C P)
→ Type (ℓ-max (ℓ-max ℓd ℓd') ℓq)
preservesRepresentation η = isUniversal D Q _ (h .N-ob _ (lift (η .element)) .lower)
preservesRepresentations : Type _
preservesRepresentations = ∀ η → preservesRepresentation η
preservesAnyRepresentation→preservesAllRepresentations :
∀ η → preservesRepresentation η → preservesRepresentations
preservesAnyRepresentation→preservesAllRepresentations η preserves-η η' =
isTerminalToIsUniversal D Q
(preserveAnyTerminal→PreservesTerminals (∫ P)
(∫ Q)
pushEltF
(universalElementToTerminalElement C P η)
(isUniversalToIsTerminal D Q _ _ preserves-η)
(universalElementToTerminalElement C P η'))