Other Agda modules in this section (188)

Complete compiler-highlighted source. Follow a symbol to its declaration.

# Realizing operations on families of morphisms

An operation on parameterized morphism expressions that respects
restriction defines a functor between endpoint pullbacks. Its action on
an arbitrary family is obtained by restriction of the universal family.
If two such operations are inverse, their realized functors are inverse.
The endpoint-change law is needed when using the specified base comparison
of a pullback lift.

```agda
{-# OPTIONS --safe --without-K #-}
open import Agda.Primitive using (Level; _โŠ”_)
open import SCT.VolumeI.Chapter01.Theory using (Theory)
import SCT.VolumeI.Chapter01.Section04.MappingAnimae as Mapping
import SCT.VolumeI.Chapter01.Section07.FunctorCategories as Categories
import SCT.VolumeI.Chapter01.Section06.PullbackLaws as Laws
import SCT.VolumeI.Chapter02.Section01.WalkingMorphism as Walking

module SCT.VolumeI.Chapter02.Section02.MorphismCalculus.EndpointFiberOperations
  {c m a : Level} (๐’ฏ : Theory c m a) (M : Mapping.MappingAnimae ๐’ฏ)
  (โ„ฑ : Categories.FunctorCategories ๐’ฏ M) (P : Laws.PullbackStructure ๐’ฏ)
  (I : Walking.WalkingMorphism ๐’ฏ) where

open import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.EndpointFiberLifts ๐’ฏ M โ„ฑ P I public
open import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionIdentifications ๐’ฏ M โ„ฑ I
open Laws.PullbackStructure P

record ExpressionOperation {B C D : CAT} (u v : MAP B C) (s t : MAP B D) : Set (c โŠ” m) where
  field
    apply : {ฮ“ : CAT} (b : MAP ฮ“ B) โ†’
      MorphismExpression (u โˆ˜ b) (v โˆ˜ b) โ†’ MorphismExpression (s โˆ˜ b) (t โˆ˜ b)
    on-comparison : {ฮ“ : CAT} (b : MAP ฮ“ B)
      {f g : MorphismExpression (u โˆ˜ b) (v โˆ˜ b)} โ†’ ExpressionIso f g โ†’
      ExpressionIso (apply b f) (apply b g)
    on-restriction : {ฮ“ ฮ” : CAT} (b : MAP ฮ“ B)
      (f : MorphismExpression (u โˆ˜ b) (v โˆ˜ b)) (h : MAP ฮ” ฮ“) โ†’
      ExpressionIso (Lifts.restrict s t b (apply b f) h)
        (apply (b โˆ˜ h) (Lifts.restrict u v b f h))
    on-change : {ฮ“ : CAT} {b d : MAP ฮ“ B}
      (f : MorphismExpression (u โˆ˜ b) (v โˆ˜ b)) (ฯƒ : b =โ‚ d) โ†’
      ExpressionIso (retarget-expression (apply b f) (s โ— ฯƒ) (t โ— ฯƒ))
        (apply d (retarget-expression f (u โ— ฯƒ) (v โ— ฯƒ)))

module Realize {B C D : CAT} {u v : MAP B C} {s t : MAP B D}
  (operation : ExpressionOperation u v s t) where
  private
    module O = ExpressionOperation operation
    module Source = Fiber u v using (decode; decode-restrict; read; encode-decode)
    module Target = Lifts s t using (lift-restrict; lift-cong)
  module H = EndpointFiber u v
  module K = EndpointFiber s t

  universal : MorphismExpression (u โˆ˜ H.base) (v โˆ˜ H.base)
  universal = Source.decode (pullbackCone endpoints (pair u v))

  functor : MAP H.category K.category
  functor = K.lift H.base (O.apply H.base universal)

  base : (K.base โˆ˜ functor) =โ‚ H.base
  base = K.lift-base H.base (O.apply H.base universal)

  abstract
    on-family : {ฮ“ : CAT} (h : MAP ฮ“ H.category) โ†’
      (functor โˆ˜ h) =โ‚ K.lift (H.base โˆ˜ h) (O.apply (H.base โˆ˜ h) (Source.read h))
    on-family h = Target.lift-cong (H.base โˆ˜ h)
      (expressionIso-compose
        (O.on-comparison (H.base โˆ˜ h) (Source.decode-restrict (pullbackCone endpoints (pair u v)) h))
        (O.on-restriction H.base universal h)) โˆ™
      Target.lift-restrict H.base (O.apply H.base universal) h

    lift-universal : H.lift H.base universal =โ‚ id H.category
    lift-universal = Lifts.lift-universal u v

module InverseOperations {B C D : CAT} {u v : MAP B C} {s t : MAP B D}
  (forward : ExpressionOperation u v s t) (backward : ExpressionOperation s t u v)
  (inverse-law : {ฮ“ : CAT} (b : MAP ฮ“ B) (f : MorphismExpression (u โˆ˜ b) (v โˆ˜ b)) โ†’
    ExpressionIso (ExpressionOperation.apply backward b (ExpressionOperation.apply forward b f)) f) where
  private
    module F = ExpressionOperation forward
    module G = ExpressionOperation backward
    module A = Realize forward using (functor; base; universal; lift-universal)
    module Z = Realize backward using (functor; on-family)
    module H = EndpointFiber u v
    module K = EndpointFiber s t
    module Source = Lifts u v using (lift-change)
    module Target = Fiber s t using (read; read-lift)

  abstract
    composite : (Z.functor โˆ˜ A.functor) =โ‚ id H.category
    composite = A.lift-universal โˆ™
      Source.lift-change (G.apply (K.base โˆ˜ A.functor) (Target.read A.functor)) A.universal A.base
        (expressionIso-compose (inverse-law H.base A.universal)
          (expressionIso-compose
            (G.on-comparison H.base (Target.read-lift H.base (F.apply H.base A.universal)))
            (G.on-change (Target.read A.functor) A.base))) โˆ™
      Z.on-family A.functor

module EquivalenceOperations {B C D : CAT} {u v : MAP B C} {s t : MAP B D}
  (forward : ExpressionOperation u v s t) (backward : ExpressionOperation s t u v)
  (left-law : {ฮ“ : CAT} (b : MAP ฮ“ B) (f : MorphismExpression (u โˆ˜ b) (v โˆ˜ b)) โ†’
    ExpressionIso (ExpressionOperation.apply backward b (ExpressionOperation.apply forward b f)) f)
  (right-law : {ฮ“ : CAT} (b : MAP ฮ“ B) (g : MorphismExpression (s โˆ˜ b) (t โˆ˜ b)) โ†’
    ExpressionIso (ExpressionOperation.apply forward b (ExpressionOperation.apply backward b g)) g) where

  isEquiv : IsEquiv (Realize.functor forward)
  isEquiv = record
    { inverse = Realize.functor backward
    ; sectionIso = (InverseOperations.composite forward backward left-law) โปยน
    ; retractionIso = (InverseOperations.composite backward forward right-law) โปยน }

  equivalence : Equiv (EndpointFiber.category u v) (EndpointFiber.category s t)
  equivalence = record { functor = Realize.functor forward ; isEquiv = isEquiv }
```