Other Agda modules in this section (188)

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

# Normalizing the endpoints of a restricted edge

A face followed by a diagram gives an edge of the resulting family.
The theorem below evaluates a specified comparison of that edge and
retains its endpoint frame. Restriction composition and naturality are
used through their checked interfaces; the product diagram is not expanded.

```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.Section02.EvaluationCalculus.Restriction.RestrictionCompositorEvaluation as Retained
import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Restriction.RestrictionEndpointComposition as Composition
import SCT.VolumeI.Chapter01.Section03.IdentificationCalculus.Structural as Structural
import SCT.VolumeI.Chapter01.Section03.ProductCalculus.PairingNaturality as PN

module SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Restriction.RestrictionEdgeEndpoints
  {c m a : Level} (š’Æ : Theory c m a) (M : Mapping.MappingAnimae š’Æ)
  (ℱ : Categories.FunctorCategories š’Æ M) (P : Laws.PullbackStructure š’Æ) where

open import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Restriction.RestrictionEvaluation š’Æ M ℱ P
open import SCT.VolumeI.Chapter01.Section04.Uncurrying š’Æ M using (productMap-pair)
open import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Restriction.RestrictionInsertions š’Æ M ℱ using (insertion)
open import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Endpoints.EndpointCornerFamilies š’Æ M ℱ P using (evaluate-cong-inverse)
open import SCT.VolumeI.Chapter01.Section06.ConeCalculus.ComparisonSquares š’Æ using (post-square)
open import SCT.VolumeI.Chapter01.Section08.MappingCalculus.Restriction.EvaluationSquares š’Æ using (append-square)
open Structural vocabulary terminal products productLaws composition whiskering using (whisker-mixed-at)
open PN vocabulary terminal products productLaws composition vertical whiskering using (cancel-left)

prefix : {A B C : CAT} (f : MAP A B) (x : Obj-abs A) →
  ((funEval ∘ productMap (id (Fun B C)) f) ∘ insert x) =₁ evaluate (f ∘ x)
prefix {B = B} {C = C} f x = (funEval ◁ insertion (Fun B C) f x) āˆ™
  comp-assoc (insert x) (productMap (id (Fun B C)) f) funEval

module Change {A B C : CAT} {f g : MAP A B} (α : f =₁ g) (x : Obj-abs A) where
  module R = Restriction {C = C} α x
  abstract
    comparison : (prefix {C = C} g x āˆ™ ((funEval ◁ R.image) ā–· R.i)) =ā‚‚
      (evaluate-cong {C = C} (α ā–· x) āˆ™ prefix f x)
    comparison = paste-squares
      (comp-assoc R.i R.F funEval) (comp-assoc R.i R.G funEval)
      (funEval ◁ (R.close-f āˆ™ productMap-pair (id R.X) f (id R.X) (const x)))
      (funEval ◁ (R.close-g āˆ™ productMap-pair (id R.X) g (id R.X) (const x)))
      ((funEval ◁ R.image) ā–· R.i) (funEval ◁ (R.image ā–· R.i)) (evaluate-cong (α ā–· x))
      (whisker-mixed-at R.image R.i funEval)
      (post-square funEval _ _ _ _ R.insertion-square)

module At {A B D C : CAT} (f : MAP A B) (g : MAP B D) (x : Obj-abs A)
  (r : MAP A D) (α : (g ∘ f) =₁ r) (z : Obj-abs D) (b : (r ∘ x) =₁ z) where
  module Raw = Retained.AtObject š’Æ M ℱ P {C = C} f g x
  X = Fun D C
  e = funEval {C = D} {D = C}
  i = insert {X = X} x
  image = e ◁ productMap-cong (idIso (id X)) α
  Q = evaluate-uncurry x (funPre {D = C} f ∘ funPre g)
  rest = (Raw.leading ā–· i) āˆ™ Q
  old = prefix {C = C} (g ∘ f) x
  new = prefix {C = C} r x
  va = evaluate-cong {C = C} (comp-assoc x f g)
  vb = evaluate-cong {C = C} b
  vα = evaluate-cong {C = C} (α ā–· x)
  route = evaluate-pre {C = C} g (f ∘ x) āˆ™
    ((evaluate-pre f x ā–· funPre g) āˆ™ (comp-assoc (funPre g) (funPre f) (evaluate x)) ⁻¹)
  endpoint = b āˆ™ ((α ā–· x) āˆ™ (comp-assoc x f g) ⁻¹)

  abstract
    compose-edge : (va āˆ™ (old āˆ™ rest)) =ā‚‚ route
    compose-edge = Composition.At.comparison š’Æ M ℱ P {C = C} f g x āˆ™
      isoComp-cong (idIso va) (Raw.comparison ⁻¹)

    remove-vertex : (old āˆ™ rest) =ā‚‚ (va ⁻¹ āˆ™ route)
    remove-vertex = isoComp-cong (idIso (va ⁻¹)) compose-edge āˆ™
      (cancel-left va (old āˆ™ rest)) ⁻¹

    endpoint-image : evaluate-cong {C = C} endpoint =ā‚‚ (vb āˆ™ (vα āˆ™ va ⁻¹))
    endpoint-image = isoComp-cong (idIso vb)
        (isoComp-cong (idIso vα) (evaluate-cong-inverse (comp-assoc x f g)) āˆ™
          evaluate-cong-comp (α ā–· x) ((comp-assoc x f g) ⁻¹)) āˆ™
      evaluate-cong-comp b ((α ā–· x) āˆ™ (comp-assoc x f g) ⁻¹)

  module Output {H : MAP (X Ɨ A) C}
    (out : (e ∘ productMap (id X) r) =₁ H)
    (finish : (H ∘ i) =₁ evaluate {C = C} z)
    (base : (finish āˆ™ (out ā–· i)) =ā‚‚ (vb āˆ™ new)) where
    diagram = out āˆ™ (image āˆ™ Raw.leading)
    remaining = (image ā–· i) āˆ™ rest

    abstract
      expand : (finish āˆ™ ((diagram ā–· i) āˆ™ Q)) =ā‚‚ (vb āˆ™ (new āˆ™ remaining))
      expand = append-square finish (out ā–· i) vb new remaining base āˆ™
        isoComp-cong (idIso finish)
          (isoComp-cong (idIso (out ā–· i)) (isoComp-assoc-at (image ā–· i) (Raw.leading ā–· i) Q) āˆ™
          (isoComp-assoc-at (out ā–· i) ((image ā–· i) āˆ™ (Raw.leading ā–· i)) Q āˆ™
            isoComp-cong
              (isoComp-cong (idIso (out ā–· i)) (preWhisker-isoComp-at image Raw.leading i) āˆ™
                preWhisker-isoComp-at out (image āˆ™ Raw.leading) i) (idIso Q)))

      normalize : (finish āˆ™ ((diagram ā–· i) āˆ™ Q)) =ā‚‚
        (evaluate-cong {C = C} endpoint āˆ™ route)
      normalize = isoComp-cong (endpoint-image ⁻¹) (idIso route) āˆ™
        ((isoComp-assoc-at vb (vα āˆ™ va ⁻¹) route) ⁻¹ āˆ™
        (isoComp-cong (idIso vb) ((isoComp-assoc-at vα (va ⁻¹) route) ⁻¹) āˆ™
        (isoComp-cong (idIso vb) (isoComp-cong (idIso vα) remove-vertex) āˆ™
        (isoComp-cong (idIso vb)
          (append-square new (image ā–· i) vα old rest (Change.comparison {C = C} α x)) āˆ™
          expand))))
```