Other Agda modules in this section (72)

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

# Restriction commutes with inserting a point

Insert the point in the first coordinate and restrict the second
coordinate. Product separation and the terminal-product comparison
identify the two orders. The second-projection calculation is retained
so the comparison can be used in triangles over a base.

```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 Pullbacks
import SCT.VolumeI.Chapter01.Section04.SquareCalculus.ProjectionSquares as Projections
import SCT.VolumeI.Chapter01.Section08.MappingCalculus.Decoding.UnitRestrictionData as Unit
import SCT.VolumeI.Chapter03.Section05.Currying.PointParameterProjection as Points

module SCT.VolumeI.Chapter03.Section05.Currying.PointRestrictionSquare
  {c m a : Level} (𝒯 : Theory c m a) (M : Mapping.MappingAnimae 𝒯)
  (β„± : Categories.FunctorCategories 𝒯 M) (P : Pullbacks.PullbackStructure 𝒯) where

open import SCT.VolumeI.Chapter01.Section05.Setup 𝒯 M
open import SCT.VolumeI.Chapter01.Section08.ProductSquares 𝒯
open import SCT.VolumeI.Chapter01.Section08.ProductCalculus.ProductSecondCoordinate 𝒯 M
  using (parameter-base; restriction-base; separation)
open import SCT.VolumeI.Chapter01.Section04.Substitution.DecodingNaturality 𝒯 M using (oneProduct-natural)
module PS = Projections 𝒯

module Square {X A B : CAT} (z : Obj-abs X) (r : MAP A B) where
  module Source = Points.Point 𝒯 M β„± P {A = A} z
  module Target = Points.Point 𝒯 M β„± P {A = B} z
  module Terminal = Unit.Coordinates 𝒯 M r
  R : MAP (X Γ— A) (X Γ— B)
  R = productRestriction X r
  Rβ‚€ : MAP (One Γ— A) (One Γ— B)
  Rβ‚€ = productRestriction One r
  br : (prβ‚‚ ∘ R) =₁ (r ∘ prβ‚‚)
  br = restriction-base X r
  brβ‚€ : (prβ‚‚ ∘ Rβ‚€) =₁ (r ∘ prβ‚‚)
  brβ‚€ = restriction-base One r
  bA : (prβ‚‚ ∘ Source.H) =₁ prβ‚‚
  bA = parameter-base z A
  bB : (prβ‚‚ ∘ Target.H) =₁ prβ‚‚
  bB = parameter-base z B
  bAr : ((r ∘ prβ‚‚) ∘ Source.H) =₁ (r ∘ prβ‚‚)
  bAr = PS.lift-base r prβ‚‚ Source.H bA
  eβ‚€ : ((r ∘ prβ‚‚) ∘ Source.i) =₁ r
  eβ‚€ = Terminal.endpoint

  wβ‚€ : (prβ‚‚ ∘ (R ∘ Source.K)) =₁ r
  wβ‚€ = PS.compose-base prβ‚‚ R br Source.K (Source.triangle r)
  b₁ : (prβ‚‚ ∘ (R ∘ Source.H)) =₁ (r ∘ prβ‚‚)
  b₁ = PS.compose-base prβ‚‚ R br Source.H bAr
  w₁ : (prβ‚‚ ∘ ((R ∘ Source.H) ∘ Source.i)) =₁ r
  w₁ = PS.compose-base prβ‚‚ (R ∘ Source.H) b₁ Source.i eβ‚€
  bβ‚‚ : (prβ‚‚ ∘ (Target.H ∘ Rβ‚€)) =₁ (r ∘ prβ‚‚)
  bβ‚‚ = PS.compose-base prβ‚‚ Target.H bB Rβ‚€ brβ‚€
  wβ‚‚ : (prβ‚‚ ∘ ((Target.H ∘ Rβ‚€) ∘ Source.i)) =₁ r
  wβ‚‚ = PS.compose-base prβ‚‚ (Target.H ∘ Rβ‚€) bβ‚‚ Source.i eβ‚€
  w₃ : (prβ‚‚ ∘ (Target.H ∘ (Rβ‚€ ∘ Source.i))) =₁ r
  w₃ = PS.compose-base prβ‚‚ Target.H bB (Rβ‚€ ∘ Source.i) Terminal.source
  wβ‚„ : (prβ‚‚ ∘ (Target.H ∘ (Target.i ∘ r))) =₁ r
  wβ‚„ = PS.compose-base prβ‚‚ Target.H bB (Target.i ∘ r) Terminal.target
  wβ‚… : (prβ‚‚ ∘ (Target.K ∘ r)) =₁ r
  wβ‚… = PS.compose-base prβ‚‚ Target.K Target.projection r (comp-unitΛ‘ r)

  η₁ : (R ∘ Source.K) =₁ ((R ∘ Source.H) ∘ Source.i)
  η₁ = (comp-assoc Source.i Source.H R) ⁻¹
  Ξ·β‚‚ : ((R ∘ Source.H) ∘ Source.i) =₁ ((Target.H ∘ Rβ‚€) ∘ Source.i)
  Ξ·β‚‚ = productMap-separate z r β–· Source.i
  η₃ : ((Target.H ∘ Rβ‚€) ∘ Source.i) =₁ (Target.H ∘ (Rβ‚€ ∘ Source.i))
  η₃ = comp-assoc Source.i Rβ‚€ Target.H
  Ξ·β‚„ : (Target.H ∘ (Rβ‚€ ∘ Source.i)) =₁ (Target.H ∘ (Target.i ∘ r))
  Ξ·β‚„ = Target.H ◁ oneProduct-natural r
  Ξ·β‚… : (Target.H ∘ (Target.i ∘ r)) =₁ (Target.K ∘ r)
  Ξ·β‚… = (comp-assoc r Target.i Target.H) ⁻¹
  comparison : (R ∘ Source.K) =₁ (Target.K ∘ r)
  comparison = Ξ·β‚… βˆ™ (Ξ·β‚„ βˆ™ (η₃ βˆ™ (Ξ·β‚‚ βˆ™ η₁)))

  abstract
    first : PS.Square prβ‚‚ wβ‚€ w₁ η₁
    first = PS.inverse-square prβ‚‚ w₁ wβ‚€ (comp-assoc Source.i Source.H R)
      (PS.associator-square prβ‚‚ R Source.H Source.i br bAr eβ‚€)
    second : PS.Square prβ‚‚ w₁ wβ‚‚ Ξ·β‚‚
    second = PS.pre-square prβ‚‚ Source.i b₁ bβ‚‚ eβ‚€ (productMap-separate z r) (separation z r)
    third : PS.Square prβ‚‚ wβ‚‚ w₃ η₃
    third = PS.associator-square prβ‚‚ Target.H Rβ‚€ Source.i bB brβ‚€ eβ‚€
    fourth : PS.Square prβ‚‚ w₃ wβ‚„ Ξ·β‚„
    fourth = PS.post-square prβ‚‚ Target.H bB Terminal.source Terminal.target
      (oneProduct-natural r) Terminal.projectionβ‚‚
    fifth : PS.Square prβ‚‚ wβ‚„ wβ‚… Ξ·β‚…
    fifth = PS.inverse-square prβ‚‚ wβ‚… wβ‚„ (comp-assoc r Target.i Target.H)
      (PS.associator-square prβ‚‚ Target.H Target.i r bB (oneProduct-retraction B) (comp-unitΛ‘ r))

    projection : PS.Square prβ‚‚ wβ‚€ wβ‚… comparison
    projection = PS.compose-square prβ‚‚ wβ‚€ wβ‚„ wβ‚… Ξ·β‚… (Ξ·β‚„ βˆ™ (η₃ βˆ™ (Ξ·β‚‚ βˆ™ η₁))) fifth
      (PS.compose-square prβ‚‚ wβ‚€ w₃ wβ‚„ Ξ·β‚„ (η₃ βˆ™ (Ξ·β‚‚ βˆ™ η₁)) fourth
        (PS.compose-square prβ‚‚ wβ‚€ wβ‚‚ w₃ η₃ (Ξ·β‚‚ βˆ™ η₁) third
          (PS.compose-square prβ‚‚ wβ‚€ w₁ wβ‚‚ Ξ·β‚‚ η₁ second first)))
```