Other Agda modules in this section (188)

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

# Calculus of endpoint-preserving identifications

Identity, inversion, composition, and a change of endpoint frames retain
the two equations in `ExpressionIso`. These operations let the proofs
below compare full morphism expressions, including their endpoints.

```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.Chapter02.Section01.WalkingMorphism as Walking

module SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionIdentifications
  {c m a : Level} (𝒯 : Theory c m a) (M : Mapping.MappingAnimae 𝒯)
  (β„± : Categories.FunctorCategories 𝒯 M) (I : Walking.WalkingMorphism 𝒯) where

open import SCT.VolumeI.Chapter02.Section01.Morphisms 𝒯 M β„± I
open import SCT.VolumeI.Chapter01.Section04.SquareCalculus.ProjectionSquares 𝒯 using (post-inverse)
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN
open PN vocabulary terminal products productLaws composition vertical whiskering using (cancel-right)

expressionIso-id : {Ξ“ C : CAT} {x y : MAP Ξ“ C} (f : MorphismExpression x y) β†’ ExpressionIso f f
expressionIso-id f = record
  { comparison = idIso F.arrow
  ; source-compatible = isoComp-unitΚ³-at F.source-frame βˆ™
      isoComp-cong (idIso F.source-frame) (postWhisker-idIso evβ‚€ F.arrow)
  ; target-compatible = isoComp-unitΚ³-at F.target-frame βˆ™
      isoComp-cong (idIso F.target-frame) (postWhisker-idIso ev₁ F.arrow) }
  where module F = MorphismExpression f

expressionIso-compose : {Ξ“ C : CAT} {x y : MAP Ξ“ C} {f g h : MorphismExpression x y} β†’
  ExpressionIso g h β†’ ExpressionIso f g β†’ ExpressionIso f h
expressionIso-compose {f = f} {g} {h} Ξ² Ξ± = record
  { comparison = B.comparison βˆ™ A.comparison
  ; source-compatible = endpoint evβ‚€ F.source-frame G.source-frame H.source-frame A.source-compatible B.source-compatible
  ; target-compatible = endpoint ev₁ F.target-frame G.target-frame H.target-frame A.target-compatible B.target-compatible }
  where
  module F = MorphismExpression f
  module G = MorphismExpression g
  module H = MorphismExpression h
  module A = ExpressionIso Ξ±
  module B = ExpressionIso Ξ²
  endpoint : (v : MAP (Ar _) _) {z : MAP _ _}
    (p : (v ∘ F.arrow) =₁ z) (q : (v ∘ G.arrow) =₁ z) (r : (v ∘ H.arrow) =₁ z) β†’
    (q βˆ™ (v ◁ A.comparison)) =β‚‚ p β†’ (r βˆ™ (v ◁ B.comparison)) =β‚‚ q β†’
    (r βˆ™ (v ◁ (B.comparison βˆ™ A.comparison))) =β‚‚ p
  endpoint v p q r first second = first βˆ™
    (isoComp-cong second (idIso (v ◁ A.comparison)) βˆ™
      ((isoComp-assoc-at r (v ◁ B.comparison) (v ◁ A.comparison)) ⁻¹ βˆ™
        isoComp-cong (idIso r) (postWhisker-isoComp-at v B.comparison A.comparison)))

expressionIso-inverse : {Ξ“ C : CAT} {x y : MAP Ξ“ C} {f g : MorphismExpression x y} β†’
  ExpressionIso f g β†’ ExpressionIso g f
expressionIso-inverse {f = f} {g} Ξ± = record
  { comparison = A.comparison ⁻¹
  ; source-compatible = endpoint evβ‚€ F.source-frame G.source-frame A.source-compatible
  ; target-compatible = endpoint ev₁ F.target-frame G.target-frame A.target-compatible }
  where
  module F = MorphismExpression f
  module G = MorphismExpression g
  module A = ExpressionIso Ξ±
  endpoint : (v : MAP (Ar _) _) {z : MAP _ _}
    (p : (v ∘ F.arrow) =₁ z) (q : (v ∘ G.arrow) =₁ z) β†’
    (q βˆ™ (v ◁ A.comparison)) =β‚‚ p β†’ (p βˆ™ (v ◁ A.comparison ⁻¹)) =β‚‚ q
  endpoint v p q same = cancel-right (v ◁ A.comparison) q βˆ™
    (isoComp-cong (same ⁻¹) (idIso ((v ◁ A.comparison) ⁻¹)) βˆ™
      isoComp-cong (idIso p) (post-inverse v A.comparison))

retarget-expressionIso : {Ξ“ C : CAT} {x y xβ€² yβ€² : MAP Ξ“ C}
  {f g : MorphismExpression x y} β†’ ExpressionIso f g β†’
  (p : x =₁ xβ€²) (q : y =₁ yβ€²) β†’
  ExpressionIso (retarget-expression f p q) (retarget-expression g p q)
retarget-expressionIso {g = g} Ξ± p q = record
  { comparison = A.comparison
  ; source-compatible = isoComp-cong (idIso p) A.source-compatible βˆ™
      isoComp-assoc-at p (MorphismExpression.source-frame g) (evβ‚€ ◁ A.comparison)
  ; target-compatible = isoComp-cong (idIso q) A.target-compatible βˆ™
      isoComp-assoc-at q (MorphismExpression.target-frame g) (ev₁ ◁ A.comparison) }
  where module A = ExpressionIso Ξ±
```