Other Agda modules in this section (188)

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

# The corner equation for double currying

The comparison between the two orders of evaluating a corner retains the
reflected side comparisons and their uncurried images. Its coordinate
part is the actual five-factor matching of the currying permutation.

```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
import SCT.VolumeI.Chapter02.Section01.IntervalEndpoints as Endpoints

module SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Endpoints.DoubleEvaluationCorners
  {c m a : Level} (š’Æ : Theory c m a) (M : Mapping.MappingAnimae š’Æ)
  (ℱ : Categories.FunctorCategories š’Æ M) (P : Laws.PullbackStructure š’Æ)
  (I : Walking.WalkingMorphism š’Æ) (E : Endpoints.IntervalEndpoints š’Æ M ℱ P I) where

open import SCT.VolumeI.Chapter02.Section01.EvaluationCalculus.EndpointEvaluation š’Æ M ℱ public
open import SCT.VolumeI.Chapter02.Section02.UnitCalculus.DirectUnitTriangles š’Æ M ℱ P I E using (module ReflectedEndpoint)
import SCT.VolumeI.Chapter02.Section02.SquareCalculus.SquareCurrying as Currying
import SCT.VolumeI.Chapter02.Section02.SquareCalculus.SquareCurryingCoordinates as Axes
import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.DoubleEvaluationCoordinates as Coordinates
import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Restriction.CurryRestrictionCorner as Restriction
import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Postcomposition.CurryPostcomposition as Postcomposition
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN
open PN vocabulary terminal products productLaws composition vertical whiskering using (cancel-left)

pre-chain : {X Y Z : CAT} {f g h : MAP Y Z} (α : g =₁ h) (β : f =₁ g)
  (r : MAP X Y) {s : MAP X Z} (tail : s =₁ (f ∘ r)) →
  (((α āˆ™ β) ā–· r) āˆ™ tail) =ā‚‚ ((α ā–· r) āˆ™ ((β ā–· r) āˆ™ tail))
pre-chain α β r tail = isoComp-assoc-at (α ā–· r) (β ā–· r) tail āˆ™
  isoComp-cong (preWhisker-isoComp-at α β r) (idIso tail)

module At {Ī“ A B C : CAT} (W : MAP Ī“ (Fun (A Ɨ B) C))
  (u : Obj-abs A) (v : Obj-abs B) where
  module Curried = Currying.At š’Æ M ℱ W
  module H = Curried.Horizontal u
  module V = Curried.Vertical v
  module Coord = Coordinates.At š’Æ M ℱ Curried.H u v
  module Inner = Restriction.At š’Æ M ℱ Curried.diagram (insert v) u
  module Outer = Postcomposition.Evaluation š’Æ M ℱ P I E (evaluate u) Curried.first-curry v
  h = Curried.H
  ia = insert {X = Ī“} u
  ib = insert {X = Ī“} v
  qH = funPre-uncurry (Axes.coinsert š’Æ M ℱ u) W
  qV = funPre-uncurry (insert v) W
  aH = comp-assoc H.Coordinate.step Curried.Coordinates.permute h
  aV = comp-assoc V.Coordinate.step Curried.Coordinates.permute h
  headH = h ◁ H.Coordinate.comparison
  headV = h ◁ V.Coordinate.comparison
  curry-edge = evaluate-curry u Curried.diagram
  ĪøH = headH āˆ™ (aH āˆ™ (curry-edge āˆ™ Outer.raw))
  ĪøV = headV āˆ™ (aV āˆ™ Inner.raw)
  module RefH = ReflectedEndpoint v H.evaluated H.side qH θH H.comparison H.comparison-β
  module RefV = ReflectedEndpoint u (Curried.first-curry ∘ ib) V.side qV θV V.restricted V.restricted-β
  left = (qH ā–· ib) āˆ™ evaluate-uncurry v H.side
  right = (qV ā–· ia) āˆ™ evaluate-uncurry u V.side
  outer-endpoint = evaluate-uncurry v H.evaluated
  inner-endpoint = evaluate-uncurry u (Curried.first-curry ∘ ib)
  outer-tail = (Outer.raw ā–· ib) āˆ™ outer-endpoint
  inner-tail = (Inner.raw ā–· ia) āˆ™ inner-endpoint
  outer-boundary = (evaluate u ◁ evaluate-curry v Curried.first-curry) āˆ™
    evaluate-post-at v (evaluate u) Curried.nested
  boundary = (evaluate u ◁ V.boundary) āˆ™ evaluate-post-at v (evaluate u) Curried.nested
  top = curry-edge ā–· ib
  middle = comp-assoc ib Curried.first-curry (evaluate u)
  vhead = headV ā–· ia
  va = aV ā–· ia
  hhead = headH ā–· ib
  ha = aH ā–· ib
  horizontal-normal = hhead āˆ™ (ha āˆ™ (top āˆ™ outer-tail))
  vertical-normal = vhead āˆ™ (va āˆ™ inner-tail)

  abstract
    horizontal-image : (left āˆ™ (evaluate v ◁ H.comparison)) =ā‚‚ horizontal-normal
    horizontal-image = isoComp-cong (idIso hhead)
        (isoComp-cong (idIso ha) (pre-chain curry-edge Outer.raw ib outer-endpoint) āˆ™
          pre-chain aH (curry-edge āˆ™ Outer.raw) ib outer-endpoint) āˆ™
      pre-chain headH (aH āˆ™ (curry-edge āˆ™ Outer.raw)) ib outer-endpoint āˆ™ RefH.endpoint

    vertical-image : (right āˆ™ (evaluate u ◁ V.restricted)) =ā‚‚ vertical-normal
    vertical-image = isoComp-cong (idIso vhead) (pre-chain aV Inner.raw ia inner-endpoint) āˆ™
      pre-chain headV (aV āˆ™ Inner.raw) ia inner-endpoint āˆ™ RefV.endpoint

    boundary-image : (right āˆ™ boundary) =ā‚‚ (vertical-normal āˆ™ outer-boundary)
    boundary-image = isoComp-cong vertical-image (idIso outer-boundary) āˆ™
      (isoComp-assoc-at right (evaluate u ◁ V.restricted) outer-boundary) ⁻¹ āˆ™
      isoComp-cong (idIso right)
        (isoComp-assoc-at (evaluate u ◁ V.restricted)
          (evaluate u ◁ evaluate-curry v Curried.first-curry)
          (evaluate-post-at v (evaluate u) Curried.nested) āˆ™
        isoComp-cong (postWhisker-isoComp-at (evaluate u) V.restricted
          (evaluate-curry v Curried.first-curry))
          (idIso (evaluate-post-at v (evaluate u) Curried.nested)))

    interior : (inner-tail āˆ™ outer-boundary) =ā‚‚ (Coord.Eā‚‚ āˆ™ (top āˆ™ outer-tail))
    interior = isoComp-assoc-at Coord.Eā‚‚ top outer-tail āˆ™
      isoComp-cong (idIso (Coord.Eā‚‚ āˆ™ top)) (cancel-left middle outer-tail) āˆ™
      isoComp-assoc-at (Coord.Eā‚‚ āˆ™ top) (middle ⁻¹) (middle āˆ™ outer-tail) āˆ™
      isoComp-cong Inner.comparison (Outer.comparison ⁻¹)

    comparison : (right āˆ™ boundary) =ā‚‚
      (Coord.result āˆ™ (left āˆ™ (evaluate v ◁ H.comparison)))
    comparison = isoComp-cong (idIso Coord.result) (horizontal-image ⁻¹) āˆ™
      isoComp-cong (idIso Coord.result) (isoComp-assoc-at hhead ha (top āˆ™ outer-tail)) āˆ™
      isoComp-assoc-at Coord.result (hhead āˆ™ ha) (top āˆ™ outer-tail) āˆ™
      isoComp-cong Coord.comparison (idIso (top āˆ™ outer-tail)) āˆ™
      (isoComp-assoc-at vhead (va āˆ™ Coord.Eā‚‚) (top āˆ™ outer-tail)) ⁻¹ āˆ™
      isoComp-cong (idIso vhead) ((isoComp-assoc-at va Coord.Eā‚‚ (top āˆ™ outer-tail)) ⁻¹) āˆ™
      isoComp-cong (idIso vhead) (isoComp-cong (idIso va) interior) āˆ™
      isoComp-cong (idIso vhead) (isoComp-assoc-at va inner-tail outer-boundary) āˆ™
      isoComp-assoc-at vhead (va āˆ™ inner-tail) outer-boundary āˆ™ boundary-image
```