Other Agda modules in this section (47)

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

Corresponding book passages
# Gluing two triangles along their common edge

The matching is an explicit argument of `glue`. The returned comparison
is a comparison of whole cocones, including the common edge. This is the
absolute form of `cons:Commutative_Square_From_Commutative_Triangles`.

```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
import SCT.VolumeI.Chapter02.Section01.CommutativeSquareAxiom as Squares
import SCT.VolumeI.Chapter01.Section08.PushoutExtensions as Extensions

module SCT.VolumeI.Chapter02.Section01.SquareGluing
  {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)
  (Q : Squares.CommutativeSquareAxiom š’Æ M ℱ P I E) where

open import SCT.VolumeI.Chapter02.Section01.SquareCalculus.SquareShape š’Æ M ℱ P I E public
open Squares.CommutativeSquareAxiom Q
open import SCT.VolumeI.Chapter01.Section08.Cocones š’Æ public
open import SCT.VolumeI.Chapter01.Section08.CoconeCalculus.CoconePostcomposition š’Æ using (coconePost)
open import SCT.VolumeI.Chapter01.Section08.Squares š’Æ using (squareCocone)

glue : {C : CAT} → Cocone d₁ d₁ C → CommutativeSquare C
glue {C} t = Extensions.Extensions.Lift.value š’Æ M P gluing-square square-isPushout C t

glue-β : {C : CAT} (t : Cocone d₁ d₁ C) → CoconeIso
  (coconePost (glue t) (squareCocone gluing-square)) t
glue-β {C} = Extensions.Extensions.Lift.comparison š’Æ M P gluing-square square-isPushout C

glue-left : {C : CAT} (t : Cocone d₁ d₁ C) → (glue t ∘ jā‚€) =₁ (Cocone.left t)
glue-left t = CoconeIso.leftIso (glue-β t)

glue-right : {C : CAT} (t : Cocone d₁ d₁ C) → (glue t ∘ j₁) =₁ (Cocone.right t)
glue-right t = CoconeIso.rightIso (glue-β t)

square : {C : CAT} (σ Ļ„ : MAP [2] C) → (σ ∘ d₁) =₁ (Ļ„ ∘ d₁) → CommutativeSquare C
square σ Ļ„ φ = glue (record { left = σ ; right = Ļ„ ; match = φ })

glue-compare : {C : CAT} (F G : CommutativeSquare C) →
  CoconeIso (coconePost F (squareCocone gluing-square))
    (coconePost G (squareCocone gluing-square)) → F =₁ G
glue-compare {C} = Extensions.Extensions.Compare.comparison š’Æ M P gluing-square square-isPushout C

glue-bottom : {C : CAT} (t : Cocone d₁ d₁ C) →
  (glue t ∘ insert zero) =₁ (Cocone.right t ∘ dā‚‚)
glue-bottom t = (glue-right t ā–· dā‚‚) āˆ™
  ((comp-assoc dā‚‚ j₁ (glue t)) ⁻¹ āˆ™ (glue t ◁ bottom-boundary ⁻¹))

glue-top : {C : CAT} (t : Cocone d₁ d₁ C) →
  (glue t ∘ insert one) =₁ (Cocone.left t ∘ dā‚€)
glue-top t = (glue-left t ā–· dā‚€) āˆ™
  ((comp-assoc dā‚€ jā‚€ (glue t)) ⁻¹ āˆ™ (glue t ◁ top-boundary ⁻¹))
```