Other Agda modules in this section (188)

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

# Restriction with prescribed endpoint frames

The two comparison lemmas combine restriction with postcomposition or
with another restriction. Their endpoint equations are explicit inputs:
these identify the chosen frames, while the arrow comparison is proved
by the restriction calculus.

```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.Chapter02.Section01.WalkingMorphism as Walking

module SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionRestrictionFrames
  {c m a : Level} (š’Æ : Theory c m a) (M : Mapping.MappingAnimae š’Æ)
  (ℱ : Categories.FunctorCategories š’Æ M) (I : Walking.WalkingMorphism š’Æ) where

open import SCT.VolumeI.Chapter02.Section01.Morphisms š’Æ M ℱ I public
open import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionIdentifications š’Æ M ℱ I
open import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionFrameCalculus š’Æ M ℱ I
  using (restrict-retarget-outer; retarget-cong; retarget-assoc; post-retarget)
open import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionRestriction š’Æ M ℱ I
  using (restrict-expression-compose)
open import SCT.VolumeI.Chapter02.Section02.MorphismCalculus.ExpressionRestrictionPostcomposition š’Æ M ℱ I
  using (restrict-post)

abstract
  restrict-post-retarget : {Ī“ Ī” C D : CAT} (F : MAP C D) {f g : MAP Ī“ C}
    (t : MorphismExpression f g) (x : MAP Ī” Ī“) {u v : MAP Ī“ D}
    (p : (F ∘ f) =₁ u) (q : (F ∘ g) =₁ v) {w z : MAP Ī” D}
    (a : (u ∘ x) =₁ w) (b : (v ∘ x) =₁ z)
    (p′ : (F ∘ (f ∘ x)) =₁ w) (q′ : (F ∘ (g ∘ x)) =₁ z) →
    (a āˆ™ (p ā–· x)) =ā‚‚ (p′ āˆ™ comp-assoc x f F) →
    (b āˆ™ (q ā–· x)) =ā‚‚ (q′ āˆ™ comp-assoc x g F) →
    ExpressionIso (retarget-expression (restrict-expression (retarget-expression (post-expression F t) p q) x) a b)
      (retarget-expression (post-expression F (restrict-expression t x)) p′ q′)
  restrict-post-retarget F t x p q a b p′ q′ source target = expressionIso-compose
    (retarget-expressionIso (restrict-post F t x) p′ q′)
    (expressionIso-compose
      (expressionIso-inverse (retarget-assoc (restrict-expression (post-expression F t) x) _ _ p′ q′))
      (expressionIso-compose (retarget-cong _ source target)
        (restrict-retarget-outer (post-expression F t) p q x a b)))

  restrict-restriction-retarget : {Ī“ Ī” Θ C : CAT} {f g : MAP Ī“ C}
    (t : MorphismExpression f g) (r : MAP Ī” Ī“) (x : MAP Θ Ī”) {u v : MAP Ī” C}
    (p : (f ∘ r) =₁ u) (q : (g ∘ r) =₁ v) {w z : MAP Θ C}
    (a : (u ∘ x) =₁ w) (b : (v ∘ x) =₁ z)
    (p′ : (f ∘ (r ∘ x)) =₁ w) (q′ : (g ∘ (r ∘ x)) =₁ z) →
    (a āˆ™ (p ā–· x)) =ā‚‚ (p′ āˆ™ comp-assoc x r f) →
    (b āˆ™ (q ā–· x)) =ā‚‚ (q′ āˆ™ comp-assoc x r g) →
    ExpressionIso (retarget-expression (restrict-expression (retarget-expression (restrict-expression t r) p q) x) a b)
      (retarget-expression (restrict-expression t (r ∘ x)) p′ q′)
  restrict-restriction-retarget t r x p q a b p′ q′ source target = expressionIso-compose
    (retarget-expressionIso (restrict-expression-compose t r x) p′ q′)
    (expressionIso-compose
      (expressionIso-inverse (retarget-assoc (restrict-expression (restrict-expression t r) x) _ _ p′ q′))
      (expressionIso-compose (retarget-cong _ source target)
        (restrict-retarget-outer (restrict-expression t r) p q x a b)))

  restrict-post-frames : {Ī“ Ī” C D : CAT} (F : MAP C D) {x y : MAP Ī“ C}
    (f : MorphismExpression x y) (h : MAP Ī” Ī“) {x′ y′ : MAP Ī” C}
    (p : (x ∘ h) =₁ x′) (q : (y ∘ h) =₁ y′) →
    ExpressionIso (retarget-expression (restrict-expression (post-expression F f) h)
      ((F ◁ p) āˆ™ comp-assoc h x F) ((F ◁ q) āˆ™ comp-assoc h y F))
      (post-expression F (retarget-expression (restrict-expression f h) p q))
  restrict-post-frames F {x} {y} f h p q = expressionIso-compose
    (expressionIso-inverse (post-retarget F (restrict-expression f h) p q))
    (expressionIso-compose (retarget-expressionIso (restrict-post F f h) (F ◁ p) (F ◁ q))
      (expressionIso-inverse (retarget-assoc (restrict-expression (post-expression F f) h)
        (comp-assoc h x F) (comp-assoc h y F) (F ◁ p) (F ◁ q))))
```