Other Agda modules in this section (188)

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

# Postcomposition and evaluation of a family

This compares the uncurried formula for postcomposition with the
specified evaluation comparison. It retains the parameter associator.

```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

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

open import SCT.VolumeI.Chapter02.Section01.EvaluationCalculus.EndpointEvaluation š’Æ M ℱ public
open import SCT.VolumeI.Chapter02.Section02.EvaluationCalculus.Restriction.InsertionEvaluation š’Æ M ℱ
  using (evaluate-insertion; evaluate-uncurry-compose)
open import SCT.VolumeI.Chapter01.Section04.SquareCalculus.SquareEvaluation š’Æ M using (change-evaluation)
import SCT.VolumeI.Chapter01.Section04.SquareCalculus.SquareEvaluationPostcomposition as Post

module At {Ī“ A C D : CAT} (F : MAP C D) (h : MAP Ī“ (Fun A C)) (z : Obj-abs A) where
  Y = Fun A C
  k = funPost {C = A} F
  e = funEval {C = A} {D = C}
  R = productMap h (id A)
  i = insert {X = Ī“} z
  j = insert {X = Y} z
  β = funPost-β {C = A} F
  u = funUncurry-restrict k h
  φ = funPost-uncurry F h
  Q = evaluate-uncurry z (k ∘ h)
  Qk = evaluate-uncurry z k
  tail = (comp-assoc h k (evaluate z)) ⁻¹
  b = (β ā–· R) ā–· i
  v = comp-assoc i (e ∘ R) F
  w = comp-assoc R e F ā–· i
  original = evaluate-insertion (funUncurry k) h z
  changed = evaluate-insertion (F ∘ e) h z
  module Square = Post.At š’Æ M e F h R i j (insert-natural h z)
  rest = (Qk ā–· h) āˆ™ tail

  abstract
    beta-square : (b āˆ™ original) =ā‚‚ (changed āˆ™ ((β ā–· j) ā–· h))
    beta-square = (change-evaluation β h R i j (insert-natural h z)) ⁻¹

    raw-image : ((φ ā–· i) āˆ™ Q) =ā‚‚
      (w āˆ™ ((b āˆ™ original) āˆ™ rest))
    raw-image = isoComp-cong (idIso w)
        ((isoComp-assoc-at b original rest) ⁻¹ āˆ™
          isoComp-cong (idIso b)
            (isoComp-assoc-at original (Qk ā–· h) tail āˆ™ evaluate-uncurry-compose z k h) āˆ™
          isoComp-assoc-at b (u ā–· i) Q āˆ™
          isoComp-cong (preWhisker-isoComp-at (β ā–· R) u i) (idIso Q)) āˆ™
      isoComp-assoc-at w (((β ā–· R) āˆ™ u) ā–· i) Q āˆ™
      isoComp-cong (preWhisker-isoComp-at (comp-assoc R e F) ((β ā–· R) āˆ™ u) i) (idIso Q)

    regroup : (v āˆ™ (w āˆ™ ((changed āˆ™ ((β ā–· j) ā–· h)) āˆ™ rest))) =ā‚‚
      (((v āˆ™ w) āˆ™ changed) āˆ™ ((((β ā–· j) ā–· h) āˆ™ (Qk ā–· h)) āˆ™ tail))
    regroup = isoComp-cong (idIso ((v āˆ™ w) āˆ™ changed))
        ((isoComp-assoc-at ((β ā–· j) ā–· h) (Qk ā–· h) tail) ⁻¹) āˆ™
      (isoComp-assoc-at (v āˆ™ w) changed (((β ā–· j) ā–· h) āˆ™ rest)) ⁻¹ āˆ™
      isoComp-cong (idIso (v āˆ™ w)) (isoComp-assoc-at changed ((β ā–· j) ā–· h) rest) āˆ™
      (isoComp-assoc-at v w ((changed āˆ™ ((β ā–· j) ā–· h)) āˆ™ rest)) ⁻¹

    endpoint-image : (evaluate-post z F ā–· h) =ā‚‚
      (Square.J₁ āˆ™ (((β ā–· j) ā–· h) āˆ™ (Qk ā–· h)))
    endpoint-image = isoComp-cong (idIso Square.J₁)
        (preWhisker-isoComp-at (β ā–· j) Qk h) āˆ™
      preWhisker-isoComp-at (comp-assoc j e F) ((β ā–· j) āˆ™ Qk) h

    comparison :
      (comp-assoc i (funUncurry h) F āˆ™ ((funPost-uncurry F h ā–· i) āˆ™ evaluate-uncurry z (funPost F ∘ h))) =ā‚‚
      ((F ◁ evaluate-uncurry z h) āˆ™ evaluate-post-at z F h)
    comparison = isoComp-cong (idIso (F ◁ evaluate-uncurry z h))
        (isoComp-cong (idIso Square.Jā‚€)
          (isoComp-cong (endpoint-image ⁻¹) (idIso tail) āˆ™
            (isoComp-assoc-at Square.J₁ (((β ā–· j) ā–· h) āˆ™ (Qk ā–· h)) tail) ⁻¹) āˆ™
          isoComp-assoc-at Square.Jā‚€ Square.J₁ ((((β ā–· j) ā–· h) āˆ™ (Qk ā–· h)) āˆ™ tail)) āˆ™
      isoComp-assoc-at (F ◁ evaluate-uncurry z h) Square.J ((((β ā–· j) ā–· h) āˆ™ (Qk ā–· h)) āˆ™ tail) āˆ™
      isoComp-cong (Square.comparison ⁻¹) (idIso ((((β ā–· j) ā–· h) āˆ™ (Qk ā–· h)) āˆ™ tail)) āˆ™
      regroup āˆ™
      isoComp-cong (idIso v) (isoComp-cong (idIso w) (isoComp-cong beta-square (idIso rest))) āˆ™
      isoComp-cong (idIso v) raw-image
```