Other Agda modules in this chapter (87)

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

# Reducing the terminal coordinate after postcomposition

Decoding a named functor removes its terminal coordinate. The reduction
commutes with postcomposition, using the specified associator, unitor,
and retraction. This is the structural part of the naming coherence.

```agda
{-# OPTIONS --safe --without-K #-}
open import Agda.Primitive using (Level)
open import SCT.VolumeI.Chapter01.Theory using (Theory)
import SCT.VolumeI.Chapter01.Section03.IdentificationCalculus.Structural as Structural
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.IteratedPairing as Iterated
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingUnits as PairingUnitLaws
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as Naturality
import SCT.VolumeI.Chapter01.Section02.Isomorphisms as Isomorphisms

module SCT.VolumeI.Chapter03.RelativeCategories.Evaluation.PointReductionCoherence
  {c m a : Level} (𝒯 : Theory c m a) where

open import SCT.VolumeI.Chapter01.Section04.Setup 𝒯
open import SCT.VolumeI.Chapter01.Section06.ConeCalculus.InverseCalculus 𝒯 using (pre-inverse)
open Structural vocabulary terminal products productLaws composition whiskering using (postWhisker-comp-at)
open Iterated vocabulary terminal products productLaws composition vertical whiskering pentagonTriangle using (pentagon-whiskered)
open PairingUnitLaws vocabulary terminal products productLaws composition vertical whiskering pentagonTriangle using (right-unitor-comp)
open Naturality vocabulary terminal products productLaws composition vertical whiskering using (cancel-right)
open Isomorphisms vocabulary terminal products productLaws composition vertical whiskering using (reassociateFour)

module Reduction {B X : CAT} (i : MAP B X) (r : MAP X B) (e : (r ∘ i) =₁ id B) where
  reduce : {C : CAT} (h : MAP B C) β†’ ((h ∘ r) ∘ i) =₁ h
  reduce h = comp-unitΚ³ h βˆ™ ((h ◁ e) βˆ™ comp-assoc i r h)

  module Post {C D : CAT} (h : MAP B C) (g : MAP C D) where
    Aβ‚€ : ((g ∘ h) ∘ id B) =₁ (g ∘ (h ∘ id B))
    Aβ‚€ = comp-assoc (id B) h g
    A₁ : (((g ∘ h) ∘ r) ∘ i) =₁ ((g ∘ (h ∘ r)) ∘ i)
    A₁ = comp-assoc r h g β–· i
    Aβ‚‚ : ((g ∘ (h ∘ r)) ∘ i) =₁ (g ∘ ((h ∘ r) ∘ i))
    Aβ‚‚ = comp-assoc i (h ∘ r) g
    A₃ : ((h ∘ r) ∘ i) =₁ (h ∘ (r ∘ i))
    A₃ = comp-assoc i r h
    Aβ‚„ : ((g ∘ h) ∘ (r ∘ i)) =₁ (g ∘ (h ∘ (r ∘ i)))
    Aβ‚„ = comp-assoc (r ∘ i) h g
    Aβ‚… : (((g ∘ h) ∘ r) ∘ i) =₁ ((g ∘ h) ∘ (r ∘ i))
    Aβ‚… = comp-assoc i r (g ∘ h)
    ρ : (h ∘ id B) =₁ h
    ρ = comp-unitʳ h

    abstract
      merge : ((g ◁ ρ) βˆ™ ((g ◁ (h ◁ e)) βˆ™ (g ◁ A₃))) =β‚‚ (g ◁ reduce h)
      merge = (postWhisker-isoComp-at g ρ ((h ◁ e) βˆ™ A₃)) ⁻¹ βˆ™
        isoComp-cong (idIso (g ◁ ρ)) ((postWhisker-isoComp-at g (h ◁ e) A₃) ⁻¹)

      composition-comparison : reduce (g ∘ h) =β‚‚ ((g ◁ reduce h) βˆ™ (Aβ‚‚ βˆ™ A₁))
      composition-comparison = isoComp-cong merge (idIso (Aβ‚‚ βˆ™ A₁)) βˆ™
        ((isoComp-assoc-at (g ◁ ρ) ((g ◁ (h ◁ e)) βˆ™ (g ◁ A₃)) (Aβ‚‚ βˆ™ A₁)) ⁻¹ βˆ™
          (isoComp-cong (idIso (g ◁ ρ)) ((isoComp-assoc-at (g ◁ (h ◁ e)) (g ◁ A₃) (Aβ‚‚ βˆ™ A₁)) ⁻¹) βˆ™
            (isoComp-cong (idIso (g ◁ ρ)) (isoComp-cong (idIso (g ◁ (h ◁ e))) (pentagon-whiskered i r h g)) βˆ™
              (isoComp-cong (idIso (g ◁ ρ)) (isoComp-assoc-at (g ◁ (h ◁ e)) Aβ‚„ Aβ‚…) βˆ™
                (isoComp-cong (idIso (g ◁ ρ)) (isoComp-cong (postWhisker-comp-at e h g) (idIso Aβ‚…)) βˆ™
                  (reassociateFour (g ◁ ρ) Aβ‚€ ((g ∘ h) ◁ e) Aβ‚… βˆ™
                    isoComp-cong (right-unitor-comp h g) (idIso (((g ∘ h) ◁ e) βˆ™ Aβ‚…))))))))

      cancel-associator : (reduce (g ∘ h) βˆ™ (comp-assoc r h g ⁻¹ β–· i)) =β‚‚
        ((g ◁ reduce h) βˆ™ Aβ‚‚)
      cancel-associator = cancel-right A₁ ((g ◁ reduce h) βˆ™ Aβ‚‚) βˆ™
        isoComp-cong ((isoComp-assoc-at (g ◁ reduce h) Aβ‚‚ A₁) ⁻¹ βˆ™ composition-comparison)
          (pre-inverse (comp-assoc r h g) i)
```