Other Agda modules in this section (89)

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

# Cancelling the boundary of an evaluated square

These identities use only vertical composition of isomorphisms. Keeping
them independent of the evaluated functors makes the subsequent mate
calculations shorter and bounds the size of their elaboration problems.

```agda
{-# OPTIONS --safe --without-K #-}
open import Agda.Primitive using (Level)
open import SCT.VolumeI.Chapter01.Theory using (Theory)
import SCT.VolumeI.Chapter01.Section02.Isomorphisms as Isomorphisms
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN

module SCT.VolumeI.Chapter01.Section08.MappingCalculus.Restriction.EvaluationMateCalculus
  {c m a : Level} (𝒯 : Theory c m a) where

open import SCT.VolumeI.Chapter01.Section04.Setup 𝒯
open Isomorphisms vocabulary terminal products productLaws composition vertical whiskering using (cancel-inverse)
open PN vocabulary terminal products productLaws composition vertical whiskering using (cancel-left)

abstract
  append-four : {X Y : CAT} {aβ‚€ a₁ aβ‚‚ a₃ aβ‚„ aβ‚… : MAP X Y}
    (A : aβ‚„ =₁ aβ‚…) (B : a₃ =₁ aβ‚„) (C : aβ‚‚ =₁ a₃)
    (D : a₁ =₁ aβ‚‚) (E : aβ‚€ =₁ a₁) β†’
    ((A βˆ™ (B βˆ™ (C βˆ™ D))) βˆ™ E) =β‚‚ (A βˆ™ (B βˆ™ (C βˆ™ (D βˆ™ E))))
  append-four A B C D E = isoComp-cong (idIso A) (isoComp-cong (idIso B) (isoComp-assoc-at C D E)) βˆ™
    (isoComp-cong (idIso A) (isoComp-assoc-at B (C βˆ™ D) E) βˆ™ isoComp-assoc-at A (B βˆ™ (C βˆ™ D)) E)

  cancel-mate : {X Y : CAT} {aβ‚€ a₁ aβ‚‚ a₃ aβ‚„ aβ‚… : MAP X Y}
    (A : aβ‚… =₁ aβ‚„) (B : aβ‚„ =₁ a₃) (C : aβ‚‚ =₁ a₃)
    (B⁻ : a₃ =₁ aβ‚„) (U : a₁ =₁ aβ‚‚) (r : aβ‚€ =₁ a₁) (tail : aβ‚€ =₁ aβ‚…) β†’
    B⁻ =β‚‚ (B ⁻¹) β†’ (U βˆ™ r) =β‚‚ (C ⁻¹ βˆ™ (B βˆ™ (A βˆ™ tail))) β†’
    ((A ⁻¹ βˆ™ (B⁻ βˆ™ (C βˆ™ U))) βˆ™ r) =β‚‚ tail
  cancel-mate A B C B⁻ U r tail inverse square = cancel-left A tail βˆ™
    (isoComp-cong (idIso (A ⁻¹))
      (cancel-left B (A βˆ™ tail) βˆ™ isoComp-cong inverse (idIso (B βˆ™ (A βˆ™ tail)))) βˆ™
    (isoComp-cong (idIso (A ⁻¹)) (isoComp-cong (idIso B⁻) (cancel-inverse C (B βˆ™ (A βˆ™ tail)))) βˆ™
    (isoComp-cong (idIso (A ⁻¹)) (isoComp-cong (idIso B⁻) (isoComp-cong (idIso C) square)) βˆ™
      append-four (A ⁻¹) B⁻ C U r)))

  cancel-three : {X Y : CAT} {aβ‚€ a₁ aβ‚‚ a₃ aβ‚„ : MAP X Y}
    (A : a₁ =₁ aβ‚‚) (B : aβ‚‚ =₁ a₃) (C : a₃ =₁ aβ‚„) (u : aβ‚€ =₁ a₁) β†’
    (((A ⁻¹ βˆ™ B ⁻¹) βˆ™ C ⁻¹) βˆ™ (C βˆ™ (B βˆ™ (A βˆ™ u)))) =β‚‚ u
  cancel-three A B C u = cancel-left A u βˆ™
    (isoComp-cong (idIso (A ⁻¹)) (cancel-left B (A βˆ™ u)) βˆ™
    (isoComp-assoc-at (A ⁻¹) (B ⁻¹) (B βˆ™ (A βˆ™ u)) βˆ™
    (isoComp-cong (idIso (A ⁻¹ βˆ™ B ⁻¹)) (cancel-left C (B βˆ™ (A βˆ™ u))) βˆ™
      isoComp-assoc-at (A ⁻¹ βˆ™ B ⁻¹) (C ⁻¹) (C βˆ™ (B βˆ™ (A βˆ™ u))))))

  cancel-three-images : {X Y : CAT} {aβ‚€ a₁ aβ‚‚ a₃ aβ‚„ : MAP X Y}
    (A : a₁ =₁ aβ‚‚) (B : aβ‚‚ =₁ a₃) (C : a₃ =₁ aβ‚„) (u : aβ‚€ =₁ a₁)
    (A⁻ : aβ‚‚ =₁ a₁) (I : a₃ =₁ a₃) β†’
    A⁻ =β‚‚ (A ⁻¹) β†’ I =β‚‚ (idIso a₃) β†’
    (((A⁻ βˆ™ B ⁻¹) βˆ™ (I βˆ™ C ⁻¹)) βˆ™ (C βˆ™ (B βˆ™ (A βˆ™ u)))) =β‚‚ u
  cancel-three-images A B C u A⁻ I inverse identity = cancel-three A B C u βˆ™
    isoComp-cong
      (isoComp-cong (isoComp-cong inverse (idIso (B ⁻¹)))
        (isoComp-unitΛ‘-at (C ⁻¹) βˆ™ isoComp-cong identity (idIso (C ⁻¹))))
      (idIso (C βˆ™ (B βˆ™ (A βˆ™ u))))

  close-paste : {X Y : CAT} {aβ‚€ a₁ aβ‚‚ a₃ aβ‚„ : MAP X Y}
    (T : aβ‚„ =₁ a₃) (P : a₁ =₁ aβ‚„) (z : aβ‚€ =₁ a₁)
    (R : aβ‚‚ =₁ a₃) (S : a₁ =₁ aβ‚‚) (r : aβ‚€ =₁ aβ‚‚) (t : aβ‚€ =₁ a₃) β†’
    (T βˆ™ P) =β‚‚ (R βˆ™ S) β†’ (S βˆ™ z) =β‚‚ r β†’ (R βˆ™ r) =β‚‚ t β†’
    ((T βˆ™ P) βˆ™ z) =β‚‚ t
  close-paste T P z R S r t pasted source action = action βˆ™
    (isoComp-cong (idIso R) source βˆ™
      (isoComp-assoc-at R S z βˆ™ isoComp-cong pasted (idIso z)))
```