Skip to content

Commit 7d87911

Browse files
author
Frederik Gebert
committed
Move intermediate equations to definitions that use them.
Increases clarity because: - the intermediate equations are only relevant in the context of the definition that uses them. - the type declaration of intermediate equations is much shorter.
1 parent 7532da2 commit 7d87911

File tree

1 file changed

+69
-76
lines changed

1 file changed

+69
-76
lines changed

src/Categories/Diagram/Pullback/Properties.agda

Lines changed: 69 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -204,88 +204,81 @@ module PullbackPastingLaw {A B C D E F : Obj}
204204
(ABDE : i ∘ f ≈ k ∘ h) (BCEF : j ∘ g ≈ l ∘ i) (pbᵣ : IsPullback g i j l) where
205205

206206
open IsPullback using (p₁∘universal≈h₁; p₂∘universal≈h₂; universal; unique-diagram)
207-
208-
ACDF : j ∘ (g ∘ f) ≈ (l ∘ k) ∘ h
209-
ACDF = begin
210-
j ∘ g ∘ f ≈⟨ pullˡ BCEF ⟩
211-
(l ∘ i) ∘ f ≈⟨ assoc ⟩
212-
l ∘ (i ∘ f) ≈⟨ pushʳ ABDE ⟩
213-
(l ∘ k) ∘ h ∎
214207

215208
leftPullback⇒bigPullback : IsPullback f h i k IsPullback (g ∘ f) h j (l ∘ k)
216209
leftPullback⇒bigPullback pbₗ = record
217-
{ commute = ACDF
218-
; universal = universalb
219-
; p₁∘universal≈h₁ = [g∘f]∘universalb≈h₁
220-
; p₂∘universal≈h₂ = p₂∘universal≈h₂ pbₗ
221-
; unique-diagram = unique-diagramb
222-
} where
223-
j∘h₁≈l∘k∘h₂ : {H : Obj} {h₁ : H ⇒ C} {h₂ : H ⇒ D} j ∘ h₁ ≈ (l ∘ k) ∘ h₂ j ∘ h₁ ≈ l ∘ (k ∘ h₂)
224-
j∘h₁≈l∘k∘h₂ eq = begin
225-
j ∘ _ ≈⟨ eq ⟩
226-
(l ∘ k) ∘ _ ≈⟨ assoc ⟩
227-
l ∘ (k ∘ _) ∎
228-
229-
universalb : {H : Obj} {h₁ : H ⇒ C} {h₂ : H ⇒ D} j ∘ h₁ ≈ (l ∘ k) ∘ h₂ H ⇒ A
230-
universalb eq = universal pbₗ (p₂∘universal≈h₂ pbᵣ {_} {_} {_} {j∘h₁≈l∘k∘h₂ eq})
210+
{ commute = ACDF
211+
; universal = universalb
212+
; p₁∘universal≈h₁ = [g∘f]∘universalb≈h₁
213+
; p₂∘universal≈h₂ = p₂∘universal≈h₂ pbₗ
214+
; unique-diagram = unique-diagramb
215+
} where
216+
ACDF : j ∘ (g ∘ f) ≈ (l ∘ k) ∘ h
217+
ACDF = begin
218+
j ∘ g ∘ f ≈⟨ extendʳ BCEF ⟩
219+
l ∘ i ∘ f ≈⟨ pushʳ ABDE ⟩
220+
(l ∘ k) ∘ h ∎
221+
222+
-- first apply universal property of (BCEF) to get a morphism H -> B,
223+
-- then apply universal property of (ABDE) to get a morphism H -> A.
224+
universalb : {H : Obj} {h₁ : H ⇒ C} {h₂ : H ⇒ D} j ∘ h₁ ≈ (l ∘ k) ∘ h₂ H ⇒ A
225+
universalb {_} {h₁} {h₂} eq = universal pbₗ (p₂∘universal≈h₂ pbᵣ {eq = j∘h₁≈l∘k∘h₂}) where
226+
j∘h₁≈l∘k∘h₂ : j ∘ h₁ ≈ l ∘ k ∘ h₂
227+
j∘h₁≈l∘k∘h₂ = begin
228+
j ∘ h₁ ≈⟨ eq ⟩
229+
(l ∘ k) ∘ h₂ ≈⟨ assoc ⟩
230+
l ∘ k ∘ h₂ ∎
231231

232-
[g∘f]∘universalb≈h₁ : {H : Obj} {h₁ : H ⇒ C} {h₂ : H ⇒ D} {eq : j ∘ h₁ ≈ (l ∘ k) ∘ h₂} (g ∘ f) ∘ universalb eq ≈ h₁
233-
[g∘f]∘universalb≈h₁ = begin
234-
(g ∘ f) ∘ universalb _ ≈⟨ pullʳ (p₁∘universal≈h₁ pbₗ) ⟩
235-
g ∘ universal pbᵣ _ ≈⟨ p₁∘universal≈h₁ pbᵣ ⟩
236-
_ ∎
237-
238-
g∘f∘s≈g∘f∘t : {H : Obj} {s t : H ⇒ A} (g ∘ f) ∘ s ≈ (g ∘ f) ∘ t g ∘ (f ∘ s) ≈ g ∘ (f ∘ t)
239-
g∘f∘s≈g∘f∘t eq = begin
240-
g ∘ f ∘ _ ≈⟨ sym-assoc ⟩
241-
(g ∘ f) ∘ _ ≈⟨ eq ⟩
242-
(g ∘ f) ∘ _ ≈⟨ assoc ⟩
243-
g ∘ f ∘ _ ∎
244-
245-
i∘f∘s≈i∘f∘t : {H : Obj} {s t : H ⇒ A} h ∘ s ≈ h ∘ t i ∘ f ∘ s ≈ i ∘ f ∘ t
246-
i∘f∘s≈i∘f∘t eq = begin
247-
i ∘ f ∘ _ ≈⟨ pullˡ ABDE ⟩
248-
(k ∘ h) ∘ _ ≈⟨ pullʳ eq ⟩
249-
k ∘ (h ∘ _) ≈⟨ pullˡ (sym ABDE) ⟩
250-
(i ∘ f) ∘ _ ≈⟨ assoc ⟩
251-
i ∘ (f ∘ _) ∎
232+
[g∘f]∘universalb≈h₁ : {H : Obj} {h₁ : H ⇒ C} {h₂ : H ⇒ D} {eq : j ∘ h₁ ≈ (l ∘ k) ∘ h₂} (g ∘ f) ∘ universalb eq ≈ h₁
233+
[g∘f]∘universalb≈h₁ {h₁ = h₁} = begin
234+
(g ∘ f) ∘ universalb _ ≈⟨ pullʳ (p₁∘universal≈h₁ pbₗ) ⟩
235+
g ∘ universal pbᵣ _ ≈⟨ p₁∘universal≈h₁ pbᵣ ⟩
236+
h₁ ∎
252237

253-
unique-diagramb : {H : Obj} {s t : H ⇒ A} (g ∘ f) ∘ s ≈ (g ∘ f) ∘ t h ∘ s ≈ h ∘ t s ≈ t
254-
unique-diagramb eq eq' = unique-diagram pbₗ (unique-diagram pbᵣ (g∘f∘s≈g∘f∘t eq) (i∘f∘s≈i∘f∘t eq')) eq'
238+
unique-diagramb : {H : Obj} {s t : H ⇒ A} (g ∘ f) ∘ s ≈ (g ∘ f) ∘ t h ∘ s ≈ h ∘ t s ≈ t
239+
unique-diagramb {_} {s} {t} eq eq' = unique-diagram pbₗ (unique-diagram pbᵣ g∘f∘s≈g∘f∘t i∘f∘s≈i∘f∘t) eq' where
240+
g∘f∘s≈g∘f∘t : g ∘ f ∘ s ≈ g ∘ f ∘ t
241+
g∘f∘s≈g∘f∘t = begin
242+
g ∘ f ∘ s ≈⟨ sym-assoc ⟩
243+
(g ∘ f) ∘ s ≈⟨ eq ⟩
244+
(g ∘ f) ∘ t ≈⟨ assoc ⟩
245+
g ∘ f ∘ t ∎
246+
i∘f∘s≈i∘f∘t : i ∘ f ∘ s ≈ i ∘ f ∘ t
247+
i∘f∘s≈i∘f∘t = begin
248+
i ∘ f ∘ s ≈⟨ pullˡ ABDE ⟩
249+
(k ∘ h) ∘ s ≈⟨ pullʳ eq' ⟩
250+
k ∘ h ∘ t ≈⟨ extendʳ (sym ABDE) ⟩
251+
i ∘ f ∘ t ∎
255252

256253
bigPullback⇒leftPullback : IsPullback (g ∘ f) h j (l ∘ k) IsPullback f h i k
257254
bigPullback⇒leftPullback pbb = record
258-
{ commute = ABDE
259-
; universal = universalₗ
260-
; p₁∘universal≈h₁ = unique-diagram pbᵣ (g∘f∘universalₗ≈g∘h₁ _) (i∘f∘universalₗ≈i∘h₁ _)
261-
; p₂∘universal≈h₂ = p₂∘universal≈h₂ pbb
262-
; unique-diagram = unique-diagramb
263-
} where
264-
j∘[g∘h₁]≈[l∘k]∘h₂ : {H : Obj} {h₁ : H ⇒ B} {h₂ : H ⇒ D} i ∘ h₁ ≈ k ∘ h₂ j ∘ (g ∘ h₁) ≈ (l ∘ k) ∘ h₂
265-
j∘[g∘h₁]≈[l∘k]∘h₂ eq = begin
266-
j ∘ (g ∘ _) ≈⟨ pullˡ BCEF ⟩
267-
(l ∘ i) ∘ _ ≈⟨ pullʳ eq ⟩
268-
l ∘ (k ∘ _) ≈⟨ sym-assoc ⟩
269-
(l ∘ k) ∘ _ ∎
270-
271-
universalₗ : {H : Obj} {h₁ : H ⇒ B} {h₂ : H ⇒ D} i ∘ h₁ ≈ k ∘ h₂ H ⇒ A
272-
universalₗ eq = universal pbb (j∘[g∘h₁]≈[l∘k]∘h₂ eq)
273-
274-
g∘f∘universalₗ≈g∘h₁ : {H : Obj} {h₁ : H ⇒ B} {h₂ : H ⇒ D} (eq : i ∘ h₁ ≈ k ∘ h₂) g ∘ f ∘ universalₗ eq ≈ g ∘ h₁
275-
g∘f∘universalₗ≈g∘h₁ eq = begin
276-
g ∘ f ∘ universalₗ eq ≈⟨ sym-assoc ⟩
277-
(g ∘ f) ∘ universalₗ eq ≈⟨ p₁∘universal≈h₁ pbb ⟩
278-
g ∘ _ ∎
279-
280-
i∘f∘universalₗ≈i∘h₁ : {H : Obj} {h₁ : H ⇒ B} {h₂ : H ⇒ D} (eq : i ∘ h₁ ≈ k ∘ h₂) i ∘ f ∘ universalₗ eq ≈ i ∘ h₁
281-
i∘f∘universalₗ≈i∘h₁ eq = begin
282-
i ∘ f ∘ universalₗ eq ≈⟨ pullˡ ABDE ⟩
283-
(k ∘ h) ∘ universalₗ eq ≈⟨ pullʳ (p₂∘universal≈h₂ pbb) ⟩
284-
k ∘ _ ≈⟨ sym eq ⟩
285-
i ∘ _ ∎
255+
{ commute = ABDE
256+
; universal = universalₗ
257+
; p₁∘universal≈h₁ = f∘universalₗ≈h₁
258+
; p₂∘universal≈h₂ = p₂∘universal≈h₂ pbb
259+
; unique-diagram = unique-diagramb
260+
} where
261+
universalₗ : {H : Obj} {h₁ : H ⇒ B} {h₂ : H ⇒ D} i ∘ h₁ ≈ k ∘ h₂ H ⇒ A
262+
universalₗ {_} {h₁} {h₂} eq = universal pbb j∘g∘h₁≈[l∘k]∘h₂ where
263+
j∘g∘h₁≈[l∘k]∘h₂ : j ∘ g ∘ h₁ ≈ (l ∘ k) ∘ h₂
264+
j∘g∘h₁≈[l∘k]∘h₂ = begin
265+
j ∘ g ∘ h₁ ≈⟨ pullˡ BCEF ⟩
266+
(l ∘ i) ∘ h₁ ≈⟨ extendˡ eq ⟩
267+
(l ∘ k) ∘ h₂ ∎
268+
269+
f∘universalₗ≈h₁ : {H : Obj} {h₁ : H ⇒ B} {h₂ : H ⇒ D} {eq : i ∘ h₁ ≈ k ∘ h₂} f ∘ universalₗ eq ≈ h₁
270+
f∘universalₗ≈h₁ {_} {h₁} {h₂} {eq} = unique-diagram pbᵣ g∘f∘universalₗ≈g∘h₁ i∘f∘universalₗ≈i∘h₁ where
271+
g∘f∘universalₗ≈g∘h₁ : g ∘ f ∘ universalₗ _ ≈ g ∘ h₁
272+
g∘f∘universalₗ≈g∘h₁ = begin
273+
g ∘ f ∘ universalₗ _ ≈⟨ sym-assoc ⟩
274+
(g ∘ f) ∘ universalₗ _ ≈⟨ p₁∘universal≈h₁ pbb ⟩
275+
g ∘ h₁ ∎
276+
i∘f∘universalₗ≈i∘h₁ : i ∘ f ∘ universalₗ _ ≈ i ∘ h₁
277+
i∘f∘universalₗ≈i∘h₁ = begin
278+
i ∘ f ∘ universalₗ _ ≈⟨ pullˡ ABDE ⟩
279+
(k ∘ h) ∘ universalₗ _ ≈⟨ pullʳ (p₂∘universal≈h₂ pbb) ⟩
280+
k ∘ h₂ ≈⟨ sym eq ⟩
281+
i ∘ h₁ ∎
286282

287-
unique-diagramb : {H : Obj} {s t : H ⇒ A} f ∘ s ≈ f ∘ t h ∘ s ≈ h ∘ t s ≈ t
288-
unique-diagramb eq eq' = unique-diagram pbb (begin
289-
(g ∘ f) ∘ _ ≈⟨ pullʳ eq ⟩
290-
g ∘ f ∘ _ ≈⟨ sym-assoc ⟩
291-
(g ∘ f) ∘ _ ∎) eq'
283+
unique-diagramb : {H : Obj} {s t : H ⇒ A} f ∘ s ≈ f ∘ t h ∘ s ≈ h ∘ t s ≈ t
284+
unique-diagramb eq eq' = unique-diagram pbb (extendˡ eq) eq'

0 commit comments

Comments
 (0)