Other Agda modules in this section (188)

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

# The universal degenerate triangle

We use the universal arrow on `Ar C` and the actual identity expression.
The three edge comparisons are lifted directly from evaluation diagrams.
Their uncurried and evaluated images are retained. `DirectUnitEndpoints`
normalizes these images, and `DirectUnitPresentations` proves the three
vertex equations and the endpoint-preserving universal unit comparisons.

```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.UnitCalculus.DirectUnitTriangles
  {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.DiagramCalculus.DegenerateCocones 𝒯 M β„± P I E public
open import SCT.VolumeI.Chapter01.Section08.ProductSquares 𝒯 using (productRestriction-comp)
open import SCT.VolumeI.Chapter01.Section07.EvaluationCalculus.IsomorphismLifting 𝒯 M β„±
  using (funIsoReflect; funIsoReflect-Ξ²)

open import SCT.VolumeI.Chapter02.Section01.EvaluationCalculus.EndpointNaturality 𝒯 M β„± using (module Evaluation)
import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.UniversalArrowEvaluation as UniversalEvaluation
open import SCT.VolumeI.Chapter01.Section02.Isomorphisms
  vocabulary terminal products productLaws composition vertical whiskering using (cancel-inverse)

-- The prescribed uncurried image also prescribes the evaluated image.
module ReflectedEndpoint {Ξ“ A C : CAT} (x : Obj-abs A)
  (h k : MAP Ξ“ (Fun A C)) {H : MAP (Ξ“ Γ— A) C}
  (Ξ² : (funUncurry k) =₁ H) (ΞΈ : (funUncurry h) =₁ H)
  (Ξ΄ : h =₁ k) (image : (funUncurryIso Ξ΄) =β‚‚ (Ξ² ⁻¹ βˆ™ ΞΈ)) where
  i = insert {X = Ξ“} x

  abstract
    raw-endpoint : ((Ξ² β–· i) βˆ™ (funUncurryIso Ξ΄ β–· i)) =β‚‚ (ΞΈ β–· i)
    raw-endpoint = (preWhisker i ◁
      (cancel-inverse Ξ² ΞΈ βˆ™ isoComp-cong (idIso Ξ²) image)) βˆ™
      (preWhisker-isoComp-at β (funUncurryIso δ) i) ⁻¹

    endpoint : (((Ξ² β–· i) βˆ™ evaluate-uncurry x k) βˆ™ (evaluate x ◁ Ξ΄)) =β‚‚
      ((ΞΈ β–· i) βˆ™ evaluate-uncurry x h)
    endpoint = isoComp-cong raw-endpoint (idIso (evaluate-uncurry x h)) βˆ™
      ((isoComp-assoc-at (Ξ² β–· i) (funUncurryIso Ξ΄ β–· i) (evaluate-uncurry x h)) ⁻¹ βˆ™
      (isoComp-cong (idIso (Ξ² β–· i)) (Evaluation.natural x Ξ΄) βˆ™
        isoComp-assoc-at (Ξ² β–· i) (evaluate-uncurry x k) (evaluate x ◁ Ξ΄)))

module Universal (C : CAT) where
  X = Ar C

  arrow : MorphismExpression (evβ‚€ {C}) ev₁
  arrow = record
    { arrow = id X
    ; source-frame = comp-unitΚ³ evβ‚€
    ; target-frame = comp-unitΚ³ ev₁ }

  -- A constant restriction evaluates the universal arrow at its endpoint.
  constant-insertion : (x : Obj-abs [1]) β†’
    (productMap (id X) (const x)) =₁ (insert x ∘ pr₁)
  constant-insertion x = (pair-pre (id X) (const x) pr₁) ⁻¹ βˆ™
    pair-cong (idIso (id X ∘ pr₁))
      ((comp-assoc pr₁ (terminate X) x) ⁻¹ βˆ™
        ((x ◁ terminal-iso (terminate [1] ∘ prβ‚‚) (terminate X ∘ pr₁)) βˆ™
          comp-assoc prβ‚‚ (terminate [1]) x))

  constant-evaluation : (x : Obj-abs [1]) β†’
    (funEval ∘ productMap (id X) (const x)) =₁ (evaluate x ∘ pr₁)
  constant-evaluation x = (comp-assoc pr₁ (insert x) funEval) ⁻¹ βˆ™
    (funEval ◁ constant-insertion x)

  identity-evaluation : (funEval ∘ productMap (id X) (id [1])) =₁ funEval
  identity-evaluation = comp-unitΚ³ funEval βˆ™ (funEval ◁ productMap-id X [1])

  module Degeneracy (s : MAP [2] [1]) where
    triangle : MAP X (Fun [2] C)
    triangle = funPre s

    edge-image : (d : MAP [1] [2]) β†’
      (funUncurry (funPre d ∘ triangle)) =₁
        (funEval ∘ productMap (id X) (s ∘ d))
    edge-image d = (funEval ◁ productRestriction-comp X d s) βˆ™
      (comp-assoc (productMap (id X) d) (productMap (id X) s) funEval βˆ™
        ((funPre-Ξ² s β–· productMap (id X) d) βˆ™ funPre-uncurry d triangle))

    module IdentityEdge (d : MAP [1] [2]) (Ξ± : (s ∘ d) =₁ (id [1])) where
      diagram-image : (funUncurry (funPre d ∘ triangle)) =₁ funEval
      diagram-image = identity-evaluation βˆ™
        ((funEval ◁ productMap-cong (idIso (id X)) Ξ±) βˆ™ edge-image d)

      raw : (funUncurry (funPre d ∘ triangle)) =₁ (funUncurry (id X))
      raw = (funUncurry-id [1] C) ⁻¹ βˆ™ diagram-image

      comparison : (funPre d ∘ triangle) =₁ (id X)
      comparison = funIsoReflect _ _ raw

      retained-image : (funUncurryIso comparison) =β‚‚ raw
      retained-image = funIsoReflect-Ξ² _ _ raw

      abstract
        endpoint : (x : Obj-abs [1]) β†’
          (comp-unitΚ³ (evaluate {C = C} x) βˆ™ (evaluate x ◁ comparison)) =β‚‚
          ((diagram-image β–· insert x) βˆ™ evaluate-uncurry x (funPre d ∘ triangle))
        endpoint x = ReflectedEndpoint.endpoint x (funPre d ∘ triangle) (id X)
          (funUncurry-id [1] C) diagram-image comparison retained-image βˆ™
          isoComp-cong ((UniversalEvaluation.Universal.endpoint 𝒯 M β„± {C = C} x) ⁻¹)
            (idIso (evaluate x ◁ comparison))

    module ConstantEdge (d : MAP [1] [2]) (x : Obj-abs [1])
      (Ξ± : (s ∘ d) =₁ (const x)) where
      diagram-image : (funUncurry (funPre d ∘ triangle)) =₁ (evaluate x ∘ pr₁)
      diagram-image = constant-evaluation x βˆ™
        ((funEval ◁ productMap-cong (idIso (id X)) Ξ±) βˆ™ edge-image d)

      raw : (funUncurry (funPre d ∘ triangle)) =₁
        (funUncurry (MorphismExpression.arrow (identity-expression (evaluate x))))
      raw = (funCurry-Ξ² (evaluate x ∘ pr₁)) ⁻¹ βˆ™ diagram-image

      comparison : (funPre d ∘ triangle) =₁
        (MorphismExpression.arrow (identity-expression (evaluate x)))
      comparison = funIsoReflect _ _ raw

      retained-image : (funUncurryIso comparison) =β‚‚ raw
      retained-image = funIsoReflect-Ξ² _ _ raw

      abstract
        endpoint : (y : Obj-abs [1]) β†’
          (evaluate-curry y (evaluate x ∘ pr₁) βˆ™ (evaluate y ◁ comparison)) =β‚‚
          ((diagram-image β–· insert y) βˆ™ evaluate-uncurry y (funPre d ∘ triangle))
        endpoint y = ReflectedEndpoint.endpoint y (funPre d ∘ triangle)
          (MorphismExpression.arrow (identity-expression (evaluate x)))
          (funCurry-Ξ² (evaluate x ∘ pr₁)) diagram-image comparison retained-image

        source-image :
          (MorphismExpression.source-frame (identity-expression (evaluate x)) βˆ™
            (evβ‚€ ◁ comparison)) =β‚‚
          (identity-boundary zero (evaluate x) βˆ™
            ((diagram-image β–· insert zero) βˆ™ evaluate-uncurry zero (funPre d ∘ triangle)))
        source-image = isoComp-cong (idIso (identity-boundary zero (evaluate x))) (endpoint zero) βˆ™
          isoComp-assoc-at (identity-boundary zero (evaluate x))
            (evaluate-curry zero (evaluate x ∘ pr₁)) (evβ‚€ ◁ comparison)

        target-image :
          (MorphismExpression.target-frame (identity-expression (evaluate x)) βˆ™
            (ev₁ ◁ comparison)) =β‚‚
          (identity-boundary one (evaluate x) βˆ™
            ((diagram-image β–· insert one) βˆ™ evaluate-uncurry one (funPre d ∘ triangle)))
        target-image = isoComp-cong (idIso (identity-boundary one (evaluate x))) (endpoint one) βˆ™
          isoComp-assoc-at (identity-boundary one (evaluate x))
            (evaluate-curry one (evaluate x ∘ pr₁)) (ev₁ ◁ comparison)

  module Left where
    module Triangle = Degeneracy sβ‚€
    module First = Triangle.ConstantEdge dβ‚‚ zero sβ‚€-dβ‚‚
    module Second = Triangle.IdentityEdge dβ‚€ sβ‚€-dβ‚€
    module Long = Triangle.IdentityEdge d₁ sβ‚€-d₁

  module Right where
    module Triangle = Degeneracy s₁
    module First = Triangle.IdentityEdge dβ‚‚ s₁-dβ‚‚
    module Second = Triangle.ConstantEdge dβ‚€ one s₁-dβ‚€
    module Long = Triangle.IdentityEdge d₁ s₁-d₁
```