From a8ad651f49db105e8119675cc77e369b94061154 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Thu, 16 Jan 2025 11:28:57 -0500 Subject: [PATCH 01/18] Pushout draft --- source/UF/Pushouts.lagda | 133 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 source/UF/Pushouts.lagda diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda new file mode 100644 index 000000000..a3066e882 --- /dev/null +++ b/source/UF/Pushouts.lagda @@ -0,0 +1,133 @@ +Ian Ray, 15th January 2025 + +Pushouts defined as higher inductive type (in the form of records). +We postulate point and path constructors, an induction principle and +computation rules for each constructor. + +\begin{code} + +{-# OPTIONS --safe --without-K #-} + +open import UF.FunExt + +module UF.Pushouts (fe : Fun-Ext) where + +open import MLTT.Spartan +open import UF.Base +open import UF.Equiv +open import UF.EquivalenceExamples + +cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) + (X : ๐“ฃ ฬ‡) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +cocone {๐“ค} {๐“ฅ} {๐“ฆ} {๐“ฃ} {A} {B} {C} f g X = + ฮฃ k ๊ž‰ (A โ†’ X) , ฮฃ l ๊ž‰ (B โ†’ X) , (k โˆ˜ f โˆผ l โˆ˜ g) + +record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ + where + field + pushout : ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ ฬ‡ + inll : A โ†’ pushout + inrr : B โ†’ pushout + glue : (c : C) โ†’ inll (f c) ๏ผ inrr (g c) + pushout-induction : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ P x + pushout-ind-comp-l + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pushout-induction l r G (inll a) ๏ผ l a + pushout-ind-comp-r + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pushout-induction l r G (inrr b) ๏ผ r b + pushout-ind-comp-G + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ apd (pushout-induction l r G) (glue c) โˆ™ pushout-ind-comp-r l r G (g c) + ๏ผ ap (transport P (glue c)) (pushout-ind-comp-l l r G (f c)) โˆ™ G c + + pushout-recursion : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ ((c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ pushout โ†’ D + pushout-recursion l r G = + pushout-induction l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) + + pushout-rec-comp-l : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pushout-recursion l r G (inll a) ๏ผ l a + pushout-rec-comp-l l r G = + pushout-ind-comp-l l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) + + pushout-rec-comp-r : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pushout-recursion l r G (inrr b) ๏ผ r b + pushout-rec-comp-r l r G = + pushout-ind-comp-r l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) + + pushout-rec-comp-G + : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) + ๏ผ pushout-rec-comp-l l r G (f c) โˆ™ G c + pushout-rec-comp-G {๐“ฃ} {D} l r G c = {!!} + + pushout-cocone : cocone f g pushout + pushout-cocone = (inll , inrr , glue) + + pushout-universal-property : (X : ๐“ฃ ฬ‡) + โ†’ (pushout โ†’ X) โ‰ƒ cocone f g X + pushout-universal-property X = qinveq ฯ• (ฯˆ , ฯˆ-ฯ• , ฯ•-ฯˆ) + where + ฯ• : (pushout โ†’ X) โ†’ cocone f g X + ฯ• u = (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) + ฯˆ : cocone f g X โ†’ (pushout โ†’ X) + ฯˆ (l , r , G) = pushout-recursion l r G + ฯˆ-ฯ• : ฯˆ โˆ˜ ฯ• โˆผ id + ฯˆ-ฯ• u = + dfunext fe (pushout-induction + (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + {!!}) + ฯ•-ฯˆ : ฯ• โˆ˜ ฯˆ โˆผ id + ฯ•-ฯˆ (l , r , G) = + ap โŒœ ฮฃ-assoc โŒ (to-ฮฃ-๏ผ (to-ร—-๏ผ I II , dfunext fe {!!})) + where + I = dfunext fe (pushout-rec-comp-l l r G) + II = dfunext fe (pushout-rec-comp-r l r G) + III : (c : C) โ†’ transport {!!} (to-ร—-๏ผ I II) + (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue c) + ๏ผ G c + III = {!!} + where + + + +\end{code} + +I : apd (pushout-induction l r ?) (glue c) + ๏ผ ap (pushout-recursion l r G) (glue c) + I = ? From 18382e336ca7edd7e54bcff74cebf83195fdabaf Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Mon, 20 Jan 2025 01:12:40 -0500 Subject: [PATCH 02/18] Update --- source/UF/Base.lagda | 58 +++++++++++++++++++++++++++++ source/UF/Pushouts.lagda | 79 ++++++++++++++++++++++++++++++++++------ 2 files changed, 126 insertions(+), 11 deletions(-) diff --git a/source/UF/Base.lagda b/source/UF/Base.lagda index a34640844..98098a156 100644 --- a/source/UF/Base.lagda +++ b/source/UF/Base.lagda @@ -502,3 +502,61 @@ ap-refl : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } (f : X โ†’ Y) {x : X} โ†’ ap f (๐“ป๐“ฎ๐’ป๐“ต x) ๏ผ ๐“ป๐“ฎ๐’ป๐“ต (f x) ap-refl f = refl \end{code} + +Added by Ian Ray 18th Jan 2025 + +\begin{code} + +apd-to-ap : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } (f : X โ†’ Y) {x x' : X} (p : x ๏ผ x') + โ†’ apd f p ๏ผ transport-const p โˆ™ ap f p +apd-to-ap f refl = refl + +apd-from-ap : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } (f : X โ†’ Y) {x x' : X} (p : x ๏ผ x') + โ†’ ap f p ๏ผ transport-const p โปยน โˆ™ apd f p +apd-from-ap f refl = refl + +\end{code} + +We will also add some helpful path lemmas paths. Note that pattern matching +is not helpful here since association l โˆ™ q โˆ™ s is by definition (l โˆ™ q) โˆ™ s. + +\begin{code} + +ap-on-left-is-assoc : {X : ๐“ค ฬ‡ } {x y z z' : X} (l : x ๏ผ y) + {p q : y ๏ผ z} {r s : z ๏ผ z'} + โ†’ p โˆ™ r ๏ผ q โˆ™ s + โ†’ (l โˆ™ p) โˆ™ r ๏ผ (l โˆ™ q) โˆ™ s +ap-on-left-is-assoc l {p} {q} {r} {s} ฮฑ = l โˆ™ p โˆ™ r ๏ผโŸจ โˆ™assoc l p r โŸฉ + l โˆ™ (p โˆ™ r) ๏ผโŸจ ap (l โˆ™_) ฮฑ โŸฉ + l โˆ™ (q โˆ™ s) ๏ผโŸจ โˆ™assoc l q s โปยน โŸฉ + l โˆ™ q โˆ™ s โˆŽ + +ap-on-left-is-assoc' : {X : ๐“ค ฬ‡ } {x y z z' : X} (l : x ๏ผ y) + (p : y ๏ผ z') (q : y ๏ผ z) (s : z ๏ผ z') + โ†’ p ๏ผ q โˆ™ s + โ†’ l โˆ™ p ๏ผ (l โˆ™ q) โˆ™ s +ap-on-left-is-assoc' l p q s ฮฑ = l โˆ™ p ๏ผโŸจ ap (l โˆ™_) ฮฑ โŸฉ + l โˆ™ (q โˆ™ s) ๏ผโŸจ โˆ™assoc l q s โปยน โŸฉ + l โˆ™ q โˆ™ s โˆŽ + +ap-left-inverse : {X : ๐“ค ฬ‡ } {x y z : X} (l : x ๏ผ y) + {p : x ๏ผ z} {q : y ๏ผ z} + โ†’ p ๏ผ l โˆ™ q + โ†’ l โปยน โˆ™ p ๏ผ q +ap-left-inverse l {p} {q} ฮฑ = + l โปยน โˆ™ p ๏ผโŸจ ap-on-left-is-assoc' (l โปยน) p l q ฮฑ โŸฉ + l โปยน โˆ™ l โˆ™ q ๏ผโŸจ ap (_โˆ™ q) (left-inverse l) โŸฉ + refl โˆ™ q ๏ผโŸจ refl-left-neutral โŸฉ + q โˆŽ + +ap-right-inverse : {X : ๐“ค ฬ‡ } {x y z : X} (r : y ๏ผ z) + {p : x ๏ผ z} {q : x ๏ผ y} + โ†’ p ๏ผ q โˆ™ r + โ†’ p โˆ™ r โปยน ๏ผ q +ap-right-inverse r {p} {q} ฮฑ = + p โˆ™ r โปยน ๏ผโŸจ ap (_โˆ™ r โปยน) ฮฑ โŸฉ + q โˆ™ r โˆ™ r โปยน ๏ผโŸจ โˆ™assoc q r (r โปยน) โŸฉ + q โˆ™ (r โˆ™ r โปยน) ๏ผโŸจ ap (q โˆ™_) (sym-is-inverse' r โปยน) โŸฉ + q โˆŽ + +\end{code} diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index a3066e882..213323e60 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -58,6 +58,18 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) โ†’ (c : C) โ†’ apd (pushout-induction l r G) (glue c) โˆ™ pushout-ind-comp-r l r G (g c) ๏ผ ap (transport P (glue c)) (pushout-ind-comp-l l r G (f c)) โˆ™ G c + +\end{code} + +We will now observe that the pushout is a cocone and begin deriving some key +results from the induction principle: +recursion (along with corresponding computation rules), universal properties +and uniqueness. + +\begin{code} + + pushout-cocone : cocone f g pushout + pushout-cocone = (inll , inrr , glue) pushout-recursion : {D : ๐“ฃ ฬ‡} โ†’ (l : A โ†’ D) @@ -93,11 +105,52 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) โ†’ (c : C) โ†’ ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) ๏ผ pushout-rec-comp-l l r G (f c) โˆ™ G c - pushout-rec-comp-G {๐“ฃ} {D} l r G c = {!!} - - pushout-cocone : cocone f g pushout - pushout-cocone = (inll , inrr , glue) - + pushout-rec-comp-G {๐“ฃ} {D} l r G c = + ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ III โŸฉ + transport-const (glue c) โปยน โˆ™ apd (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ V โŸฉ + transport-const (glue c) โปยน + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ (transport-const (glue c) โˆ™ G c) ๏ผโŸจ VI โŸฉ + transport-const (glue c) โปยน + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ transport-const (glue c) โˆ™ G c ๏ผโŸจ IX โŸฉ + pushout-rec-comp-l l r G (f c) โˆ™ G c โˆŽ + where + II : ap (pushout-recursion l r G) (glue c) + ๏ผ transport-const (glue c) โปยน + โˆ™ apd (pushout-induction l r (ฮป - โ†’ (transport-const (glue -) โˆ™ G -))) + (glue c) + II = apd-from-ap (pushout-recursion l r G) (glue c) + III = ap (_โˆ™ pushout-rec-comp-r l r G (g c)) II + IV : apd (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) + ๏ผ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ (transport-const (glue c) โˆ™ G c) + IV = pushout-ind-comp-G l r (ฮป - โ†’ (transport-const (glue -) โˆ™ G -)) c + V : transport-const (glue c) โปยน โˆ™ apd (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c) + ๏ผ transport-const (glue c) โปยน + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ (transport-const (glue c) โˆ™ G c) + V = ap-on-left-is-assoc (transport-const (glue c) โปยน) IV + VI = โˆ™assoc (transport-const (glue c) โปยน โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) + (pushout-rec-comp-l l r G (f c))) (transport-const (glue c)) + (G c) โปยน + VII : ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ transport-const (glue c) + ๏ผ transport-const (glue c) โˆ™ pushout-rec-comp-l l r G (f c) + VII = homotopies-are-natural (transport (ฮป - โ†’ D) (glue c)) id + (ฮป - โ†’ transport-const (glue c)) โปยน + VIII : transport-const (glue c) โปยน + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ transport-const (glue c) + ๏ผ pushout-rec-comp-l l r G (f c) + VIII = โˆ™assoc (transport-const (glue c) โปยน) + (ap (transport (ฮป - โ†’ D) (glue c)) + (pushout-rec-comp-l l r G (f c))) (transport-const (glue c)) + โˆ™ ap-left-inverse (transport-const (glue c)) VII + IX = ap (_โˆ™ G c) VIII + pushout-universal-property : (X : ๐“ฃ ฬ‡) โ†’ (pushout โ†’ X) โ‰ƒ cocone f g X pushout-universal-property X = qinveq ฯ• (ฯˆ , ฯˆ-ฯ• , ฯ•-ฯˆ) @@ -122,12 +175,16 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue c) ๏ผ G c III = {!!} - where - - \end{code} -I : apd (pushout-induction l r ?) (glue c) - ๏ผ ap (pushout-recursion l r G) (glue c) - I = ? +I โปยน โˆ™ apd (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ VI โŸฉ + I โปยน โˆ™ (apd (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c)) ๏ผโŸจ VII โŸฉ + I โปยน โˆ™ (ap (transport (ฮป - โ†’ D) (glue c)) + (pushout-rec-comp-l l r G (f c)) + โˆ™ (transport-const (glue c) โˆ™ G c)) ๏ผโŸจ VIII โŸฉ + I โปยน โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) + (pushout-rec-comp-l l r G (f c)) + โˆ™ (transport-const (glue c) โˆ™ G c) โˆŽ From a07a47c9393caca12f0b87e00f9298f46428c855 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Mon, 20 Jan 2025 12:44:58 -0500 Subject: [PATCH 03/18] Update --- source/UF/Base.lagda | 6 ++++-- source/UF/Pushouts.lagda | 36 +++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/source/UF/Base.lagda b/source/UF/Base.lagda index 98098a156..19f90d9aa 100644 --- a/source/UF/Base.lagda +++ b/source/UF/Base.lagda @@ -517,8 +517,10 @@ apd-from-ap f refl = refl \end{code} -We will also add some helpful path lemmas paths. Note that pattern matching -is not helpful here since association l โˆ™ q โˆ™ s is by definition (l โˆ™ q) โˆ™ s. +We will also add some helpful path algebra lemmas. Note that pattern matching +is not helpful here since the path concatenation by definition associates to +the left: l โˆ™ q โˆ™ s โ‰ก (l โˆ™ q) โˆ™ s (where โ‰ก is definitional). So, as you will +see below, we have to reassociate before applying on the left. \begin{code} diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 213323e60..2e0255b69 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -164,27 +164,29 @@ and uniqueness. dfunext fe (pushout-induction (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - {!!}) + I) + where + I : (c : C) + โ†’ transport (ฮป z โ†’ (ฯˆ โˆ˜ ฯ•) u z ๏ผ u z) (glue c) + (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue) (f c)) + ๏ผ pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue) (g c) + I c = transport (ฮป z โ†’ (ฯˆ โˆ˜ ฯ•) u z ๏ผ u z) (glue c) + (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) + (โˆผ-ap-โˆ˜ u glue) (f c)) ๏ผโŸจ {!!} โŸฉ + pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) + (โˆผ-ap-โˆ˜ u glue) (g c) ๏ผโŸจ {!!} โŸฉ + {!!} ฯ•-ฯˆ : ฯ• โˆ˜ ฯˆ โˆผ id ฯ•-ฯˆ (l , r , G) = - ap โŒœ ฮฃ-assoc โŒ (to-ฮฃ-๏ผ (to-ร—-๏ผ I II , dfunext fe {!!})) + ap โŒœ ฮฃ-assoc โŒ (to-ฮฃ-๏ผ (to-ร—-๏ผ I II , dfunext fe III)) where I = dfunext fe (pushout-rec-comp-l l r G) II = dfunext fe (pushout-rec-comp-r l r G) - III : (c : C) โ†’ transport {!!} (to-ร—-๏ผ I II) - (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue c) - ๏ผ G c - III = {!!} + III : (c : C) + โ†’ transport (ฮป z โ†’ (ฮป x โ†’ prโ‚ z (f x)) โˆผ (ฮป x โ†’ prโ‚‚ z (g x))) + (to-ร—-๏ผ I II) + (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c + ๏ผ G c + III c = {!!} \end{code} - -I โปยน โˆ™ apd (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ VI โŸฉ - I โปยน โˆ™ (apd (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c)) ๏ผโŸจ VII โŸฉ - I โปยน โˆ™ (ap (transport (ฮป - โ†’ D) (glue c)) - (pushout-rec-comp-l l r G (f c)) - โˆ™ (transport-const (glue c) โˆ™ G c)) ๏ผโŸจ VIII โŸฉ - I โปยน โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) - (pushout-rec-comp-l l r G (f c)) - โˆ™ (transport-const (glue c) โˆ™ G c) โˆŽ From 6421ee9e872f1c9f5abb9809175a3a631a7ab6a5 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Thu, 23 Jan 2025 08:46:16 -0500 Subject: [PATCH 04/18] Update --- source/UF/Base.lagda | 58 ++++++++++++++++++-- source/UF/Pushouts.lagda | 113 +++++++++++++++++++++++++++++++-------- 2 files changed, 144 insertions(+), 27 deletions(-) diff --git a/source/UF/Base.lagda b/source/UF/Base.lagda index 19f90d9aa..9f0900eb2 100644 --- a/source/UF/Base.lagda +++ b/source/UF/Base.lagda @@ -541,6 +541,13 @@ ap-on-left-is-assoc' l p q s ฮฑ = l โˆ™ p ๏ผโŸจ ap (l โˆ™_) ฮฑ โŸฉ l โˆ™ (q โˆ™ s) ๏ผโŸจ โˆ™assoc l q s โปยน โŸฉ l โˆ™ q โˆ™ s โˆŽ +ap-on-left-is-assoc'' : {X : ๐“ค ฬ‡ } {x y z z' : X} (l : x ๏ผ y) + (p : y ๏ผ z) (q : y ๏ผ z') (s : z ๏ผ z') + โ†’ p โˆ™ s ๏ผ q + โ†’ (l โˆ™ p) โˆ™ s ๏ผ l โˆ™ q +ap-on-left-is-assoc'' l p q s ฮฑ = + ap-on-left-is-assoc' l q p s (ฮฑ โปยน) โปยน + ap-left-inverse : {X : ๐“ค ฬ‡ } {x y z : X} (l : x ๏ผ y) {p : x ๏ผ z} {q : y ๏ผ z} โ†’ p ๏ผ l โˆ™ q @@ -551,14 +558,55 @@ ap-left-inverse l {p} {q} ฮฑ = refl โˆ™ q ๏ผโŸจ refl-left-neutral โŸฉ q โˆŽ +ap-left-inverse' : {X : ๐“ค ฬ‡ } {x y z : X} (l : x ๏ผ y) + {p : x ๏ผ z} {q : y ๏ผ z} + โ†’ l โปยน โˆ™ p ๏ผ q + โ†’ p ๏ผ l โˆ™ q +ap-left-inverse' l {p} {q} ฮฑ = + p ๏ผโŸจ refl-left-neutral โปยน โŸฉ + refl โˆ™ p ๏ผโŸจ ap (_โˆ™ p) (sym-is-inverse' l) โŸฉ + l โˆ™ l โปยน โˆ™ p ๏ผโŸจ ap-on-left-is-assoc'' l (l โปยน) q p ฮฑ โŸฉ + l โˆ™ q โˆŽ + ap-right-inverse : {X : ๐“ค ฬ‡ } {x y z : X} (r : y ๏ผ z) {p : x ๏ผ z} {q : x ๏ผ y} โ†’ p ๏ผ q โˆ™ r โ†’ p โˆ™ r โปยน ๏ผ q -ap-right-inverse r {p} {q} ฮฑ = - p โˆ™ r โปยน ๏ผโŸจ ap (_โˆ™ r โปยน) ฮฑ โŸฉ - q โˆ™ r โˆ™ r โปยน ๏ผโŸจ โˆ™assoc q r (r โปยน) โŸฉ - q โˆ™ (r โˆ™ r โปยน) ๏ผโŸจ ap (q โˆ™_) (sym-is-inverse' r โปยน) โŸฉ - q โˆŽ +ap-right-inverse refl ฮฑ = ฮฑ + +ap-right-inverse' : {X : ๐“ค ฬ‡ } {x y z : X} (r : y ๏ผ z) + {p : x ๏ผ z} {q : x ๏ผ y} + โ†’ p โˆ™ r โปยน ๏ผ q + โ†’ p ๏ผ q โˆ™ r +ap-right-inverse' refl ฮฑ = ฮฑ + +\end{code} + +We will also add another transport lemma (this may already exist!) + +\begin{code} + +transport-lemma + : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } {x x' : X} + โ†’ (p : x ๏ผ x') + โ†’ (s s' : X โ†’ Y) + โ†’ (q : s x ๏ผ s' x) + โ†’ ap s p โˆ™ transport (ฮป - โ†’ s - ๏ผ s' -) p q ๏ผ q โˆ™ ap s' p +transport-lemma refl s s' q = + ap s refl โˆ™ q ๏ผโŸจ ap (_โˆ™ q) (ap-refl s) โŸฉ + refl โˆ™ q ๏ผโŸจ refl-left-neutral โŸฉ + q โˆ™ refl ๏ผโŸจ ap (q โˆ™_) (ap-refl s') โŸฉ + q โˆ™ ap s' refl โˆŽ + +transport-lemma' + : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } {x x' : X} + โ†’ (p : x ๏ผ x') + โ†’ (s s' : X โ†’ Y) + โ†’ (q : s x ๏ผ s' x) + โ†’ transport (ฮป - โ†’ s - ๏ผ s' -) p q ๏ผ ap s p โปยน โˆ™ q โˆ™ ap s' p +transport-lemma' refl s s' q = + q ๏ผโŸจ refl-left-neutral โปยน โŸฉ + refl โˆ™ q ๏ผโŸจ refl โŸฉ + ap s refl โปยน โˆ™ q โˆ™ ap s' refl โˆŽ \end{code} diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 2e0255b69..4161ac8f1 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -16,14 +16,34 @@ open import MLTT.Spartan open import UF.Base open import UF.Equiv open import UF.EquivalenceExamples +open import UF.Subsingletons + +\end{code} + +We start by defining cocones and characerizing the identity type. + +\begin{code} cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) - (X : ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ cocone {๐“ค} {๐“ฅ} {๐“ฆ} {๐“ฃ} {A} {B} {C} f g X = ฮฃ k ๊ž‰ (A โ†’ X) , ฮฃ l ๊ž‰ (B โ†’ X) , (k โˆ˜ f โˆผ l โˆ˜ g) +cocone-family : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ cocone f g X โ†’ cocone f g X โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +cocone-family f g X (i , j , H) (i' , j' , H') = + ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g) + +cocone-family-is-contractible + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (x : cocone f g X) + โ†’ is-contr (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X x y) +cocone-family-is-contractible f g X (i , j , H) = {!!} + record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ where field @@ -149,7 +169,35 @@ and uniqueness. (ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c))) (transport-const (glue c)) โˆ™ ap-left-inverse (transport-const (glue c)) VII - IX = ap (_โˆ™ G c) VIII + IX = ap (_โˆ™ G c) VIII + + pushout-uniqueness : (X : ๐“ฃ ฬ‡) + โ†’ (s s' : pushout โ†’ X) + โ†’ (H : (a : A) โ†’ s (inll a) ๏ผ s' (inll a)) + โ†’ (H' : (b : B) โ†’ s (inrr b) ๏ผ s' (inrr b)) + โ†’ (G : (c : C) + โ†’ ap s (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap s' (glue c)) + โ†’ (x : pushout) โ†’ s x ๏ผ s' x + pushout-uniqueness X s s' H H' G = + pushout-induction H H' I + where + I : (c : C) + โ†’ transport (ฮป - โ†’ s - ๏ผ s' -) (glue c) (H (f c)) ๏ผ H' (g c) + I c = transport (ฮป - โ†’ s - ๏ผ s' -) (glue c) (H (f c)) ๏ผโŸจ II โŸฉ + ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผโŸจ III โŸฉ + H' (g c) โˆŽ + where + II : transport (ฮป - โ†’ s - ๏ผ s' -) (glue c) (H (f c)) + ๏ผ ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) + II = transport-lemma' (glue c) s s' (H (f c)) + III : ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผ H' (g c) + III = + ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผโŸจ IV โŸฉ + ap s (glue c) โปยน โˆ™ (H (f c) โˆ™ ap s' (glue c)) ๏ผโŸจ V โŸฉ + H' (g c) โˆŽ + where + IV = โˆ™assoc (ap s (glue c) โปยน) (H (f c)) (ap s' (glue c)) + V = ap-left-inverse (ap s (glue c)) (G c โปยน) pushout-universal-property : (X : ๐“ฃ ฬ‡) โ†’ (pushout โ†’ X) โ‰ƒ cocone f g X @@ -160,22 +208,10 @@ and uniqueness. ฯˆ : cocone f g X โ†’ (pushout โ†’ X) ฯˆ (l , r , G) = pushout-recursion l r G ฯˆ-ฯ• : ฯˆ โˆ˜ ฯ• โˆผ id - ฯˆ-ฯ• u = - dfunext fe (pushout-induction - (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - I) - where - I : (c : C) - โ†’ transport (ฮป z โ†’ (ฯˆ โˆ˜ ฯ•) u z ๏ผ u z) (glue c) - (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue) (f c)) - ๏ผ pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue) (g c) - I c = transport (ฮป z โ†’ (ฯˆ โˆ˜ ฯ•) u z ๏ผ u z) (glue c) - (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) - (โˆผ-ap-โˆ˜ u glue) (f c)) ๏ผโŸจ {!!} โŸฉ - pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) - (โˆผ-ap-โˆ˜ u glue) (g c) ๏ผโŸจ {!!} โŸฉ - {!!} + ฯˆ-ฯ• u = dfunext fe (pushout-uniqueness X ((ฯˆ โˆ˜ ฯ•) u) u + (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + (pushout-rec-comp-G (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue))) ฯ•-ฯˆ : ฯ• โˆ˜ ฯˆ โˆผ id ฯ•-ฯˆ (l , r , G) = ap โŒœ ฮฃ-assoc โŒ (to-ฮฃ-๏ผ (to-ร—-๏ผ I II , dfunext fe III)) @@ -183,10 +219,43 @@ and uniqueness. I = dfunext fe (pushout-rec-comp-l l r G) II = dfunext fe (pushout-rec-comp-r l r G) III : (c : C) - โ†’ transport (ฮป z โ†’ (ฮป x โ†’ prโ‚ z (f x)) โˆผ (ฮป x โ†’ prโ‚‚ z (g x))) - (to-ร—-๏ผ I II) + โ†’ transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c ๏ผ G c - III c = {!!} + III c = transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) + (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c ๏ผโŸจ V โŸฉ + pushout-rec-comp-l l r G (f c) โปยน + โˆ™ ap (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ VI โŸฉ + pushout-rec-comp-l l r G (f c) โปยน + โˆ™ (ap (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c)) ๏ผโŸจ VII โŸฉ + G c โˆŽ + where + IV : ap (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c) + ๏ผ pushout-rec-comp-l l r G (f c) + โˆ™ transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) + (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c + IV = {!!} โปยน + V : transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) + (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c + ๏ผ pushout-rec-comp-l l r G (f c) โปยน + โˆ™ ap (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-r l r G (g c) + V = ap-left-inverse (pushout-rec-comp-l l r G (f c)) IV โปยน + โˆ™ (โˆ™assoc (pushout-rec-comp-l l r G (f c) โปยน) + (ap (pushout-recursion l r G) (glue c)) + (pushout-rec-comp-r l r G (g c))) โปยน + VI = โˆ™assoc (pushout-rec-comp-l l r G (f c) โปยน) + (ap (pushout-recursion l r G) (glue c)) + (pushout-rec-comp-r l r G (g c)) + VII = ap-left-inverse (pushout-rec-comp-l l r G (f c)) + (pushout-rec-comp-G l r G c) \end{code} + + dfunext fe (pushout-induction + (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + I) From 335200858e4dad24a32ab39917409b9a6f3e9ade Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sat, 25 Jan 2025 00:16:54 -0500 Subject: [PATCH 05/18] Update --- source/UF/Base.lagda | 15 ++-- source/UF/Pushouts.lagda | 151 +++++++++++++++++++++++++-------------- 2 files changed, 108 insertions(+), 58 deletions(-) diff --git a/source/UF/Base.lagda b/source/UF/Base.lagda index 9f0900eb2..3d4461bad 100644 --- a/source/UF/Base.lagda +++ b/source/UF/Base.lagda @@ -582,29 +582,34 @@ ap-right-inverse' refl ฮฑ = ฮฑ \end{code} -We will also add another transport lemma (this may already exist!) +We will also add a result that says: +given two maps, a path in the domain and a path in the codomain between the +maps at the left endpoint then applying one map to the domain path and +transporting along that path at the codomain path is the same as following the +codomain path and applying the other map to the domain path. +(this may already exist!) \begin{code} -transport-lemma +transport-after-ap : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } {x x' : X} โ†’ (p : x ๏ผ x') โ†’ (s s' : X โ†’ Y) โ†’ (q : s x ๏ผ s' x) โ†’ ap s p โˆ™ transport (ฮป - โ†’ s - ๏ผ s' -) p q ๏ผ q โˆ™ ap s' p -transport-lemma refl s s' q = +transport-after-ap refl s s' q = ap s refl โˆ™ q ๏ผโŸจ ap (_โˆ™ q) (ap-refl s) โŸฉ refl โˆ™ q ๏ผโŸจ refl-left-neutral โŸฉ q โˆ™ refl ๏ผโŸจ ap (q โˆ™_) (ap-refl s') โŸฉ q โˆ™ ap s' refl โˆŽ -transport-lemma' +transport-after-ap' : {X : ๐“ค ฬ‡ } {Y : ๐“ฅ ฬ‡ } {x x' : X} โ†’ (p : x ๏ผ x') โ†’ (s s' : X โ†’ Y) โ†’ (q : s x ๏ผ s' x) โ†’ transport (ฮป - โ†’ s - ๏ผ s' -) p q ๏ผ ap s p โปยน โˆ™ q โˆ™ ap s' p -transport-lemma' refl s s' q = +transport-after-ap' refl s s' q = q ๏ผโŸจ refl-left-neutral โปยน โŸฉ refl โˆ™ q ๏ผโŸจ refl โŸฉ ap s refl โปยน โˆ™ q โˆ™ ap s' refl โˆŽ diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 4161ac8f1..7fa06af9a 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -16,7 +16,9 @@ open import MLTT.Spartan open import UF.Base open import UF.Equiv open import UF.EquivalenceExamples +open import UF.PropIndexedPiSigma open import UF.Subsingletons +open import UF.Yoneda \end{code} @@ -28,7 +30,7 @@ cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ cocone {๐“ค} {๐“ฅ} {๐“ฆ} {๐“ฃ} {A} {B} {C} f g X = - ฮฃ k ๊ž‰ (A โ†’ X) , ฮฃ l ๊ž‰ (B โ†’ X) , (k โˆ˜ f โˆผ l โˆ˜ g) + ฮฃ i ๊ž‰ (A โ†’ X) , ฮฃ j ๊ž‰ (B โ†’ X) , (i โˆ˜ f โˆผ j โˆ˜ g) cocone-family : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) @@ -37,12 +39,98 @@ cocone-family f g X (i , j , H) (i' , j' , H') = ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g) -cocone-family-is-contractible +cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ u ๏ผ u' + โ†’ cocone-family f g X u u' +cocone-map f g X (i , j , H) .(i , j , H) refl = + (โˆผ-refl , โˆผ-refl , ฮป - โ†’ refl-left-neutral) + +cocone-family-is-identity-system : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) โ†’ (x : cocone f g X) โ†’ is-contr (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X x y) -cocone-family-is-contractible f g X (i , j , H) = {!!} +cocone-family-is-identity-system {_} {_} {_} {๐“ฃ} {A} {B} {C} f g X (i , j , H) = + equiv-to-singleton e ๐Ÿ™-is-singleton + where + e : (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X (i , j , H) y) โ‰ƒ ๐Ÿ™ { ๐“ฃ } + e = (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X (i , j , H) y) โ‰ƒโŸจ I โŸฉ + (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ j' ๊ž‰ (B โ†’ X) , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ II โŸฉ + (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ K ๊ž‰ i โˆผ i' , + ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ VII โŸฉ + (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , H' โˆผ H) โ‰ƒโŸจ IXV โŸฉ + ๐Ÿ™ โ–  + where + I = โ‰ƒ-comp ฮฃ-assoc (ฮฃ-cong (ฮป i' โ†’ ฮฃ-assoc)) + II = ฮฃ-cong (ฮป _ โ†’ โ‰ƒ-comp (ฮฃ-cong + (ฮป _ โ†’ โ‰ƒ-comp ฮฃ-flip (ฮฃ-cong (ฮป K โ†’ ฮฃ-flip)))) ฮฃ-flip) + III = (ฮฃ i' ๊ž‰ (A โ†’ X) , i โˆผ i') โ‰ƒโŸจ IV โŸฉ + (ฮฃ i' ๊ž‰ (A โ†’ X) , i ๏ผ i') โ‰ƒโŸจ V โŸฉ + ๐Ÿ™ โ–  + where + IV = ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe i -)) + V = singleton-โ‰ƒ-๐Ÿ™ (singleton-types-are-singletons i) + VI = โ‰ƒ-comp (ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe j -))) + (singleton-โ‰ƒ-๐Ÿ™ (singleton-types-are-singletons j)) + VII = (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ K ๊ž‰ i โˆผ i' , + ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ IIIV โŸฉ + (ฮฃ (i' , K) ๊ž‰ (ฮฃ i' ๊ž‰ (A โ†’ X) , i โˆผ i') , + ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ IX โŸฉ + (ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ XI โŸฉ + (ฮฃ (j' , L) ๊ž‰ (ฮฃ j' ๊ž‰ (B โ†’ X) , j โˆผ j') , + ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ XII โŸฉ + (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , + โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (โˆผ-refl โˆ˜ g)) โ‰ƒโŸจ XIII โŸฉ + (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , H' โˆผ H) โ–  + where + IIIV = โ‰ƒ-sym ฮฃ-assoc + IX = prop-indexed-sum (equiv-to-prop III ๐Ÿ™-is-prop) (i , โˆผ-refl) + XI = โ‰ƒ-sym ฮฃ-assoc + XII = prop-indexed-sum (equiv-to-prop VI ๐Ÿ™-is-prop) (j , โˆผ-refl) + XIII = ฮฃ-cong (ฮป H' โ†’ ฮ -cong fe fe (ฮป c โ†’ ๏ผ-cong (refl โˆ™ H' c) + (โˆผ-trans H (ฮป _ โ†’ refl) c) refl-left-neutral + (refl-right-neutral (H c) โปยน))) + IXV = โ‰ƒ-comp (ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe - H))) + (singleton-โ‰ƒ-๐Ÿ™ (equiv-to-singleton (ฮฃ-cong (ฮป - โ†’ ๏ผ-flip)) + (singleton-types-are-singletons H))) + +cocone-identity-characterization : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ (u ๏ผ u') โ‰ƒ (cocone-family f g X u u') +cocone-identity-characterization f g X u u' = + (cocone-map f g X u u' , + Yoneda-Theorem-forth u (cocone-map f g X u) + (cocone-family-is-identity-system f g X u) u') + +inverse-cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ cocone-family f g X u u' + โ†’ u ๏ผ u' +inverse-cocone-map f g X u u' = + โŒœ (cocone-identity-characterization f g X u u') โŒโปยน + +\end{code} + +Now we will use a record type to give the pushout, point and path constructors, +and the induction principle along with propositional computation rules. + +\begin{code} record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ where @@ -83,8 +171,8 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) We will now observe that the pushout is a cocone and begin deriving some key results from the induction principle: -recursion (along with corresponding computation rules), universal properties -and uniqueness. +recursion (along with corresponding computation rules), uniqueness and the +universal property. \begin{code} @@ -187,10 +275,7 @@ and uniqueness. ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผโŸจ III โŸฉ H' (g c) โˆŽ where - II : transport (ฮป - โ†’ s - ๏ผ s' -) (glue c) (H (f c)) - ๏ผ ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) - II = transport-lemma' (glue c) s s' (H (f c)) - III : ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผ H' (g c) + II = transport-after-ap' (glue c) s s' (H (f c)) III = ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผโŸจ IV โŸฉ ap s (glue c) โปยน โˆ™ (H (f c) โˆ™ ap s' (glue c)) ๏ผโŸจ V โŸฉ @@ -214,48 +299,8 @@ and uniqueness. (pushout-rec-comp-G (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue))) ฯ•-ฯˆ : ฯ• โˆ˜ ฯˆ โˆผ id ฯ•-ฯˆ (l , r , G) = - ap โŒœ ฮฃ-assoc โŒ (to-ฮฃ-๏ผ (to-ร—-๏ผ I II , dfunext fe III)) - where - I = dfunext fe (pushout-rec-comp-l l r G) - II = dfunext fe (pushout-rec-comp-r l r G) - III : (c : C) - โ†’ transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) - (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c - ๏ผ G c - III c = transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) - (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c ๏ผโŸจ V โŸฉ - pushout-rec-comp-l l r G (f c) โปยน - โˆ™ ap (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ VI โŸฉ - pushout-rec-comp-l l r G (f c) โปยน - โˆ™ (ap (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c)) ๏ผโŸจ VII โŸฉ - G c โˆŽ - where - IV : ap (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c) - ๏ผ pushout-rec-comp-l l r G (f c) - โˆ™ transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) - (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c - IV = {!!} โปยน - V : transport (ฮป (l' , r') โ†’ l' โˆ˜ f โˆผ r' โˆ˜ g) (to-ร—-๏ผ I II) - (โˆผ-ap-โˆ˜ (ฯˆ (l , r , G)) glue) c - ๏ผ pushout-rec-comp-l l r G (f c) โปยน - โˆ™ ap (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c) - V = ap-left-inverse (pushout-rec-comp-l l r G (f c)) IV โปยน - โˆ™ (โˆ™assoc (pushout-rec-comp-l l r G (f c) โปยน) - (ap (pushout-recursion l r G) (glue c)) - (pushout-rec-comp-r l r G (g c))) โปยน - VI = โˆ™assoc (pushout-rec-comp-l l r G (f c) โปยน) - (ap (pushout-recursion l r G) (glue c)) - (pushout-rec-comp-r l r G (g c)) - VII = ap-left-inverse (pushout-rec-comp-l l r G (f c)) - (pushout-rec-comp-G l r G c) - + inverse-cocone-map f g X ((ฯ• โˆ˜ ฯˆ) (l , r , G)) (l , r , G) + (pushout-rec-comp-l l r G , pushout-rec-comp-r l r G , + โˆผ-sym (pushout-rec-comp-G l r G)) + \end{code} - - dfunext fe (pushout-induction - (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - I) From 4fe2e56870157b4adf6c484e1672f1d610a4ca95 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sat, 25 Jan 2025 00:21:36 -0500 Subject: [PATCH 06/18] Updating comments --- source/UF/Pushouts.lagda | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 7fa06af9a..92142c18a 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -1,8 +1,8 @@ Ian Ray, 15th January 2025 -Pushouts defined as higher inductive type (in the form of records). +Pushouts are defined as higher inductive type (in the form of a record type). We postulate point and path constructors, an induction principle and -computation rules for each constructor. +propositional computation rules for each constructor. \begin{code} @@ -115,7 +115,7 @@ cocone-identity-characterization : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} cocone-identity-characterization f g X u u' = (cocone-map f g X u u' , Yoneda-Theorem-forth u (cocone-map f g X u) - (cocone-family-is-identity-system f g X u) u') + (cocone-family-is-identity-system f g X u) u') inverse-cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) From b328465a90e490cd1486a51ca57e67c00162793b Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sun, 26 Jan 2025 11:54:51 -0500 Subject: [PATCH 07/18] Giving UP, Ind and computation rules. --- source/UF/Pushouts.lagda | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 92142c18a..9ebe185dc 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -127,6 +127,79 @@ inverse-cocone-map f g X u u' = \end{code} +Now we will define the universal property, induction principle and propositional +computation rules for pushouts and show they are inter-derivable. + +\begin{code} + +Pushout-Universal-Property + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ +Pushout-Universal-Property S X f g i j G + = (S โ†’ X) โ‰ƒ cocone f g X + +Pushout-Induction-Principle + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ +Pushout-Induction-Principle {_} {_} {_} {_} {_} {A} {B} {C} S P f g i j G + = (l : (a : A) โ†’ P (i a)) + โ†’ (r : (b : B) โ†’ P (j b)) + โ†’ ((c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : S) โ†’ P x + +Pushout-Propositional-Computation-Ruleโ‚ + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + (S-ind : Pushout-Induction-Principle S P f g i j G) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +Pushout-Propositional-Computation-Ruleโ‚ + {_} {_} {_} {_} {_} {A} {B} {C} S P f g i j G S-ind + = (l : (a : A) โ†’ P (i a)) + โ†’ (r : (b : B) โ†’ P (j b)) + โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ S-ind l r H (i a) ๏ผ l a + +Pushout-Propositional-Computation-Ruleโ‚‚ + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + (S-ind : Pushout-Induction-Principle S P f g i j G) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +Pushout-Propositional-Computation-Ruleโ‚‚ + {_} {_} {_} {_} {_} {A} {B} {C} S P f g i j G S-ind + = (l : (a : A) โ†’ P (i a)) + โ†’ (r : (b : B) โ†’ P (j b)) + โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ S-ind l r H (j b) ๏ผ r b + +Pushout-Propositional-Computation-Ruleโ‚ƒ + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + (S-ind : Pushout-Induction-Principle S P f g i j G) + (S-compโ‚ : Pushout-Propositional-Computation-Ruleโ‚ S P f g i j G S-ind) + (S-compโ‚‚ : Pushout-Propositional-Computation-Ruleโ‚‚ S P f g i j G S-ind) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +Pushout-Propositional-Computation-Ruleโ‚ƒ + {_} {_} {_} {_} {_}{A} {B} {C} S P f g i j G S-ind S-compโ‚ S-compโ‚‚ + = (l : (a : A) โ†’ P (i a)) + โ†’ (r : (b : B) โ†’ P (j b)) + โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ apd (S-ind l r H) (G c) โˆ™ S-compโ‚‚ l r H (g c) + ๏ผ ap (transport P (G c)) (S-compโ‚ l r H (f c)) โˆ™ H c + +Pushout-Universal-Property-implies-Induction + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + โ†’ Pushout-Universal-Property S X f g i j G + โ†’ Pushout-Induction-Principle S P f g i j G +Pushout-Universal-Property-implies-Induction = ? + +\end{code} + Now we will use a record type to give the pushout, point and path constructors, and the induction principle along with propositional computation rules. From 88314c2893f786a58fa6a0f5e54b4cf58da64e67 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Mon, 27 Jan 2025 20:19:02 -0500 Subject: [PATCH 08/18] Adding dependent universal property --- source/UF/Pushouts.lagda | 174 +++++++++++++++++++++++++++++---------- 1 file changed, 131 insertions(+), 43 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 9ebe185dc..a6780feac 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -22,7 +22,7 @@ open import UF.Yoneda \end{code} -We start by defining cocones and characerizing the identity type. +We start by defining cocones and characerizing their identity type. \begin{code} @@ -32,6 +32,24 @@ cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} cocone {๐“ค} {๐“ฅ} {๐“ฆ} {๐“ฃ} {A} {B} {C} f g X = ฮฃ i ๊ž‰ (A โ†’ X) , ฮฃ j ๊ž‰ (B โ†’ X) , (i โˆ˜ f โˆผ j โˆ˜ g) +cocone-vertical-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ cocone f g X + โ†’ (A โ†’ X) +cocone-vertical-map f g X (i , j , K) = i + +cocone-horizontal-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ cocone f g X + โ†’ (B โ†’ X) +cocone-horizontal-map f g X (i , j , K) = j + +cocone-commuting-square : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ ((i , j , K) : cocone f g X) + โ†’ i โˆ˜ f โˆผ j โˆ˜ g +cocone-commuting-square f g X (i , j , K) = K + cocone-family : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) โ†’ cocone f g X โ†’ cocone f g X โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ @@ -39,12 +57,14 @@ cocone-family f g X (i , j , H) (i' , j' , H') = ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g) -cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ (u u' : cocone f g X) - โ†’ u ๏ผ u' - โ†’ cocone-family f g X u u' -cocone-map f g X (i , j , H) .(i , j , H) refl = +canonical-map-from-identity-to-cocone-family + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ u ๏ผ u' + โ†’ cocone-family f g X u u' +canonical-map-from-identity-to-cocone-family + f g X (i , j , H) .(i , j , H) refl = (โˆผ-refl , โˆผ-refl , ฮป - โ†’ refl-left-neutral) cocone-family-is-identity-system @@ -113,8 +133,8 @@ cocone-identity-characterization : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} โ†’ (u u' : cocone f g X) โ†’ (u ๏ผ u') โ‰ƒ (cocone-family f g X u u') cocone-identity-characterization f g X u u' = - (cocone-map f g X u u' , - Yoneda-Theorem-forth u (cocone-map f g X u) + (canonical-map-from-identity-to-cocone-family f g X u u' , + Yoneda-Theorem-forth u (canonical-map-from-identity-to-cocone-family f g X u) (cocone-family-is-identity-system f g X u) u') inverse-cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} @@ -127,63 +147,115 @@ inverse-cocone-map f g X u u' = \end{code} -Now we will define the universal property, induction principle and propositional -computation rules for pushouts and show they are inter-derivable. +We also introduce the notion of a dependent cocone. + +\begin{code} + +dependent-cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + (t : cocone f g X) (P : X โ†’ ๐“ฃ' ฬ‡) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ' ฬ‡ +dependent-cocone {_} {_} {_} {_} {_} {A} {B} {C} f g X (i , j , H) P = + ฮฃ i' ๊ž‰ ((a : A) โ†’ P (i a)) , ฮฃ j' ๊ž‰ ((b : B) โ†’ P (j b)) , + ((c : C) โ†’ transport P (H c) (i' (f c)) ๏ผ j' (g c)) + +\end{code} + +Now we will define the (dependent) universal property, induction principle and +propositional computation rules for pushouts and show they are inter-derivable*. + +*In fact we will only show: +(1) + The dependent universal propery implies the induction principle and + propositional computation rules. + +(2) + The induction principle and propositional computationrules implies the + (non-dependeny) universal property. + +We will not show +(3) + The (non-dependent) universal property implies the dependent universal + property. + +(3) Is shown in the Agda Unimath library (*link*). It involves something called +the pullback property of pushouts which we wish to avoid exploring for now.* \begin{code} +canonical-map-to-cocone + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ (S โ†’ X) โ†’ cocone f g X +canonical-map-to-cocone S X f g (i , j , G) u = + (u โˆ˜ i , u โˆ˜ j , โˆผ-ap-โˆ˜ u G) + Pushout-Universal-Property : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ -Pushout-Universal-Property S X f g i j G - = (S โ†’ X) โ‰ƒ cocone f g X +Pushout-Universal-Property S X f g s + = is-equiv (canonical-map-to-cocone S X f g s) + +dependent-canonical-map-to-cocone + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ ((x : S) โ†’ P x) โ†’ dependent-cocone f g S s P +dependent-canonical-map-to-cocone S P f g (i , j , G) d = + (d โˆ˜ i , d โˆ˜ j , ฮป c โ†’ apd d (G c)) + +Pushout-Dependent-Universal-Property + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ +Pushout-Dependent-Universal-Property S P f g s = + is-equiv (dependent-canonical-map-to-cocone S P f g s) Pushout-Induction-Principle : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ -Pushout-Induction-Principle {_} {_} {_} {_} {_} {A} {B} {C} S P f g i j G +Pushout-Induction-Principle {_} {_} {_} {_} {_} {A} {B} {C} S P f g (i , j , G) = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ ((c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) โ†’ (x : S) โ†’ P x -Pushout-Propositional-Computation-Ruleโ‚ +Pushout-Computation-Ruleโ‚ : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) - (S-ind : Pushout-Induction-Principle S P f g i j G) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ Pushout-Induction-Principle S P f g s โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ -Pushout-Propositional-Computation-Ruleโ‚ - {_} {_} {_} {_} {_} {A} {B} {C} S P f g i j G S-ind +Pushout-Computation-Ruleโ‚ + {_} {_} {_} {_} {_} {A} {B} {C} S P f g (i , j , G) S-ind = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) โ†’ (a : A) โ†’ S-ind l r H (i a) ๏ผ l a -Pushout-Propositional-Computation-Ruleโ‚‚ +Pushout-Computation-Ruleโ‚‚ : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) - (S-ind : Pushout-Induction-Principle S P f g i j G) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ Pushout-Induction-Principle S P f g s โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ -Pushout-Propositional-Computation-Ruleโ‚‚ - {_} {_} {_} {_} {_} {A} {B} {C} S P f g i j G S-ind +Pushout-Computation-Ruleโ‚‚ + {_} {_} {_} {_} {_} {A} {B} {C} S P f g (i , j , G) S-ind = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) โ†’ (b : B) โ†’ S-ind l r H (j b) ๏ผ r b -Pushout-Propositional-Computation-Ruleโ‚ƒ +Pushout-Computation-Ruleโ‚ƒ : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) - (S-ind : Pushout-Induction-Principle S P f g i j G) - (S-compโ‚ : Pushout-Propositional-Computation-Ruleโ‚ S P f g i j G S-ind) - (S-compโ‚‚ : Pushout-Propositional-Computation-Ruleโ‚‚ S P f g i j G S-ind) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + (S-ind : Pushout-Induction-Principle S P f g s) + โ†’ Pushout-Computation-Ruleโ‚ S P f g s S-ind + โ†’ Pushout-Computation-Ruleโ‚‚ S P f g s S-ind โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ -Pushout-Propositional-Computation-Ruleโ‚ƒ - {_} {_} {_} {_} {_}{A} {B} {C} S P f g i j G S-ind S-compโ‚ S-compโ‚‚ +Pushout-Computation-Ruleโ‚ƒ + {_} {_} {_} {_} {_}{A} {B} {C} S P f g (i , j , G) S-ind S-compโ‚ S-compโ‚‚ = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) @@ -191,18 +263,36 @@ Pushout-Propositional-Computation-Ruleโ‚ƒ โ†’ apd (S-ind l r H) (G c) โˆ™ S-compโ‚‚ l r H (g c) ๏ผ ap (transport P (G c)) (S-compโ‚ l r H (f c)) โˆ™ H c -Pushout-Universal-Property-implies-Induction +Pushout-Dependent-Universal-Property-implies-Induction + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ Pushout-Dependent-Universal-Property S P f g s + โ†’ Pushout-Induction-Principle S P f g s +Pushout-Dependent-Universal-Property-implies-Induction = {!!} + +Pushout-Induction-and-Computation-implies-Universal-Property : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (i : A โ†’ S) (j : B โ†’ S) (G : i โˆ˜ f โˆผ j โˆ˜ g) - โ†’ Pushout-Universal-Property S X f g i j G - โ†’ Pushout-Induction-Principle S P f g i j G -Pushout-Universal-Property-implies-Induction = ? + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + (S-ind : Pushout-Induction-Principle S P f g s) + (S-compโ‚ : Pushout-Computation-Ruleโ‚ S P f g s S-ind) + (S-compโ‚‚ : Pushout-Computation-Ruleโ‚‚ S P f g s S-ind) + โ†’ Pushout-Computation-Ruleโ‚ƒ S P f g s S-ind S-compโ‚ S-compโ‚‚ + โ†’ Pushout-Universal-Property S X f g s +Pushout-Induction-and-Computation-implies-Universal-Property = {!!} \end{code} Now we will use a record type to give the pushout, point and path constructors, and the induction principle along with propositional computation rules. +Commenting out the fleshed out induction principle to test the named version +given above + +(l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ P x + \begin{code} record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ @@ -212,11 +302,9 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) inll : A โ†’ pushout inrr : B โ†’ pushout glue : (c : C) โ†’ inll (f c) ๏ผ inrr (g c) - pushout-induction : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (x : pushout) โ†’ P x + pushout-induction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Induction-Principle pushout P f g (inll , inrr , glue) pushout-ind-comp-l : {P : pushout โ†’ ๐“ฃ ฬ‡} โ†’ (l : (a : A) โ†’ P (inll a)) From dbc2be4bf3dc6d707e959d2b69d11311bfdabb4d Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Mon, 27 Jan 2025 22:18:33 -0500 Subject: [PATCH 09/18] Updating dependent universal property, etc. --- source/UF/Pushouts.lagda | 126 +++++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index a6780feac..09dad97c5 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -184,10 +184,10 @@ the pullback property of pushouts which we wish to avoid exploring for now.* \begin{code} canonical-map-to-cocone - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (X : ๐“ฃ ฬ‡) โ†’ (S โ†’ X) โ†’ cocone f g X -canonical-map-to-cocone S X f g (i , j , G) u = +canonical-map-to-cocone S f g (i , j , G) X u = (u โˆ˜ i , u โˆ˜ j , โˆผ-ap-โˆ˜ u G) Pushout-Universal-Property @@ -195,39 +195,39 @@ Pushout-Universal-Property (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ Pushout-Universal-Property S X f g s - = is-equiv (canonical-map-to-cocone S X f g s) + = is-equiv (canonical-map-to-cocone S f g s X) dependent-canonical-map-to-cocone - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) โ†’ ((x : S) โ†’ P x) โ†’ dependent-cocone f g S s P -dependent-canonical-map-to-cocone S P f g (i , j , G) d = +dependent-canonical-map-to-cocone S f g (i , j , G) P d = (d โˆ˜ i , d โˆ˜ j , ฮป c โ†’ apd d (G c)) Pushout-Dependent-Universal-Property - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ -Pushout-Dependent-Universal-Property S P f g s = - is-equiv (dependent-canonical-map-to-cocone S P f g s) +Pushout-Dependent-Universal-Property S f g s P = + is-equiv (dependent-canonical-map-to-cocone S f g s P) Pushout-Induction-Principle - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ -Pushout-Induction-Principle {_} {_} {_} {_} {_} {A} {B} {C} S P f g (i , j , G) +Pushout-Induction-Principle {_} {_} {_} {_} {_} {A} {B} {C} S f g (i , j , G) P = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ ((c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) โ†’ (x : S) โ†’ P x Pushout-Computation-Ruleโ‚ - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - โ†’ Pushout-Induction-Principle S P f g s + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) + โ†’ Pushout-Induction-Principle S f g s P โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ Pushout-Computation-Ruleโ‚ - {_} {_} {_} {_} {_} {A} {B} {C} S P f g (i , j , G) S-ind + {_} {_} {_} {_} {_} {A} {B} {C} S f g (i , j , G) P S-ind = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) @@ -235,12 +235,12 @@ Pushout-Computation-Ruleโ‚ โ†’ S-ind l r H (i a) ๏ผ l a Pushout-Computation-Ruleโ‚‚ - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - โ†’ Pushout-Induction-Principle S P f g s + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) + โ†’ Pushout-Induction-Principle S f g s P โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ Pushout-Computation-Ruleโ‚‚ - {_} {_} {_} {_} {_} {A} {B} {C} S P f g (i , j , G) S-ind + {_} {_} {_} {_} {_} {A} {B} {C} S f g (i , j , G) P S-ind = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) @@ -248,14 +248,14 @@ Pushout-Computation-Ruleโ‚‚ โ†’ S-ind l r H (j b) ๏ผ r b Pushout-Computation-Ruleโ‚ƒ - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - (S-ind : Pushout-Induction-Principle S P f g s) - โ†’ Pushout-Computation-Ruleโ‚ S P f g s S-ind - โ†’ Pushout-Computation-Ruleโ‚‚ S P f g s S-ind + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) + (S-ind : Pushout-Induction-Principle S f g s P) + โ†’ Pushout-Computation-Ruleโ‚ S f g s P S-ind + โ†’ Pushout-Computation-Ruleโ‚‚ S f g s P S-ind โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ Pushout-Computation-Ruleโ‚ƒ - {_} {_} {_} {_} {_}{A} {B} {C} S P f g (i , j , G) S-ind S-compโ‚ S-compโ‚‚ + {_} {_} {_} {_} {_}{A} {B} {C} S f g (i , j , G) P S-ind S-compโ‚ S-compโ‚‚ = (l : (a : A) โ†’ P (i a)) โ†’ (r : (b : B) โ†’ P (j b)) โ†’ (H : (c : C) โ†’ transport P (G c) (l (f c)) ๏ผ r (g c)) @@ -264,20 +264,21 @@ Pushout-Computation-Ruleโ‚ƒ ๏ผ ap (transport P (G c)) (S-compโ‚ l r H (f c)) โˆ™ H c Pushout-Dependent-Universal-Property-implies-Induction - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - โ†’ Pushout-Dependent-Universal-Property S P f g s - โ†’ Pushout-Induction-Principle S P f g s + โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Dependent-Universal-Property S f g s P) + โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Induction-Principle S f g s P) Pushout-Dependent-Universal-Property-implies-Induction = {!!} Pushout-Induction-and-Computation-implies-Universal-Property - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) (P : S โ†’ ๐“ฃ ฬ‡) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - (S-ind : Pushout-Induction-Principle S P f g s) - (S-compโ‚ : Pushout-Computation-Ruleโ‚ S P f g s S-ind) - (S-compโ‚‚ : Pushout-Computation-Ruleโ‚‚ S P f g s S-ind) - โ†’ Pushout-Computation-Ruleโ‚ƒ S P f g s S-ind S-compโ‚ S-compโ‚‚ - โ†’ Pushout-Universal-Property S X f g s + (S-ind : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Induction-Principle S f g s P) + (S-compโ‚ : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚ S f g s P (S-ind P)) + (S-compโ‚‚ : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚‚ S f g s P (S-ind P)) + โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) + โ†’ Pushout-Computation-Ruleโ‚ƒ S f g s P (S-ind P) (S-compโ‚ P) (S-compโ‚‚ P)) + โ†’ ((X : ๐“ฃ ฬ‡) โ†’ Pushout-Universal-Property S X f g s) Pushout-Induction-and-Computation-implies-Universal-Property = {!!} \end{code} @@ -288,10 +289,29 @@ and the induction principle along with propositional computation rules. Commenting out the fleshed out induction principle to test the named version given above -(l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (x : pushout) โ†’ P x + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ P x + + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pushout-induction l r G (inll a) ๏ผ l a + + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pushout-induction l r G (inrr b) ๏ผ r b + + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ apd (pushout-induction l r G) (glue c) โˆ™ pushout-ind-comp-r l r G (g c) + ๏ผ ap (transport P (glue c)) (pushout-ind-comp-l l r G (f c)) โˆ™ G c \begin{code} @@ -304,29 +324,19 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) glue : (c : C) โ†’ inll (f c) ๏ผ inrr (g c) pushout-induction : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Induction-Principle pushout P f g (inll , inrr , glue) + โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P pushout-ind-comp-l : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (a : A) - โ†’ pushout-induction l r G (inll a) ๏ผ l a + โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P + pushout-induction pushout-ind-comp-r : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (b : B) - โ†’ pushout-induction l r G (inrr b) ๏ผ r b + โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P + pushout-induction pushout-ind-comp-G : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (c : C) - โ†’ apd (pushout-induction l r G) (glue c) โˆ™ pushout-ind-comp-r l r G (g c) - ๏ผ ap (transport P (glue c)) (pushout-ind-comp-l l r G (f c)) โˆ™ G c + โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P + pushout-induction pushout-ind-comp-l pushout-ind-comp-r \end{code} From 9281a21551761d6a3b4c2f280148ec43536ceec9 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Tue, 28 Jan 2025 12:17:19 -0500 Subject: [PATCH 10/18] Updating statement of universal property --- source/UF/Pushouts.lagda | 96 +++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 09dad97c5..2c5def3aa 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -17,6 +17,7 @@ open import UF.Base open import UF.Equiv open import UF.EquivalenceExamples open import UF.PropIndexedPiSigma +open import UF.Retracts open import UF.Subsingletons open import UF.Yoneda @@ -181,6 +182,9 @@ We will not show (3) Is shown in the Agda Unimath library (*link*). It involves something called the pullback property of pushouts which we wish to avoid exploring for now.* +In general, we know that the universal property of (higher) inductive types is +equivalent to the induction principle with propositional computation rules. + \begin{code} canonical-map-to-cocone @@ -191,17 +195,17 @@ canonical-map-to-cocone S f g (i , j , G) X u = (u โˆ˜ i , u โˆ˜ j , โˆผ-ap-โˆ˜ u G) Pushout-Universal-Property - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (X : ๐“ฃ ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (X : ๐“ฃ ฬ‡) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ -Pushout-Universal-Property S X f g s +Pushout-Universal-Property S f g s X = is-equiv (canonical-map-to-cocone S f g s X) -dependent-canonical-map-to-cocone +canonical-map-to-dependent-cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) โ†’ ((x : S) โ†’ P x) โ†’ dependent-cocone f g S s P -dependent-canonical-map-to-cocone S f g (i , j , G) P d = +canonical-map-to-dependent-cocone S f g (i , j , G) P d = (d โˆ˜ i , d โˆ˜ j , ฮป c โ†’ apd d (G c)) Pushout-Dependent-Universal-Property @@ -209,7 +213,7 @@ Pushout-Dependent-Universal-Property (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) (P : S โ†’ ๐“ฃ ฬ‡) โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ค' โŠ” ๐“ฃ ฬ‡ Pushout-Dependent-Universal-Property S f g s P = - is-equiv (dependent-canonical-map-to-cocone S f g s P) + is-equiv (canonical-map-to-dependent-cocone S f g s P) Pushout-Induction-Principle : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) @@ -268,7 +272,45 @@ Pushout-Dependent-Universal-Property-implies-Induction (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Dependent-Universal-Property S f g s P) โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Induction-Principle S f g s P) -Pushout-Dependent-Universal-Property-implies-Induction = {!!} +Pushout-Dependent-Universal-Property-implies-Induction + S f g s dep-UP P l r G = inv (l , r , G) + where + inv : dependent-cocone f g S s P + โ†’ ((x : S) โ†’ P x) + inv = โŒœ (canonical-map-to-dependent-cocone S f g s P , dep-UP P) โŒโปยน + +Pushout-Dependent-Universal-Property-implies-Computation-Ruleโ‚ + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) + (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) + โ†’ (S-UP : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Dependent-Universal-Property S f g s P) + โ†’ (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚ S f g s P + (Pushout-Dependent-Universal-Property-implies-Induction S f g s S-UP P) +Pushout-Dependent-Universal-Property-implies-Computation-Ruleโ‚ + S f g (i , j , G) S-UP P l r H a = {!!} + where + H' : is-equiv (canonical-map-to-dependent-cocone S f g (i , j , G) P) + โ†’ is-section (canonical-map-to-dependent-cocone S f g (i , j , G) P) + H' = + equivs-are-sections (canonical-map-to-dependent-cocone S f g (i , j , G) P) + H'-eq : retraction-of + (canonical-map-to-dependent-cocone S f g (i , j , G) P) + (prโ‚‚ (S-UP P)) + โˆ˜ canonical-map-to-dependent-cocone S f g (i , j , G) P + โˆผ id + H'-eq = + retraction-equation (canonical-map-to-dependent-cocone S f g (i , j , G) P) + (H' (S-UP P)) + H'' : is-equiv (canonical-map-to-dependent-cocone S f g (i , j , G) P) + โ†’ has-section (canonical-map-to-dependent-cocone S f g (i , j , G) P) + H'' = + equivs-have-sections (canonical-map-to-dependent-cocone S f g (i , j , G) P) + H''-eq : canonical-map-to-dependent-cocone S f g (i , j , G) P โˆ˜ + section-of (canonical-map-to-dependent-cocone S f g (i , j , G) P) + (prโ‚ (S-UP (ฮป v โ†’ P v))) + โˆผ id + H''-eq = + section-equation (canonical-map-to-dependent-cocone S f g (i , j , G) P) + (H'' (S-UP P)) Pushout-Induction-and-Computation-implies-Universal-Property : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) @@ -278,7 +320,7 @@ Pushout-Induction-and-Computation-implies-Universal-Property (S-compโ‚‚ : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚‚ S f g s P (S-ind P)) โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚ƒ S f g s P (S-ind P) (S-compโ‚ P) (S-compโ‚‚ P)) - โ†’ ((X : ๐“ฃ ฬ‡) โ†’ Pushout-Universal-Property S X f g s) + โ†’ ((X : ๐“ฃ ฬ‡) โ†’ Pushout-Universal-Property S f g s X) Pushout-Induction-and-Computation-implies-Universal-Property = {!!} \end{code} @@ -286,33 +328,6 @@ Pushout-Induction-and-Computation-implies-Universal-Property = {!!} Now we will use a record type to give the pushout, point and path constructors, and the induction principle along with propositional computation rules. -Commenting out the fleshed out induction principle to test the named version -given above - - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (x : pushout) โ†’ P x - - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (a : A) - โ†’ pushout-induction l r G (inll a) ๏ผ l a - - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (b : B) - โ†’ pushout-induction l r G (inrr b) ๏ผ r b - - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (c : C) - โ†’ apd (pushout-induction l r G) (glue c) โˆ™ pushout-ind-comp-r l r G (g c) - ๏ผ ap (transport P (glue c)) (pushout-ind-comp-l l r G (f c)) โˆ™ G c - \begin{code} record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ @@ -435,7 +450,7 @@ universal property. โ†’ (H : (a : A) โ†’ s (inll a) ๏ผ s' (inll a)) โ†’ (H' : (b : B) โ†’ s (inrr b) ๏ผ s' (inrr b)) โ†’ (G : (c : C) - โ†’ ap s (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap s' (glue c)) + โ†’ ap s (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap s' (glue c)) โ†’ (x : pushout) โ†’ s x ๏ผ s' x pushout-uniqueness X s s' H H' G = pushout-induction H H' I @@ -455,12 +470,13 @@ universal property. IV = โˆ™assoc (ap s (glue c) โปยน) (H (f c)) (ap s' (glue c)) V = ap-left-inverse (ap s (glue c)) (G c โปยน) - pushout-universal-property : (X : ๐“ฃ ฬ‡) - โ†’ (pushout โ†’ X) โ‰ƒ cocone f g X - pushout-universal-property X = qinveq ฯ• (ฯˆ , ฯˆ-ฯ• , ฯ•-ฯˆ) + pushout-universal-property + : (X : ๐“ฃ ฬ‡) + โ†’ Pushout-Universal-Property pushout f g (inll , inrr , glue) X + pushout-universal-property X = ((ฯˆ , ฯ•-ฯˆ) , (ฯˆ , ฯˆ-ฯ•)) where ฯ• : (pushout โ†’ X) โ†’ cocone f g X - ฯ• u = (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) + ฯ• u = canonical-map-to-cocone pushout f g (inll , inrr , glue) X u ฯˆ : cocone f g X โ†’ (pushout โ†’ X) ฯˆ (l , r , G) = pushout-recursion l r G ฯˆ-ฯ• : ฯˆ โˆ˜ ฯ• โˆผ id From 2d39acda6b6fadd04ada41db0e7d5644a20ead82 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Tue, 28 Jan 2025 18:10:41 -0500 Subject: [PATCH 11/18] Dependent universal property in record type --- source/UF/Pushouts.lagda | 233 ++++++++++++++++++--------------------- 1 file changed, 110 insertions(+), 123 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 2c5def3aa..47ac4d46e 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -267,66 +267,10 @@ Pushout-Computation-Ruleโ‚ƒ โ†’ apd (S-ind l r H) (G c) โˆ™ S-compโ‚‚ l r H (g c) ๏ผ ap (transport P (G c)) (S-compโ‚ l r H (f c)) โˆ™ H c -Pushout-Dependent-Universal-Property-implies-Induction - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Dependent-Universal-Property S f g s P) - โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Induction-Principle S f g s P) -Pushout-Dependent-Universal-Property-implies-Induction - S f g s dep-UP P l r G = inv (l , r , G) - where - inv : dependent-cocone f g S s P - โ†’ ((x : S) โ†’ P x) - inv = โŒœ (canonical-map-to-dependent-cocone S f g s P , dep-UP P) โŒโปยน - -Pushout-Dependent-Universal-Property-implies-Computation-Ruleโ‚ - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - โ†’ (S-UP : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Dependent-Universal-Property S f g s P) - โ†’ (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚ S f g s P - (Pushout-Dependent-Universal-Property-implies-Induction S f g s S-UP P) -Pushout-Dependent-Universal-Property-implies-Computation-Ruleโ‚ - S f g (i , j , G) S-UP P l r H a = {!!} - where - H' : is-equiv (canonical-map-to-dependent-cocone S f g (i , j , G) P) - โ†’ is-section (canonical-map-to-dependent-cocone S f g (i , j , G) P) - H' = - equivs-are-sections (canonical-map-to-dependent-cocone S f g (i , j , G) P) - H'-eq : retraction-of - (canonical-map-to-dependent-cocone S f g (i , j , G) P) - (prโ‚‚ (S-UP P)) - โˆ˜ canonical-map-to-dependent-cocone S f g (i , j , G) P - โˆผ id - H'-eq = - retraction-equation (canonical-map-to-dependent-cocone S f g (i , j , G) P) - (H' (S-UP P)) - H'' : is-equiv (canonical-map-to-dependent-cocone S f g (i , j , G) P) - โ†’ has-section (canonical-map-to-dependent-cocone S f g (i , j , G) P) - H'' = - equivs-have-sections (canonical-map-to-dependent-cocone S f g (i , j , G) P) - H''-eq : canonical-map-to-dependent-cocone S f g (i , j , G) P โˆ˜ - section-of (canonical-map-to-dependent-cocone S f g (i , j , G) P) - (prโ‚ (S-UP (ฮป v โ†’ P v))) - โˆผ id - H''-eq = - section-equation (canonical-map-to-dependent-cocone S f g (i , j , G) P) - (H'' (S-UP P)) - -Pushout-Induction-and-Computation-implies-Universal-Property - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (S : ๐“ค' ฬ‡) - (f : C โ†’ A) (g : C โ†’ B) (s : cocone f g S) - (S-ind : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Induction-Principle S f g s P) - (S-compโ‚ : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚ S f g s P (S-ind P)) - (S-compโ‚‚ : (P : S โ†’ ๐“ฃ ฬ‡) โ†’ Pushout-Computation-Ruleโ‚‚ S f g s P (S-ind P)) - โ†’ ((P : S โ†’ ๐“ฃ ฬ‡) - โ†’ Pushout-Computation-Ruleโ‚ƒ S f g s P (S-ind P) (S-compโ‚ P) (S-compโ‚‚ P)) - โ†’ ((X : ๐“ฃ ฬ‡) โ†’ Pushout-Universal-Property S f g s X) -Pushout-Induction-and-Computation-implies-Universal-Property = {!!} - \end{code} Now we will use a record type to give the pushout, point and path constructors, -and the induction principle along with propositional computation rules. +and the dependent universal property. \begin{code} @@ -337,33 +281,76 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) inll : A โ†’ pushout inrr : B โ†’ pushout glue : (c : C) โ†’ inll (f c) ๏ผ inrr (g c) - pushout-induction + pushout-dependent-universal-property : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P - pushout-ind-comp-l - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P - pushout-induction - pushout-ind-comp-r - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P - pushout-induction - pushout-ind-comp-G - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P - pushout-induction pushout-ind-comp-l pushout-ind-comp-r + โ†’ Pushout-Dependent-Universal-Property pushout f g (inll , inrr , glue) P \end{code} -We will now observe that the pushout is a cocone and begin deriving some key -results from the induction principle: -recursion (along with corresponding computation rules), uniqueness and the -universal property. +We will observe that the pushout is a cocone and begin deriving some key +results from the dependent universal property: +induction and recursion principles (along with corresponding computation rules), the uniqueness principle and the non-dependent universal property. + +TODO. Show that the non-dependent universal property implies the dependent +universal property. This will establish the logical equivalence between + +1) The dependent universal property +2) The induction principle with propositional computation rules +3) The recursion principle with propositional computation rules and the + uniqueness principle +4) The non-dependent universal property. \begin{code} pushout-cocone : cocone f g pushout pushout-cocone = (inll , inrr , glue) + + pushout-dep-UP-inverse : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ dependent-cocone f g pushout (inll , inrr , glue) P + โ†’ ((x : pushout) โ†’ P x) + pushout-dep-UP-inverse {_} {P} + = inverse (canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P) + pushout-dependent-universal-property + + pushout-dep-UP-section + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ pushout-dep-UP-inverse + โˆ˜ canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P + โˆผ id + pushout-dep-UP-section {_} {P} + = {!!} + + pushout-dep-UP-retraction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P + โˆ˜ pushout-dep-UP-inverse + โˆผ id + pushout-dep-UP-retraction {_} {P} + = retraction-equation pushout-dep-UP-inverse + (equivs-are-sections pushout-dep-UP-inverse {!!}) + + pushout-induction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P + pushout-induction {_} {P} l r G = pushout-dep-UP-inverse (l , r , G) + + pushout-ind-comp-inll + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P + pushout-induction + pushout-ind-comp-inll l r H a = {!!} + + pushout-ind-comp-inrr + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P + pushout-induction + pushout-ind-comp-inrr l r H b = {!!} + + pushout-ind-comp-glue + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P + pushout-induction pushout-ind-comp-inll pushout-ind-comp-inrr + pushout-ind-comp-glue l r H c = {!!} pushout-recursion : {D : ๐“ฃ ฬ‡} โ†’ (l : A โ†’ D) @@ -373,75 +360,76 @@ universal property. pushout-recursion l r G = pushout-induction l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) - pushout-rec-comp-l : {D : ๐“ฃ ฬ‡} - โ†’ (l : A โ†’ D) - โ†’ (r : B โ†’ D) - โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) - โ†’ (a : A) - โ†’ pushout-recursion l r G (inll a) ๏ผ l a - pushout-rec-comp-l l r G = - pushout-ind-comp-l l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) - - pushout-rec-comp-r : {D : ๐“ฃ ฬ‡} - โ†’ (l : A โ†’ D) - โ†’ (r : B โ†’ D) - โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) - โ†’ (b : B) - โ†’ pushout-recursion l r G (inrr b) ๏ผ r b - pushout-rec-comp-r l r G = - pushout-ind-comp-r l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) - - pushout-rec-comp-G + pushout-rec-comp-inll : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pushout-recursion l r G (inll a) ๏ผ l a + pushout-rec-comp-inll l r G = + pushout-ind-comp-inll l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) + + pushout-rec-comp-inrr : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pushout-recursion l r G (inrr b) ๏ผ r b + pushout-rec-comp-inrr l r G = + pushout-ind-comp-inrr l r (ฮป c โ†’ (transport-const (glue c) โˆ™ G c)) + + pushout-rec-comp-glue : {D : ๐“ฃ ฬ‡} โ†’ (l : A โ†’ D) โ†’ (r : B โ†’ D) โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) โ†’ (c : C) - โ†’ ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) - ๏ผ pushout-rec-comp-l l r G (f c) โˆ™ G c - pushout-rec-comp-G {๐“ฃ} {D} l r G c = - ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ III โŸฉ + โ†’ ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-inrr l r G (g c) + ๏ผ pushout-rec-comp-inll l r G (f c) โˆ™ G c + pushout-rec-comp-glue {๐“ฃ} {D} l r G c = + ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-inrr l r G (g c) ๏ผโŸจ III โŸฉ transport-const (glue c) โปยน โˆ™ apd (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c) ๏ผโŸจ V โŸฉ + โˆ™ pushout-rec-comp-inrr l r G (g c) ๏ผโŸจ V โŸฉ transport-const (glue c) โปยน - โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-inll l r G (f c)) โˆ™ (transport-const (glue c) โˆ™ G c) ๏ผโŸจ VI โŸฉ transport-const (glue c) โปยน - โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-inll l r G (f c)) โˆ™ transport-const (glue c) โˆ™ G c ๏ผโŸจ IX โŸฉ - pushout-rec-comp-l l r G (f c) โˆ™ G c โˆŽ + pushout-rec-comp-inll l r G (f c) โˆ™ G c โˆŽ where II : ap (pushout-recursion l r G) (glue c) ๏ผ transport-const (glue c) โปยน โˆ™ apd (pushout-induction l r (ฮป - โ†’ (transport-const (glue -) โˆ™ G -))) (glue c) II = apd-from-ap (pushout-recursion l r G) (glue c) - III = ap (_โˆ™ pushout-rec-comp-r l r G (g c)) II - IV : apd (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-r l r G (g c) - ๏ผ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + III = ap (_โˆ™ pushout-rec-comp-inrr l r G (g c)) II + IV : apd (pushout-recursion l r G) (glue c) + โˆ™ pushout-rec-comp-inrr l r G (g c) + ๏ผ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-inll l r G (f c)) โˆ™ (transport-const (glue c) โˆ™ G c) - IV = pushout-ind-comp-G l r (ฮป - โ†’ (transport-const (glue -) โˆ™ G -)) c + IV = pushout-ind-comp-glue l r (ฮป - โ†’ (transport-const (glue -) โˆ™ G -)) c V : transport-const (glue c) โปยน โˆ™ apd (pushout-recursion l r G) (glue c) - โˆ™ pushout-rec-comp-r l r G (g c) + โˆ™ pushout-rec-comp-inrr l r G (g c) ๏ผ transport-const (glue c) โปยน - โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-inll l r G (f c)) โˆ™ (transport-const (glue c) โˆ™ G c) V = ap-on-left-is-assoc (transport-const (glue c) โปยน) IV VI = โˆ™assoc (transport-const (glue c) โปยน โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) - (pushout-rec-comp-l l r G (f c))) (transport-const (glue c)) + (pushout-rec-comp-inll l r G (f c))) (transport-const (glue c)) (G c) โปยน - VII : ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + VII : ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-inll l r G (f c)) โˆ™ transport-const (glue c) - ๏ผ transport-const (glue c) โˆ™ pushout-rec-comp-l l r G (f c) + ๏ผ transport-const (glue c) โˆ™ pushout-rec-comp-inll l r G (f c) VII = homotopies-are-natural (transport (ฮป - โ†’ D) (glue c)) id (ฮป - โ†’ transport-const (glue c)) โปยน VIII : transport-const (glue c) โปยน - โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-l l r G (f c)) + โˆ™ ap (transport (ฮป - โ†’ D) (glue c)) (pushout-rec-comp-inll l r G (f c)) โˆ™ transport-const (glue c) - ๏ผ pushout-rec-comp-l l r G (f c) + ๏ผ pushout-rec-comp-inll l r G (f c) VIII = โˆ™assoc (transport-const (glue c) โปยน) (ap (transport (ฮป - โ†’ D) (glue c)) - (pushout-rec-comp-l l r G (f c))) (transport-const (glue c)) + (pushout-rec-comp-inll l r G (f c))) (transport-const (glue c)) โˆ™ ap-left-inverse (transport-const (glue c)) VII IX = ap (_โˆ™ G c) VIII @@ -462,10 +450,9 @@ universal property. H' (g c) โˆŽ where II = transport-after-ap' (glue c) s s' (H (f c)) - III = - ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผโŸจ IV โŸฉ - ap s (glue c) โปยน โˆ™ (H (f c) โˆ™ ap s' (glue c)) ๏ผโŸจ V โŸฉ - H' (g c) โˆŽ + III = ap s (glue c) โปยน โˆ™ H (f c) โˆ™ ap s' (glue c) ๏ผโŸจ IV โŸฉ + ap s (glue c) โปยน โˆ™ (H (f c) โˆ™ ap s' (glue c)) ๏ผโŸจ V โŸฉ + H' (g c) โˆŽ where IV = โˆ™assoc (ap s (glue c) โปยน) (H (f c)) (ap s' (glue c)) V = ap-left-inverse (ap s (glue c)) (G c โปยน) @@ -481,13 +468,13 @@ universal property. ฯˆ (l , r , G) = pushout-recursion l r G ฯˆ-ฯ• : ฯˆ โˆ˜ ฯ• โˆผ id ฯˆ-ฯ• u = dfunext fe (pushout-uniqueness X ((ฯˆ โˆ˜ ฯ•) u) u - (pushout-rec-comp-l (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - (pushout-rec-comp-r (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) - (pushout-rec-comp-G (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue))) + (pushout-rec-comp-inll (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + (pushout-rec-comp-inrr (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue)) + (pushout-rec-comp-glue (u โˆ˜ inll) (u โˆ˜ inrr) (โˆผ-ap-โˆ˜ u glue))) ฯ•-ฯˆ : ฯ• โˆ˜ ฯˆ โˆผ id ฯ•-ฯˆ (l , r , G) = inverse-cocone-map f g X ((ฯ• โˆ˜ ฯˆ) (l , r , G)) (l , r , G) - (pushout-rec-comp-l l r G , pushout-rec-comp-r l r G , - โˆผ-sym (pushout-rec-comp-G l r G)) + (pushout-rec-comp-inll l r G , pushout-rec-comp-inrr l r G , + โˆผ-sym (pushout-rec-comp-glue l r G)) \end{code} From af9c2fb84f5e46845c878c177f9e628d980cfae2 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Wed, 29 Jan 2025 12:31:25 -0500 Subject: [PATCH 12/18] Deriving induction and computation rules; first steps --- source/UF/Pushouts.lagda | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 47ac4d46e..4fd233cf0 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -150,6 +150,8 @@ inverse-cocone-map f g X u u' = We also introduce the notion of a dependent cocone. +TODO. Characterize the identity type of dependent cocones. + \begin{code} dependent-cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} @@ -171,19 +173,22 @@ propositional computation rules for pushouts and show they are inter-derivable*. propositional computation rules. (2) - The induction principle and propositional computationrules implies the - (non-dependeny) universal property. + The induction principle and propositional computation rules implies the + the recursion principle with corresponding computation rules and the uniqueness + principle. -We will not show (3) + The recursion principle with corresponding computation rules and the uniqueness + principle implies the non-dependent universal property. + +(4) The (non-dependent) universal property implies the dependent universal property. -(3) Is shown in the Agda Unimath library (*link*). It involves something called -the pullback property of pushouts which we wish to avoid exploring for now.* - -In general, we know that the universal property of (higher) inductive types is -equivalent to the induction principle with propositional computation rules. +(4) Is shown in the Agda Unimath library (*link*). It involves something called +the pullback property of pushouts which we wish to avoid exploring for now. +Alternativly, we can show the converse of (3), (2) and (1) which would provide a +proof of (4).* \begin{code} @@ -318,7 +323,9 @@ universal property. This will establish the logical equivalence between โˆ˜ canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P โˆผ id pushout-dep-UP-section {_} {P} - = {!!} + = inverses-are-retractions + (canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P) + pushout-dependent-universal-property pushout-dep-UP-retraction : {P : pushout โ†’ ๐“ฃ ฬ‡} @@ -326,24 +333,23 @@ universal property. This will establish the logical equivalence between โˆ˜ pushout-dep-UP-inverse โˆผ id pushout-dep-UP-retraction {_} {P} - = retraction-equation pushout-dep-UP-inverse - (equivs-are-sections pushout-dep-UP-inverse {!!}) + = inverses-are-sections + (canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P) + pushout-dependent-universal-property pushout-induction : {P : pushout โ†’ ๐“ฃ ฬ‡} โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P - pushout-induction {_} {P} l r G = pushout-dep-UP-inverse (l , r , G) + pushout-induction {_} {P} l r H = pushout-dep-UP-inverse (l , r , H) pushout-ind-comp-inll : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P - pushout-induction - pushout-ind-comp-inll l r H a = {!!} + โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P pushout-induction + pushout-ind-comp-inll {_} {P} l r H a = {!!} pushout-ind-comp-inrr : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P - pushout-induction + โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P pushout-induction pushout-ind-comp-inrr l r H b = {!!} pushout-ind-comp-glue From 16acc8e8d803b6e0880f6b41c3a1e77c39e08d30 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Fri, 31 Jan 2025 12:26:59 -0500 Subject: [PATCH 13/18] Deriving everything from universal property --- source/UF/Pushouts.lagda | 267 +++++++++++++++++++++++++++------------ 1 file changed, 189 insertions(+), 78 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 4fd233cf0..927af493b 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -164,31 +164,18 @@ dependent-cocone {_} {_} {_} {_} {_} {A} {B} {C} f g X (i , j , H) P = \end{code} -Now we will define the (dependent) universal property, induction principle and -propositional computation rules for pushouts and show they are inter-derivable*. +Now we will define the universal property, induction principle and propositional +computation rules for pushouts and show they are inter-derivable. -*In fact we will only show: -(1) - The dependent universal propery implies the induction principle and - propositional computation rules. - -(2) - The induction principle and propositional computation rules implies the +In fact we will only show: +(1) The induction principle and propositional computation rules implies the the recursion principle with corresponding computation rules and the uniqueness principle. -(3) - The recursion principle with corresponding computation rules and the uniqueness - principle implies the non-dependent universal property. - -(4) - The (non-dependent) universal property implies the dependent universal - property. +(2) The recursion principle with corresponding computation rules and the + uniqueness principle implies the non-dependent universal property. -(4) Is shown in the Agda Unimath library (*link*). It involves something called -the pullback property of pushouts which we wish to avoid exploring for now. -Alternativly, we can show the converse of (3), (2) and (1) which would provide a -proof of (4).* +(3) The universal property implies the induction principle. \begin{code} @@ -286,77 +273,40 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) inll : A โ†’ pushout inrr : B โ†’ pushout glue : (c : C) โ†’ inll (f c) ๏ผ inrr (g c) - pushout-dependent-universal-property + pushout-induction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P + pushout-ind-comp-inll : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Dependent-Universal-Property pushout f g (inll , inrr , glue) P + โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P + pushout-induction + pushout-ind-comp-inrr + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P + pushout-induction + pushout-ind-comp-glue + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P + pushout-induction pushout-ind-comp-inll pushout-ind-comp-inrr \end{code} We will observe that the pushout is a cocone and begin deriving some key -results from the dependent universal property: -induction and recursion principles (along with corresponding computation rules), the uniqueness principle and the non-dependent universal property. +results from the induction principles: +recursion principle (along with corresponding computation rules), the uniqueness +principle and the universal property. -TODO. Show that the non-dependent universal property implies the dependent -universal property. This will establish the logical equivalence between +The following are logically equivalent -1) The dependent universal property -2) The induction principle with propositional computation rules -3) The recursion principle with propositional computation rules and the +1) The induction principle with propositional computation rules +2) The recursion principle with propositional computation rules and the uniqueness principle -4) The non-dependent universal property. +3) The universal property. \begin{code} pushout-cocone : cocone f g pushout pushout-cocone = (inll , inrr , glue) - - pushout-dep-UP-inverse : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ dependent-cocone f g pushout (inll , inrr , glue) P - โ†’ ((x : pushout) โ†’ P x) - pushout-dep-UP-inverse {_} {P} - = inverse (canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P) - pushout-dependent-universal-property - - pushout-dep-UP-section - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ pushout-dep-UP-inverse - โˆ˜ canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P - โˆผ id - pushout-dep-UP-section {_} {P} - = inverses-are-retractions - (canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P) - pushout-dependent-universal-property - - pushout-dep-UP-retraction - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P - โˆ˜ pushout-dep-UP-inverse - โˆผ id - pushout-dep-UP-retraction {_} {P} - = inverses-are-sections - (canonical-map-to-dependent-cocone pushout f g (inll , inrr , glue) P) - pushout-dependent-universal-property - - pushout-induction - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P - pushout-induction {_} {P} l r H = pushout-dep-UP-inverse (l , r , H) - - pushout-ind-comp-inll - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P pushout-induction - pushout-ind-comp-inll {_} {P} l r H a = {!!} - - pushout-ind-comp-inrr - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P pushout-induction - pushout-ind-comp-inrr l r H b = {!!} - - pushout-ind-comp-glue - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P - pushout-induction pushout-ind-comp-inll pushout-ind-comp-inrr - pushout-ind-comp-glue l r H c = {!!} pushout-recursion : {D : ๐“ฃ ฬ‡} โ†’ (l : A โ†’ D) @@ -484,3 +434,164 @@ universal property. This will establish the logical equivalence between โˆผ-sym (pushout-rec-comp-glue l r G)) \end{code} + +We investigate only postulating the (non-dependent) universal property. + +\begin{code} + +record pushouts-exist' {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ + where + field + pushout : ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ ฬ‡ + inll : A โ†’ pushout + inrr : B โ†’ pushout + glue : (c : C) โ†’ inll (f c) ๏ผ inrr (g c) + pushout-universal-property + : {X : ๐“ฃ ฬ‡} + โ†’ Pushout-Universal-Property pushout f g (inll , inrr , glue) X + + pushout-cocone : cocone f g pushout + pushout-cocone = (inll , inrr , glue) + +\end{code} + +We will unpack the equivalence established by the universal property. + +\begin{code} + + pushout-fiber-is-singleton + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ is-contr (fiber (canonical-map-to-cocone pushout f g pushout-cocone X) s) + pushout-fiber-is-singleton {_} {X} s + = equivs-are-vv-equivs (canonical-map-to-cocone pushout f g pushout-cocone X) + pushout-universal-property s + + pushout-fiber-is-singleton' + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ is-contr (ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + pushout-fiber-is-singleton' {_} {X} s + = equiv-to-singleton' (ฮฃ-cong (ฮป - โ†’ cocone-identity-characterization f g X + (- โˆ˜ inll , - โˆ˜ inrr , โˆผ-ap-โˆ˜ - glue) s)) + (pushout-fiber-is-singleton s) + + pushout-fiber-center + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s + pushout-fiber-center s = center (pushout-fiber-is-singleton' s) + + pushout-fiber-centrality + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ is-central (ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + (pushout-fiber-center s) + pushout-fiber-centrality s = centrality (pushout-fiber-is-singleton' s) + + pushout-unique-map : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s + โ†’ pushout โ†’ X + pushout-unique-map s (u , _) = u + + pushout-inll-homotopy + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + โ†’ (pushout-unique-map s z) โˆ˜ inll โˆผ cocone-vertical-map f g X s + pushout-inll-homotopy s (u , K , L , M) = K + + pushout-inrr-homotopy + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + โ†’ (pushout-unique-map s z) โˆ˜ inrr โˆผ cocone-horizontal-map f g X s + pushout-inrr-homotopy s (u , K , L , M) = L + + pushout-glue-homotopy + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + โ†’ โˆผ-trans ((pushout-inll-homotopy s z) โˆ˜ f) (cocone-commuting-square f g X s) + โˆผ โˆผ-trans (โˆผ-ap-โˆ˜ (pushout-unique-map s z) glue) + ((pushout-inrr-homotopy s z) โˆ˜ g) + pushout-glue-homotopy s (u , K , L , M) = M + +\end{code} + +Now we can derive the recursion principle, the corresponding propositional +computation rules and the uniqueness principles. + +\begin{code} + + pushout-recursion : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ ((c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ pushout โ†’ D + pushout-recursion l r G + = pushout-unique-map (l , r , G) (pushout-fiber-center (l , r , G)) + + pushout-rec-comp-inll : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pushout-recursion l r G (inll a) ๏ผ l a + pushout-rec-comp-inll l r G + = pushout-inll-homotopy (l , r , G) (pushout-fiber-center (l , r , G)) + + pushout-rec-comp-inrr : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pushout-recursion l r G (inrr b) ๏ผ r b + pushout-rec-comp-inrr l r G + = pushout-inrr-homotopy (l , r , G) (pushout-fiber-center (l , r , G)) + + pushout-rec-comp-glue + : {D : ๐“ฃ ฬ‡} + โ†’ (l : A โ†’ D) + โ†’ (r : B โ†’ D) + โ†’ (G : (c : C) โ†’ l (f c) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ ap (pushout-recursion l r G) (glue c) โˆ™ pushout-rec-comp-inrr l r G (g c) + ๏ผ pushout-rec-comp-inll l r G (f c) โˆ™ G c + pushout-rec-comp-glue l r G c + = pushout-glue-homotopy (l , r , G) (pushout-fiber-center (l , r , G)) c โปยน + + pushout-uniqueness : (X : ๐“ฃ ฬ‡) + โ†’ (u u' : pushout โ†’ X) + โ†’ (H : (a : A) โ†’ u (inll a) ๏ผ u' (inll a)) + โ†’ (H' : (b : B) โ†’ u (inrr b) ๏ผ u' (inrr b)) + โ†’ (M : (c : C) + โ†’ ap u (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap u' (glue c)) + โ†’ (x : pushout) โ†’ u x ๏ผ u' x + pushout-uniqueness X u u' H H' M + = happly (prโ‚ (from-ฮฃ-๏ผ (singletons-are-props + (pushout-fiber-is-singleton' (u' โˆ˜ inll , u' โˆ˜ inrr , โˆผ-ap-โˆ˜ u' glue)) + (u , H , H' , ฮป c โ†’ M c โปยน) + (u' , โˆผ-refl , โˆผ-refl , ฮป c โ†’ refl-left-neutral)))) + +\end{code} + +Finally, we can derive the induction principle and the corresponding propositional +computation rules(?). + +\begin{code} + + pushout-induction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P + pushout-induction = {!!} + +\end{code} From 138bff79610fc75aed90937c19fbb4bf05b4b21c Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sat, 1 Feb 2025 18:07:22 -0500 Subject: [PATCH 14/18] Deriving induction from recursion and uniqueness --- source/UF/Pushouts.lagda | 138 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 130 insertions(+), 8 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 927af493b..ab32b59d3 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -264,7 +264,7 @@ Pushout-Computation-Ruleโ‚ƒ Now we will use a record type to give the pushout, point and path constructors, and the dependent universal property. -\begin{code} +begin{code} record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ where @@ -289,7 +289,7 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P pushout-induction pushout-ind-comp-inll pushout-ind-comp-inrr -\end{code} +end{code} We will observe that the pushout is a cocone and begin deriving some key results from the induction principles: @@ -303,7 +303,7 @@ The following are logically equivalent uniqueness principle 3) The universal property. -\begin{code} +begin{code} pushout-cocone : cocone f g pushout pushout-cocone = (inll , inrr , glue) @@ -433,7 +433,7 @@ The following are logically equivalent (pushout-rec-comp-inll l r G , pushout-rec-comp-inrr l r G , โˆผ-sym (pushout-rec-comp-glue l r G)) -\end{code} +end{code} We investigate only postulating the (non-dependent) universal property. @@ -569,14 +569,14 @@ computation rules and the uniqueness principles. pushout-rec-comp-glue l r G c = pushout-glue-homotopy (l , r , G) (pushout-fiber-center (l , r , G)) c โปยน - pushout-uniqueness : (X : ๐“ฃ ฬ‡) + pushout-uniqueness : {X : ๐“ฃ ฬ‡} โ†’ (u u' : pushout โ†’ X) โ†’ (H : (a : A) โ†’ u (inll a) ๏ผ u' (inll a)) โ†’ (H' : (b : B) โ†’ u (inrr b) ๏ผ u' (inrr b)) โ†’ (M : (c : C) โ†’ ap u (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap u' (glue c)) โ†’ (x : pushout) โ†’ u x ๏ผ u' x - pushout-uniqueness X u u' H H' M + pushout-uniqueness {_} {X} u u' H H' M = happly (prโ‚ (from-ฮฃ-๏ผ (singletons-are-props (pushout-fiber-is-singleton' (u' โˆ˜ inll , u' โˆ˜ inrr , โˆผ-ap-โˆ˜ u' glue)) (u , H , H' , ฮป c โ†’ M c โปยน) @@ -585,13 +585,135 @@ computation rules and the uniqueness principles. \end{code} Finally, we can derive the induction principle and the corresponding propositional -computation rules(?). +computation rules(?). First we will introduce an auxillary type which I am going +to call pre-induction. \begin{code} + pre-induction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ pushout โ†’ ฮฃ x ๊ž‰ pushout , P x + pre-induction {_} {P} l r G = pushout-recursion l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-comp-inll + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pre-induction l r G (inll a) ๏ผ (inll a , l a) + pre-induction-comp-inll {_} {P} l r G = pushout-rec-comp-inll l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-comp-inrr + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pre-induction l r G (inrr b) ๏ผ (inrr b , r b) + pre-induction-comp-inrr {_} {P} l r G = pushout-rec-comp-inrr l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-comp-glue + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ ap (pre-induction l r G) (glue c) โˆ™ pre-induction-comp-inrr l r G (g c) + ๏ผ pre-induction-comp-inll l r G (f c) โˆ™ to-ฮฃ-๏ผ (glue c , G c) + pre-induction-comp-glue {_} {P} l r G = pushout-rec-comp-glue l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-id + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ pushout โ†’ pushout + pre-induction-id l r G = prโ‚ โˆ˜ pre-induction l r G + + pre-induction-id-is-id + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ pre-induction-id l r G x ๏ผ x + pre-induction-id-is-id {_} {P} l r G + = pushout-uniqueness (pre-induction-id l r G) id + (ฮป a โ†’ ap prโ‚ (pre-induction-comp-inll l r G a)) + (ฮป b โ†’ ap prโ‚ (pre-induction-comp-inrr l r G b)) + I + where + I : (c : C) + โ†’ ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™ ap id (glue c) + I c = ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ II โŸฉ + ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ III โŸฉ + ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ IV โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ V โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ VII โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap id (glue c) โˆŽ + where + II = ap (_โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c))) + (ap-ap (pre-induction l r G) prโ‚ (glue c) โปยน) + III = ap-โˆ™ prโ‚ (ap (pre-induction l r G) (glue c)) + (pre-induction-comp-inrr l r G (g c)) โปยน + IV = ap (ap prโ‚) (pre-induction-comp-glue l r G c) + V = ap-โˆ™ prโ‚ (pre-induction-comp-inll l r G (f c)) (to-ฮฃ-๏ผ (glue c , G c)) + VI = ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ ap-prโ‚-to-ฮฃ-๏ผ (glue c , G c) โŸฉ + glue c ๏ผโŸจ ap-id-is-id' (glue c) โŸฉ + ap id (glue c) โˆŽ + VII = ap (ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™_) VI + + pre-induction-family + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ P (pre-induction-id l r G x) + pre-induction-family l r G = prโ‚‚ โˆ˜ pre-induction l r G + pushout-induction : {P : pushout โ†’ ๐“ฃ ฬ‡} โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P - pushout-induction = {!!} + pushout-induction {_} {P} l r G x + = transport P (pre-induction-id-is-id l r G x) (pre-induction-family l r G x) \end{code} From c5e592616e1a257a1dc30bb1c5d502aac5a56096 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sun, 2 Feb 2025 18:16:39 -0500 Subject: [PATCH 15/18] update --- source/UF/Pushouts.lagda | 47 ++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index ab32b59d3..fb283e741 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -471,7 +471,7 @@ We will unpack the equivalence established by the universal property. : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ is-contr (ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) pushout-fiber-is-singleton' {_} {X} s = equiv-to-singleton' (ฮฃ-cong (ฮป - โ†’ cocone-identity-characterization f g X (- โˆ˜ inll , - โˆ˜ inrr , โˆผ-ap-โˆ˜ - glue) s)) @@ -481,21 +481,21 @@ We will unpack the equivalence established by the universal property. : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s pushout-fiber-center s = center (pushout-fiber-is-singleton' s) pushout-fiber-centrality : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ is-central (ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) (pushout-fiber-center s) pushout-fiber-centrality s = centrality (pushout-fiber-is-singleton' s) pushout-unique-map : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s โ†’ pushout โ†’ X pushout-unique-map s (u , _) = u @@ -503,7 +503,7 @@ We will unpack the equivalence established by the universal property. : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) โ†’ (pushout-unique-map s z) โˆ˜ inll โˆผ cocone-vertical-map f g X s pushout-inll-homotopy s (u , K , L , M) = K @@ -511,7 +511,7 @@ We will unpack the equivalence established by the universal property. : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) โ†’ (pushout-unique-map s z) โˆ˜ inrr โˆผ cocone-horizontal-map f g X s pushout-inrr-homotopy s (u , K , L , M) = L @@ -519,7 +519,7 @@ We will unpack the equivalence established by the universal property. : {X : ๐“ฃ ฬ‡} โ†’ (s : cocone f g X) โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) โ†’ โˆผ-trans ((pushout-inll-homotopy s z) โˆ˜ f) (cocone-commuting-square f g X s) โˆผ โˆผ-trans (โˆผ-ap-โˆ˜ (pushout-unique-map s z) glue) ((pushout-inrr-homotopy s z) โˆ˜ g) @@ -574,7 +574,7 @@ computation rules and the uniqueness principles. โ†’ (H : (a : A) โ†’ u (inll a) ๏ผ u' (inll a)) โ†’ (H' : (b : B) โ†’ u (inrr b) ๏ผ u' (inrr b)) โ†’ (M : (c : C) - โ†’ ap u (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap u' (glue c)) + โ†’ ap u (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap u' (glue c)) โ†’ (x : pushout) โ†’ u x ๏ผ u' x pushout-uniqueness {_} {X} u u' H H' M = happly (prโ‚ (from-ฮฃ-๏ผ (singletons-are-props @@ -585,8 +585,8 @@ computation rules and the uniqueness principles. \end{code} Finally, we can derive the induction principle and the corresponding propositional -computation rules(?). First we will introduce an auxillary type which I am going -to call pre-induction. +computation rules(?). First we will introduce an auxillary type which we will +call pre-induction. \begin{code} @@ -671,8 +671,8 @@ to call pre-induction. pre-induction-id-is-id {_} {P} l r G = pushout-uniqueness (pre-induction-id l r G) id (ฮป a โ†’ ap prโ‚ (pre-induction-comp-inll l r G a)) - (ฮป b โ†’ ap prโ‚ (pre-induction-comp-inrr l r G b)) - I + (ฮป b โ†’ ap prโ‚ (pre-induction-comp-inrr l r G b)) + I where I : (c : C) โ†’ ap (pre-induction-id l r G) (glue c) @@ -710,10 +710,33 @@ to call pre-induction. โ†’ (x : pushout) โ†’ P (pre-induction-id l r G x) pre-induction-family l r G = prโ‚‚ โˆ˜ pre-induction l r G +\end{code} + +Now we can define the induction principle and computation rules. + +\begin{code} + pushout-induction : {P : pushout โ†’ ๐“ฃ ฬ‡} โ†’ Pushout-Induction-Principle pushout f g (inll , inrr , glue) P pushout-induction {_} {P} l r G x = transport P (pre-induction-id-is-id l r G x) (pre-induction-family l r G x) + pushout-induction-comp-inll + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P pushout-induction + pushout-induction-comp-inll l r H a + = {!pushout-induction l r H (inll a) ๏ผโŸจ ? โŸฉ ?!} + + pushout-induction-comp-inrr + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚‚ pushout f g (inll , inrr , glue) P pushout-induction + pushout-induction-comp-inrr l r H b = {!!} + + pushout-induction-comp-glue + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P pushout-induction + pushout-induction-comp-inll pushout-induction-comp-inrr + pushout-induction-comp-glue = {!!} + \end{code} From 9f734620ab06a1fb4c651d952ff9e509d202aa42 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Mon, 3 Feb 2025 11:27:58 -0500 Subject: [PATCH 16/18] update induction computation rules --- source/UF/Pushouts.lagda | 407 +++++++++++++++++++++------------------ 1 file changed, 224 insertions(+), 183 deletions(-) diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index fb283e741..6677de151 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -459,71 +459,72 @@ We will unpack the equivalence established by the universal property. \begin{code} - pushout-fiber-is-singleton - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ is-contr (fiber (canonical-map-to-cocone pushout f g pushout-cocone X) s) - pushout-fiber-is-singleton {_} {X} s - = equivs-are-vv-equivs (canonical-map-to-cocone pushout f g pushout-cocone X) - pushout-universal-property s - - pushout-fiber-is-singleton' - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ is-contr (ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) - pushout-fiber-is-singleton' {_} {X} s - = equiv-to-singleton' (ฮฃ-cong (ฮป - โ†’ cocone-identity-characterization f g X - (- โˆ˜ inll , - โˆ˜ inrr , โˆผ-ap-โˆ˜ - glue) s)) - (pushout-fiber-is-singleton s) - - pushout-fiber-center - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , + opaque + pushout-fiber-is-singleton + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ is-contr (fiber (canonical-map-to-cocone pushout f g pushout-cocone X) s) + pushout-fiber-is-singleton {_} {X} s + = equivs-are-vv-equivs (canonical-map-to-cocone pushout f g pushout-cocone X) + pushout-universal-property s + + pushout-fiber-is-singleton' + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ is-contr (ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + pushout-fiber-is-singleton' {_} {X} s + = equiv-to-singleton' (ฮฃ-cong (ฮป - โ†’ cocone-identity-characterization f g X + (- โˆ˜ inll , - โˆ˜ inrr , โˆผ-ap-โˆ˜ - glue) s)) + (pushout-fiber-is-singleton s) + + pushout-fiber-center + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s - pushout-fiber-center s = center (pushout-fiber-is-singleton' s) - - pushout-fiber-centrality - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ is-central (ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) - (pushout-fiber-center s) - pushout-fiber-centrality s = centrality (pushout-fiber-is-singleton' s) - - pushout-unique-map : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s - โ†’ pushout โ†’ X - pushout-unique-map s (u , _) = u - - pushout-inll-homotopy - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) - โ†’ (pushout-unique-map s z) โˆ˜ inll โˆผ cocone-vertical-map f g X s - pushout-inll-homotopy s (u , K , L , M) = K - - pushout-inrr-homotopy - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) - โ†’ (pushout-unique-map s z) โˆ˜ inrr โˆผ cocone-horizontal-map f g X s - pushout-inrr-homotopy s (u , K , L , M) = L - - pushout-glue-homotopy - : {X : ๐“ฃ ฬ‡} - โ†’ (s : cocone f g X) - โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , - cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) - โ†’ โˆผ-trans ((pushout-inll-homotopy s z) โˆ˜ f) (cocone-commuting-square f g X s) - โˆผ โˆผ-trans (โˆผ-ap-โˆ˜ (pushout-unique-map s z) glue) - ((pushout-inrr-homotopy s z) โˆ˜ g) - pushout-glue-homotopy s (u , K , L , M) = M + pushout-fiber-center s = center (pushout-fiber-is-singleton' s) + + pushout-fiber-centrality + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ is-central (ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + (pushout-fiber-center s) + pushout-fiber-centrality s = centrality (pushout-fiber-is-singleton' s) + + pushout-unique-map : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s + โ†’ pushout โ†’ X + pushout-unique-map s (u , _) = u + + pushout-inll-homotopy + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + โ†’ (pushout-unique-map s z) โˆ˜ inll โˆผ cocone-vertical-map f g X s + pushout-inll-homotopy s (u , K , L , M) = K + + pushout-inrr-homotopy + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + โ†’ (pushout-unique-map s z) โˆ˜ inrr โˆผ cocone-horizontal-map f g X s + pushout-inrr-homotopy s (u , K , L , M) = L + + pushout-glue-homotopy + : {X : ๐“ฃ ฬ‡} + โ†’ (s : cocone f g X) + โ†’ (z : ฮฃ u ๊ž‰ (pushout โ†’ X) , + cocone-family f g X (u โˆ˜ inll , u โˆ˜ inrr , โˆผ-ap-โˆ˜ u glue) s) + โ†’ โˆผ-trans ((pushout-inll-homotopy s z) โˆ˜ f) (cocone-commuting-square f g X s) + โˆผ โˆผ-trans (โˆผ-ap-โˆ˜ (pushout-unique-map s z) glue) + ((pushout-inrr-homotopy s z) โˆ˜ g) + pushout-glue-homotopy s (u , K , L , M) = M \end{code} @@ -590,125 +591,164 @@ call pre-induction. \begin{code} - pre-induction - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ pushout โ†’ ฮฃ x ๊ž‰ pushout , P x - pre-induction {_} {P} l r G = pushout-recursion l' r' G' - where - l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x - l' a = (inll a , l a) - r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x - r' b = (inrr b , r b) - G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) - G' c = to-ฮฃ-๏ผ (glue c , G c) - - pre-induction-comp-inll - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (a : A) - โ†’ pre-induction l r G (inll a) ๏ผ (inll a , l a) - pre-induction-comp-inll {_} {P} l r G = pushout-rec-comp-inll l' r' G' - where - l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x - l' a = (inll a , l a) - r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x - r' b = (inrr b , r b) - G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) - G' c = to-ฮฃ-๏ผ (glue c , G c) - - pre-induction-comp-inrr - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (b : B) - โ†’ pre-induction l r G (inrr b) ๏ผ (inrr b , r b) - pre-induction-comp-inrr {_} {P} l r G = pushout-rec-comp-inrr l' r' G' - where - l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x - l' a = (inll a , l a) - r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x - r' b = (inrr b , r b) - G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) - G' c = to-ฮฃ-๏ผ (glue c , G c) - - pre-induction-comp-glue - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (c : C) - โ†’ ap (pre-induction l r G) (glue c) โˆ™ pre-induction-comp-inrr l r G (g c) - ๏ผ pre-induction-comp-inll l r G (f c) โˆ™ to-ฮฃ-๏ผ (glue c , G c) - pre-induction-comp-glue {_} {P} l r G = pushout-rec-comp-glue l' r' G' - where - l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x - l' a = (inll a , l a) - r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x - r' b = (inrr b , r b) - G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) - G' c = to-ฮฃ-๏ผ (glue c , G c) - - pre-induction-id - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ pushout โ†’ pushout - pre-induction-id l r G = prโ‚ โˆ˜ pre-induction l r G + opaque + pre-induction + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ pushout โ†’ ฮฃ x ๊ž‰ pushout , P x + pre-induction {_} {P} l r G = pushout-recursion l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-comp-inll + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ pre-induction l r G (inll a) ๏ผ (inll a , l a) + pre-induction-comp-inll {_} {P} l r G = pushout-rec-comp-inll l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-comp-inrr + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (b : B) + โ†’ pre-induction l r G (inrr b) ๏ผ (inrr b , r b) + pre-induction-comp-inrr {_} {P} l r G = pushout-rec-comp-inrr l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-comp-glue + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (c : C) + โ†’ ap (pre-induction l r G) (glue c) โˆ™ pre-induction-comp-inrr l r G (g c) + ๏ผ pre-induction-comp-inll l r G (f c) โˆ™ to-ฮฃ-๏ผ (glue c , G c) + pre-induction-comp-glue {_} {P} l r G = pushout-rec-comp-glue l' r' G' + where + l' : A โ†’ ฮฃ x ๊ž‰ pushout , P x + l' a = (inll a , l a) + r' : B โ†’ ฮฃ x ๊ž‰ pushout , P x + r' b = (inrr b , r b) + G' : (c : C) โ†’ l' (f c) ๏ผ r' (g c) + G' c = to-ฮฃ-๏ผ (glue c , G c) + + pre-induction-id + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ ((c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ pushout โ†’ pushout + pre-induction-id l r G = prโ‚ โˆ˜ pre-induction l r G - pre-induction-id-is-id - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (x : pushout) โ†’ pre-induction-id l r G x ๏ผ x - pre-induction-id-is-id {_} {P} l r G - = pushout-uniqueness (pre-induction-id l r G) id - (ฮป a โ†’ ap prโ‚ (pre-induction-comp-inll l r G a)) - (ฮป b โ†’ ap prโ‚ (pre-induction-comp-inrr l r G b)) - I - where - I : (c : C) - โ†’ ap (pre-induction-id l r G) (glue c) - โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) - ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™ ap id (glue c) - I c = ap (pre-induction-id l r G) (glue c) - โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ II โŸฉ - ap prโ‚ (ap (pre-induction l r G) (glue c)) - โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ III โŸฉ - ap prโ‚ (ap (pre-induction l r G) (glue c) - โˆ™ pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ IV โŸฉ - ap prโ‚ (pre-induction-comp-inll l r G (f c) - โˆ™ to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ V โŸฉ - ap prโ‚ (pre-induction-comp-inll l r G (f c)) - โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ VII โŸฉ - ap prโ‚ (pre-induction-comp-inll l r G (f c)) - โˆ™ ap id (glue c) โˆŽ - where - II = ap (_โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c))) - (ap-ap (pre-induction l r G) prโ‚ (glue c) โปยน) - III = ap-โˆ™ prโ‚ (ap (pre-induction l r G) (glue c)) - (pre-induction-comp-inrr l r G (g c)) โปยน - IV = ap (ap prโ‚) (pre-induction-comp-glue l r G c) - V = ap-โˆ™ prโ‚ (pre-induction-comp-inll l r G (f c)) (to-ฮฃ-๏ผ (glue c , G c)) - VI = ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ ap-prโ‚-to-ฮฃ-๏ผ (glue c , G c) โŸฉ - glue c ๏ผโŸจ ap-id-is-id' (glue c) โŸฉ - ap id (glue c) โˆŽ - VII = ap (ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™_) VI - - pre-induction-family - : {P : pushout โ†’ ๐“ฃ ฬ‡} - โ†’ (l : (a : A) โ†’ P (inll a)) - โ†’ (r : (b : B) โ†’ P (inrr b)) - โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) - โ†’ (x : pushout) โ†’ P (pre-induction-id l r G x) - pre-induction-family l r G = prโ‚‚ โˆ˜ pre-induction l r G + pre-induction-id-is-id + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ pre-induction-id l r G x ๏ผ x + pre-induction-id-is-id {_} {P} l r G + = pushout-uniqueness (pre-induction-id l r G) id + (ฮป a โ†’ ap prโ‚ (pre-induction-comp-inll l r G a)) + (ฮป b โ†’ ap prโ‚ (pre-induction-comp-inrr l r G b)) + I + where + I : (c : C) + โ†’ ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™ ap id (glue c) + I c = ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ II โŸฉ + ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ III โŸฉ + ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ IV โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ V โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ VII โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap id (glue c) โˆŽ + where + II : ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + II = ap (_โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c))) + (ap-ap (pre-induction l r G) prโ‚ (glue c) โปยน) + III : ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) + III = ap-โˆ™ prโ‚ (ap (pre-induction l r G) (glue c)) + (pre-induction-comp-inrr l r G (g c)) โปยน + IV : ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) + IV = ap (ap prโ‚) (pre-induction-comp-glue l r G c) + V : ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) + V = ap-โˆ™ prโ‚ (pre-induction-comp-inll l r G (f c)) (to-ฮฃ-๏ผ (glue c , G c)) + VI : ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผ ap id (glue c) + VI = ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ ap-prโ‚-to-ฮฃ-๏ผ (glue c , G c) โŸฉ + glue c ๏ผโŸจ ap-id-is-id' (glue c) โŸฉ + ap id (glue c) โˆŽ + VII : ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap id (glue c) + VII = ap (ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™_) VI + + pre-induction-family + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (x : pushout) โ†’ P (pre-induction-id l r G x) + pre-induction-family l r G = prโ‚‚ โˆ˜ pre-induction l r G + + pre-induction-family-comp-inll + : {P : pushout โ†’ ๐“ฃ ฬ‡} + โ†’ (l : (a : A) โ†’ P (inll a)) + โ†’ (r : (b : B) โ†’ P (inrr b)) + โ†’ (G : (c : C) โ†’ transport P (glue c) (l (f c)) ๏ผ r (g c)) + โ†’ (a : A) + โ†’ transport P (pre-induction-id-is-id l r G (inll a)) + (pre-induction-family l r G (inll a)) + ๏ผ l a + pre-induction-family-comp-inll l r G a + = {!!} + where + I : (a : A) + โ†’ pre-induction-id-is-id l r G (inll a) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G a) + I a = {!pushout-rec-comp-inll!} \end{code} @@ -726,7 +766,7 @@ Now we can define the induction principle and computation rules. : {P : pushout โ†’ ๐“ฃ ฬ‡} โ†’ Pushout-Computation-Ruleโ‚ pushout f g (inll , inrr , glue) P pushout-induction pushout-induction-comp-inll l r H a - = {!pushout-induction l r H (inll a) ๏ผโŸจ ? โŸฉ ?!} + = pre-induction-family-comp-inll l r H a pushout-induction-comp-inrr : {P : pushout โ†’ ๐“ฃ ฬ‡} @@ -740,3 +780,4 @@ Now we can define the induction principle and computation rules. pushout-induction-comp-glue = {!!} \end{code} + From 7273aaac562afd16b07a404d52762bb6fa60057e Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Fri, 7 Feb 2025 12:04:41 -0500 Subject: [PATCH 17/18] Splitting files --- source/UF/CoconesofSpans.lagda | 257 +++++++++++++++++++++++++++++++++ source/UF/Pushouts.lagda | 223 ++++++++++------------------ 2 files changed, 332 insertions(+), 148 deletions(-) create mode 100644 source/UF/CoconesofSpans.lagda diff --git a/source/UF/CoconesofSpans.lagda b/source/UF/CoconesofSpans.lagda new file mode 100644 index 000000000..b2b1a5baf --- /dev/null +++ b/source/UF/CoconesofSpans.lagda @@ -0,0 +1,257 @@ +Ian Ray, 15th January 2025 + +We will prove some results about cocones of spans. + +\begin{code} + +{-# OPTIONS --safe --without-K #-} + +open import UF.FunExt + +module UF.CoconesofSpans (fe : Fun-Ext) where + +open import MLTT.Spartan +open import UF.Base +open import UF.Equiv +open import UF.EquivalenceExamples +open import UF.PropIndexedPiSigma +open import UF.Retracts +open import UF.Subsingletons +open import UF.Yoneda + +\end{code} + +We start by defining cocones and characerizing their identity type. + +\begin{code} + +cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +cocone {๐“ค} {๐“ฅ} {๐“ฆ} {๐“ฃ} {A} {B} {C} f g X = + ฮฃ i ๊ž‰ (A โ†’ X) , ฮฃ j ๊ž‰ (B โ†’ X) , (i โˆ˜ f โˆผ j โˆ˜ g) + +cocone-vertical-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ cocone f g X + โ†’ (A โ†’ X) +cocone-vertical-map f g X (i , j , K) = i + +cocone-horizontal-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ cocone f g X + โ†’ (B โ†’ X) +cocone-horizontal-map f g X (i , j , K) = j + +cocone-commuting-square : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ ((i , j , K) : cocone f g X) + โ†’ i โˆ˜ f โˆผ j โˆ˜ g +cocone-commuting-square f g X (i , j , K) = K + +cocone-family : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ cocone f g X โ†’ cocone f g X + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ +cocone-family f g X (i , j , H) (i' , j' , H') = + ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g) + +canonical-map-from-identity-to-cocone-family + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ u ๏ผ u' + โ†’ cocone-family f g X u u' +canonical-map-from-identity-to-cocone-family + f g X (i , j , H) .(i , j , H) refl = + (โˆผ-refl , โˆผ-refl , ฮป - โ†’ refl-left-neutral) + +cocone-family-is-identity-system + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (x : cocone f g X) + โ†’ is-contr (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X x y) +cocone-family-is-identity-system {_} {_} {_} {๐“ฃ} {A} {B} {C} f g X (i , j , H) = + equiv-to-singleton e ๐Ÿ™-is-singleton + where + e : (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X (i , j , H) y) โ‰ƒ ๐Ÿ™ { ๐“ฃ } + e = (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X (i , j , H) y) โ‰ƒโŸจ I โŸฉ + (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ j' ๊ž‰ (B โ†’ X) , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ II โŸฉ + (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ K ๊ž‰ i โˆผ i' , + ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ VII โŸฉ + (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , H' โˆผ H) โ‰ƒโŸจ IXV โŸฉ + ๐Ÿ™ โ–  + where + I = โ‰ƒ-comp ฮฃ-assoc (ฮฃ-cong (ฮป i' โ†’ ฮฃ-assoc)) + II = ฮฃ-cong (ฮป _ โ†’ โ‰ƒ-comp (ฮฃ-cong + (ฮป _ โ†’ โ‰ƒ-comp ฮฃ-flip (ฮฃ-cong (ฮป K โ†’ ฮฃ-flip)))) ฮฃ-flip) + III = (ฮฃ i' ๊ž‰ (A โ†’ X) , i โˆผ i') โ‰ƒโŸจ IV โŸฉ + (ฮฃ i' ๊ž‰ (A โ†’ X) , i ๏ผ i') โ‰ƒโŸจ V โŸฉ + ๐Ÿ™ โ–  + where + IV = ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe i -)) + V = singleton-โ‰ƒ-๐Ÿ™ (singleton-types-are-singletons i) + VI = โ‰ƒ-comp (ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe j -))) + (singleton-โ‰ƒ-๐Ÿ™ (singleton-types-are-singletons j)) + VII = (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ K ๊ž‰ i โˆผ i' , + ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ IIIV โŸฉ + (ฮฃ (i' , K) ๊ž‰ (ฮฃ i' ๊ž‰ (A โ†’ X) , i โˆผ i') , + ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ IX โŸฉ + (ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , + ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ XI โŸฉ + (ฮฃ (j' , L) ๊ž‰ (ฮฃ j' ๊ž‰ (B โ†’ X) , j โˆผ j') , + ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j' โˆ˜ g) , + โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ XII โŸฉ + (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , + โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (โˆผ-refl โˆ˜ g)) โ‰ƒโŸจ XIII โŸฉ + (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , H' โˆผ H) โ–  + where + IIIV = โ‰ƒ-sym ฮฃ-assoc + IX = prop-indexed-sum (equiv-to-prop III ๐Ÿ™-is-prop) (i , โˆผ-refl) + XI = โ‰ƒ-sym ฮฃ-assoc + XII = prop-indexed-sum (equiv-to-prop VI ๐Ÿ™-is-prop) (j , โˆผ-refl) + XIII = ฮฃ-cong (ฮป H' โ†’ ฮ -cong fe fe (ฮป c โ†’ ๏ผ-cong (refl โˆ™ H' c) + (โˆผ-trans H (ฮป _ โ†’ refl) c) refl-left-neutral + (refl-right-neutral (H c) โปยน))) + IXV = โ‰ƒ-comp (ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe - H))) + (singleton-โ‰ƒ-๐Ÿ™ (equiv-to-singleton (ฮฃ-cong (ฮป - โ†’ ๏ผ-flip)) + (singleton-types-are-singletons H))) + +cocone-identity-characterization : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ (u ๏ผ u') โ‰ƒ (cocone-family f g X u u') +cocone-identity-characterization f g X u u' = + (canonical-map-from-identity-to-cocone-family f g X u u' , + Yoneda-Theorem-forth u (canonical-map-from-identity-to-cocone-family f g X u) + (cocone-family-is-identity-system f g X u) u') + +inverse-cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + โ†’ (u u' : cocone f g X) + โ†’ cocone-family f g X u u' + โ†’ u ๏ผ u' +inverse-cocone-map f g X u u' = + โŒœ (cocone-identity-characterization f g X u u') โŒโปยน + +\end{code} + +We need to define the type of morphisms between cocones. We should give a +characterization of the identity type but fortunately we only need a map in the +trivial direction. + +\begin{code} + +cocone-morphism : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) (P : ๐“ฃ' ฬ‡) + โ†’ cocone f g P + โ†’ cocone f g X + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ โŠ” ๐“ฃ' ฬ‡ +cocone-morphism f g X P (i , j , H) s' + = ฮฃ u ๊ž‰ (P โ†’ X) , cocone-family f g X (u โˆ˜ i , u โˆ˜ j , โˆผ-ap-โˆ˜ u H) s' + +cocone-morphism-family : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) (P : ๐“ฃ' ฬ‡) + โ†’ (s : cocone f g P) + โ†’ (s' : cocone f g X) + โ†’ cocone-morphism f g X P s s' + โ†’ cocone-morphism f g X P s s' + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ โŠ” ๐“ฃ' ฬ‡ +cocone-morphism-family {_} {_} {_} {_} {_} {A} {B} {C} f g X P + (i , j , H) (i' , j' , H') (u , K , L , M) (u' , K' , L' , M') + = ฮฃ ฮธ ๊ž‰ ((x : P) โ†’ u x ๏ผ u' x) , ฮฃ ฯ•l ๊ž‰ ((a : A) โ†’ ฮธ (i a) โˆ™ K' a ๏ผ K a) , + ฮฃ ฯ•r ๊ž‰ ((b : B) โ†’ ฮธ (j b) โˆ™ L' b ๏ผ L b) , ((c : C) โ†’ M c ๏ผ ฮ“ ฮธ ฯ•l ฯ•r c) + where + ฮ“ : (ฮธ : (x : P) โ†’ u x ๏ผ u' x) + (ฯ•l : (a : A) โ†’ ฮธ (i a) โˆ™ K' a ๏ผ K a) + (ฯ•r : (b : B) โ†’ ฮธ (j b) โˆ™ L' b ๏ผ L b) + (c : C) + โ†’ K (f c) โˆ™ H' c ๏ผ ap u (H c) โˆ™ L (g c) + ฮ“ ฮธ ฯ•l ฯ•r c = K (f c) โˆ™ H' c ๏ผโŸจ I โŸฉ + (ฮธ (i (f c)) โˆ™ K' (f c)) โˆ™ H' c ๏ผโŸจ II โŸฉ + ฮธ (i (f c)) โˆ™ (K' (f c) โˆ™ H' c) ๏ผโŸจ III โŸฉ + ฮธ (i (f c)) โˆ™ (ap u' (H c) โˆ™ L' (g c)) ๏ผโŸจ IV โŸฉ + (ฮธ (i (f c)) โˆ™ ap u' (H c)) โˆ™ L' (g c) ๏ผโŸจ V โŸฉ + (ap u (H c) โˆ™ ฮธ (j (g c))) โˆ™ L' (g c) ๏ผโŸจ VI โŸฉ + ap u (H c) โˆ™ (ฮธ (j (g c)) โˆ™ L' (g c)) ๏ผโŸจ VII โŸฉ + ap u (H c) โˆ™ L (g c) โˆŽ + where + I = ap (_โˆ™ H' c) (ฯ•l (f c) โปยน) + II = โˆ™assoc (ฮธ (i (f c))) (K' (f c)) (H' c) + III = ap (ฮธ (i (f c)) โˆ™_) (M' c) + IV = โˆ™assoc (ฮธ (i (f c))) (ap u' (H c)) (L' (g c)) โปยน + V = ap (_โˆ™ L' (g c)) (homotopies-are-natural u u' ฮธ) + VI = โˆ™assoc (ap u (H c)) (ฮธ (j (g c))) (L' (g c)) + VII = ap (ap u (H c) โˆ™_) (ฯ•r (g c)) + +canonical-map-to-cocone-morphism-family + : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) (P : ๐“ฃ' ฬ‡) + โ†’ (s : cocone f g P) + โ†’ (s' : cocone f g X) + โ†’ (m : cocone-morphism f g X P s s') + โ†’ (m' : cocone-morphism f g X P s s') + โ†’ m ๏ผ m' + โ†’ cocone-morphism-family f g X P s s' m m' +canonical-map-to-cocone-morphism-family {_} {_} {_} {_} {_} {A} {B} {C} + f g X P (i , j , H) (i' , j' , H') (u , K , L , M) .(u , K , L , M) refl + = (โˆผ-refl , (ฮป - โ†’ refl-left-neutral) , (ฮป - โ†’ refl-left-neutral) , ฮป c โ†’ I c โปยน) + where + I : (c : C) + โ†’ ap (_โˆ™ H' c) (refl-left-neutral โปยน) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (K (f c)) (H' c) + โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน + โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) + โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) + โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) ๏ผ M c + I c = ap (_โˆ™ H' c) (refl-left-neutral โปยน) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (K (f c)) (H' c) + โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน + โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) + โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) + โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) ๏ผโŸจ ap {!!} II โŸฉ + refl-left-neutral โปยน + โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน + โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) + โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) + โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) ๏ผโŸจ {!!} โŸฉ + {!!} + where + II : {Y : ๐“ค ฬ‡} {x y z : Y} {p : x ๏ผ y} {q : y ๏ผ z} + โ†’ ap (_โˆ™ q) (refl-left-neutral โปยน) โˆ™ โˆ™assoc refl p q ๏ผ refl-left-neutral โปยน + II {๐“ค} {Y} {x} {y} {z} {refl} {refl} = refl + III : {Y : ๐“ค ฬ‡} {x y z : Y} {p : x ๏ผ y} {q : y ๏ผ z} + โ†’ โˆ™assoc p refl q โˆ™ ap (p โˆ™_) (refl-left-neutral) ๏ผ ap (_โˆ™ q) (refl) + III {๐“ค} {Y} {x} {y} {z} {refl} {refl} = refl + +\end{code} + +We also introduce the notion of a dependent cocone. + +TODO. Characterize the identity type of dependent cocones. + +\begin{code} + +dependent-cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} + (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) + (t : cocone f g X) (P : X โ†’ ๐“ฃ' ฬ‡) + โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ' ฬ‡ +dependent-cocone {_} {_} {_} {_} {_} {A} {B} {C} f g X (i , j , H) P = + ฮฃ i' ๊ž‰ ((a : A) โ†’ P (i a)) , ฮฃ j' ๊ž‰ ((b : B) โ†’ P (j b)) , + ((c : C) โ†’ transport P (H c) (i' (f c)) ๏ผ j' (g c)) + +\end{code} diff --git a/source/UF/Pushouts.lagda b/source/UF/Pushouts.lagda index 6677de151..590559e03 100644 --- a/source/UF/Pushouts.lagda +++ b/source/UF/Pushouts.lagda @@ -14,6 +14,7 @@ module UF.Pushouts (fe : Fun-Ext) where open import MLTT.Spartan open import UF.Base +open import UF.CoconesofSpans fe open import UF.Equiv open import UF.EquivalenceExamples open import UF.PropIndexedPiSigma @@ -23,147 +24,6 @@ open import UF.Yoneda \end{code} -We start by defining cocones and characerizing their identity type. - -\begin{code} - -cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ -cocone {๐“ค} {๐“ฅ} {๐“ฆ} {๐“ฃ} {A} {B} {C} f g X = - ฮฃ i ๊ž‰ (A โ†’ X) , ฮฃ j ๊ž‰ (B โ†’ X) , (i โˆ˜ f โˆผ j โˆ˜ g) - -cocone-vertical-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ cocone f g X - โ†’ (A โ†’ X) -cocone-vertical-map f g X (i , j , K) = i - -cocone-horizontal-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ cocone f g X - โ†’ (B โ†’ X) -cocone-horizontal-map f g X (i , j , K) = j - -cocone-commuting-square : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ ((i , j , K) : cocone f g X) - โ†’ i โˆ˜ f โˆผ j โˆ˜ g -cocone-commuting-square f g X (i , j , K) = K - -cocone-family : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ cocone f g X โ†’ cocone f g X โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ ฬ‡ -cocone-family f g X (i , j , H) (i' , j' , H') = - ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , - โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g) - -canonical-map-from-identity-to-cocone-family - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ (u u' : cocone f g X) - โ†’ u ๏ผ u' - โ†’ cocone-family f g X u u' -canonical-map-from-identity-to-cocone-family - f g X (i , j , H) .(i , j , H) refl = - (โˆผ-refl , โˆผ-refl , ฮป - โ†’ refl-left-neutral) - -cocone-family-is-identity-system - : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ (x : cocone f g X) - โ†’ is-contr (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X x y) -cocone-family-is-identity-system {_} {_} {_} {๐“ฃ} {A} {B} {C} f g X (i , j , H) = - equiv-to-singleton e ๐Ÿ™-is-singleton - where - e : (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X (i , j , H) y) โ‰ƒ ๐Ÿ™ { ๐“ฃ } - e = (ฮฃ y ๊ž‰ cocone f g X , cocone-family f g X (i , j , H) y) โ‰ƒโŸจ I โŸฉ - (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ j' ๊ž‰ (B โ†’ X) , - ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , - ฮฃ K ๊ž‰ i โˆผ i' , ฮฃ L ๊ž‰ j โˆผ j' , - โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ II โŸฉ - (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ K ๊ž‰ i โˆผ i' , - ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , - ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , - โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ VII โŸฉ - (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , H' โˆผ H) โ‰ƒโŸจ IXV โŸฉ - ๐Ÿ™ โ–  - where - I = โ‰ƒ-comp ฮฃ-assoc (ฮฃ-cong (ฮป i' โ†’ ฮฃ-assoc)) - II = ฮฃ-cong (ฮป _ โ†’ โ‰ƒ-comp (ฮฃ-cong - (ฮป _ โ†’ โ‰ƒ-comp ฮฃ-flip (ฮฃ-cong (ฮป K โ†’ ฮฃ-flip)))) ฮฃ-flip) - III = (ฮฃ i' ๊ž‰ (A โ†’ X) , i โˆผ i') โ‰ƒโŸจ IV โŸฉ - (ฮฃ i' ๊ž‰ (A โ†’ X) , i ๏ผ i') โ‰ƒโŸจ V โŸฉ - ๐Ÿ™ โ–  - where - IV = ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe i -)) - V = singleton-โ‰ƒ-๐Ÿ™ (singleton-types-are-singletons i) - VI = โ‰ƒ-comp (ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe j -))) - (singleton-โ‰ƒ-๐Ÿ™ (singleton-types-are-singletons j)) - VII = (ฮฃ i' ๊ž‰ (A โ†’ X) , ฮฃ K ๊ž‰ i โˆผ i' , - ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , - ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , - โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ IIIV โŸฉ - (ฮฃ (i' , K) ๊ž‰ (ฮฃ i' ๊ž‰ (A โ†’ X) , i โˆผ i') , - ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , - ฮฃ H' ๊ž‰ (i' โˆ˜ f โˆผ j' โˆ˜ g) , - โˆผ-trans (K โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ IX โŸฉ - (ฮฃ j' ๊ž‰ (B โ†’ X) , ฮฃ L ๊ž‰ j โˆผ j' , - ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j' โˆ˜ g) , - โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ XI โŸฉ - (ฮฃ (j' , L) ๊ž‰ (ฮฃ j' ๊ž‰ (B โ†’ X) , j โˆผ j') , - ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j' โˆ˜ g) , - โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (L โˆ˜ g)) โ‰ƒโŸจ XII โŸฉ - (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , - โˆผ-trans (โˆผ-refl โˆ˜ f) H' โˆผ โˆผ-trans H (โˆผ-refl โˆ˜ g)) โ‰ƒโŸจ XIII โŸฉ - (ฮฃ H' ๊ž‰ (i โˆ˜ f โˆผ j โˆ˜ g) , H' โˆผ H) โ–  - where - IIIV = โ‰ƒ-sym ฮฃ-assoc - IX = prop-indexed-sum (equiv-to-prop III ๐Ÿ™-is-prop) (i , โˆผ-refl) - XI = โ‰ƒ-sym ฮฃ-assoc - XII = prop-indexed-sum (equiv-to-prop VI ๐Ÿ™-is-prop) (j , โˆผ-refl) - XIII = ฮฃ-cong (ฮป H' โ†’ ฮ -cong fe fe (ฮป c โ†’ ๏ผ-cong (refl โˆ™ H' c) - (โˆผ-trans H (ฮป _ โ†’ refl) c) refl-left-neutral - (refl-right-neutral (H c) โปยน))) - IXV = โ‰ƒ-comp (ฮฃ-cong (ฮป - โ†’ โ‰ƒ-sym (โ‰ƒ-funext fe - H))) - (singleton-โ‰ƒ-๐Ÿ™ (equiv-to-singleton (ฮฃ-cong (ฮป - โ†’ ๏ผ-flip)) - (singleton-types-are-singletons H))) - -cocone-identity-characterization : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ (u u' : cocone f g X) - โ†’ (u ๏ผ u') โ‰ƒ (cocone-family f g X u u') -cocone-identity-characterization f g X u u' = - (canonical-map-from-identity-to-cocone-family f g X u u' , - Yoneda-Theorem-forth u (canonical-map-from-identity-to-cocone-family f g X u) - (cocone-family-is-identity-system f g X u) u') - -inverse-cocone-map : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - โ†’ (u u' : cocone f g X) - โ†’ cocone-family f g X u u' - โ†’ u ๏ผ u' -inverse-cocone-map f g X u u' = - โŒœ (cocone-identity-characterization f g X u u') โŒโปยน - -\end{code} - -We also introduce the notion of a dependent cocone. - -TODO. Characterize the identity type of dependent cocones. - -\begin{code} - -dependent-cocone : {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} - (f : C โ†’ A) (g : C โ†’ B) (X : ๐“ฃ ฬ‡) - (t : cocone f g X) (P : X โ†’ ๐“ฃ' ฬ‡) - โ†’ ๐“ค โŠ” ๐“ฅ โŠ” ๐“ฆ โŠ” ๐“ฃ' ฬ‡ -dependent-cocone {_} {_} {_} {_} {_} {A} {B} {C} f g X (i , j , H) P = - ฮฃ i' ๊ž‰ ((a : A) โ†’ P (i a)) , ฮฃ j' ๊ž‰ ((b : B) โ†’ P (j b)) , - ((c : C) โ†’ transport P (H c) (i' (f c)) ๏ผ j' (g c)) - -\end{code} - Now we will define the universal property, induction principle and propositional computation rules for pushouts and show they are inter-derivable. @@ -264,7 +124,7 @@ Pushout-Computation-Ruleโ‚ƒ Now we will use a record type to give the pushout, point and path constructors, and the dependent universal property. -begin{code} +\begin{code} record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) (g : C โ†’ B) : ๐“คฯ‰ where @@ -289,7 +149,7 @@ record pushouts-exist {A : ๐“ค ฬ‡} {B : ๐“ฅ ฬ‡} {C : ๐“ฆ ฬ‡} (f : C โ†’ A) โ†’ Pushout-Computation-Ruleโ‚ƒ pushout f g (inll , inrr , glue) P pushout-induction pushout-ind-comp-inll pushout-ind-comp-inrr -end{code} +\end{code} We will observe that the pushout is a cocone and begin deriving some key results from the induction principles: @@ -303,7 +163,7 @@ The following are logically equivalent uniqueness principle 3) The universal property. -begin{code} +\begin{code} pushout-cocone : cocone f g pushout pushout-cocone = (inll , inrr , glue) @@ -433,7 +293,7 @@ begin{code} (pushout-rec-comp-inll l r G , pushout-rec-comp-inrr l r G , โˆผ-sym (pushout-rec-comp-glue l r G)) -end{code} +\end{code} We investigate only postulating the (non-dependent) universal property. @@ -583,6 +443,19 @@ computation rules and the uniqueness principles. (u , H , H' , ฮป c โ†’ M c โปยน) (u' , โˆผ-refl , โˆผ-refl , ฮป c โ†’ refl-left-neutral)))) + pushout-uniqueness-inll : {X : ๐“ฃ ฬ‡} + โ†’ (u u' : pushout โ†’ X) + โ†’ (H : (a : A) โ†’ u (inll a) ๏ผ u' (inll a)) + โ†’ (H' : (b : B) โ†’ u (inrr b) ๏ผ u' (inrr b)) + โ†’ (M : (c : C) + โ†’ ap u (glue c) โˆ™ H' (g c) ๏ผ H (f c) โˆ™ ap u' (glue c)) + โ†’ (l : A โ†’ X) + โ†’ (L : (a : A) โ†’ u (inll a) ๏ผ l a) + โ†’ (L' : (a : A) โ†’ u' (inll a) ๏ผ l a) + โ†’ (a : A) + โ†’ pushout-uniqueness u u' H H' M (inll a) โˆ™ L' a ๏ผ L a + pushout-uniqueness-inll u u' H H' M l L L' a = {!!} + \end{code} Finally, we can derive the induction principle and the corresponding propositional @@ -742,13 +615,67 @@ call pre-induction. โ†’ transport P (pre-induction-id-is-id l r G (inll a)) (pre-induction-family l r G (inll a)) ๏ผ l a - pre-induction-family-comp-inll l r G a - = {!!} + pre-induction-family-comp-inll {_} {P} l r G a + = transport (ฮป - โ†’ transport P - (pre-induction-family l r G (inll a)) ๏ผ l a) + (I a โปยน) (from-ฮฃ-๏ผ' (pre-induction-comp-inll l r G a)) where I : (a : A) โ†’ pre-induction-id-is-id l r G (inll a) ๏ผ ap prโ‚ (pre-induction-comp-inll l r G a) - I a = {!pushout-rec-comp-inll!} + I = pushout-uniqueness-inll (pre-induction-id l r G) id + (ฮป a โ†’ ap prโ‚ (pre-induction-comp-inll l r G a)) + (ฮป b โ†’ ap prโ‚ (pre-induction-comp-inrr l r G b)) + II inll (ฮป a โ†’ ap prโ‚ (pre-induction-comp-inll l r G a)) โˆผ-refl + where + II : (c : C) + โ†’ ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™ ap id (glue c) + II c = ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ III โŸฉ + ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ IV โŸฉ + ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) ๏ผโŸจ V โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ VI โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ VIII โŸฉ + ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap id (glue c) โˆŽ + where + III : ap (pre-induction-id l r G) (glue c) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + III = ap (_โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c))) + (ap-ap (pre-induction l r G) prโ‚ (glue c) โปยน) + IV : ap prโ‚ (ap (pre-induction l r G) (glue c)) + โˆ™ ap prโ‚ (pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) + IV = ap-โˆ™ prโ‚ (ap (pre-induction l r G) (glue c)) + (pre-induction-comp-inrr l r G (g c)) โปยน + V : ap prโ‚ (ap (pre-induction l r G) (glue c) + โˆ™ pre-induction-comp-inrr l r G (g c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) + V = ap (ap prโ‚) (pre-induction-comp-glue l r G c) + VI : ap prโ‚ (pre-induction-comp-inll l r G (f c) + โˆ™ to-ฮฃ-๏ผ (glue c , G c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) + VI = ap-โˆ™ prโ‚ (pre-induction-comp-inll l r G (f c)) + (to-ฮฃ-๏ผ (glue c , G c)) + VII : ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผ ap id (glue c) + VII = ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) ๏ผโŸจ ap-prโ‚-to-ฮฃ-๏ผ (glue c , G c) โŸฉ + glue c ๏ผโŸจ ap-id-is-id' (glue c) โŸฉ + ap id (glue c) โˆŽ + VIII : ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap prโ‚ (to-ฮฃ-๏ผ (glue c , G c)) + ๏ผ ap prโ‚ (pre-induction-comp-inll l r G (f c)) + โˆ™ ap id (glue c) + VIII = ap (ap prโ‚ (pre-induction-comp-inll l r G (f c)) โˆ™_) VII \end{code} From 6464833eefdfc8b68db611c091b8749c837b7fec Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sat, 8 Feb 2025 19:04:39 -0500 Subject: [PATCH 18/18] Update... still need to fix unresolved contraints. --- source/UF/CoconesofSpans.lagda | 51 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/source/UF/CoconesofSpans.lagda b/source/UF/CoconesofSpans.lagda index b2b1a5baf..b7f0c3635 100644 --- a/source/UF/CoconesofSpans.lagda +++ b/source/UF/CoconesofSpans.lagda @@ -206,37 +206,28 @@ canonical-map-to-cocone-morphism-family โ†’ cocone-morphism-family f g X P s s' m m' canonical-map-to-cocone-morphism-family {_} {_} {_} {_} {_} {A} {B} {C} f g X P (i , j , H) (i' , j' , H') (u , K , L , M) .(u , K , L , M) refl - = (โˆผ-refl , (ฮป - โ†’ refl-left-neutral) , (ฮป - โ†’ refl-left-neutral) , ฮป c โ†’ I c โปยน) + = (โˆผ-refl , (ฮป - โ†’ refl-left-neutral) , (ฮป - โ†’ refl-left-neutral) , II) where - I : (c : C) - โ†’ ap (_โˆ™ H' c) (refl-left-neutral โปยน) - โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (K (f c)) (H' c) - โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) - โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน - โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) - โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) - โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) ๏ผ M c - I c = ap (_โˆ™ H' c) (refl-left-neutral โปยน) - โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (K (f c)) (H' c) - โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) - โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน - โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) - โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) - โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) ๏ผโŸจ ap {!!} II โŸฉ - refl-left-neutral โปยน - โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) - โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน - โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) - โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) - โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) ๏ผโŸจ {!!} โŸฉ - {!!} - where - II : {Y : ๐“ค ฬ‡} {x y z : Y} {p : x ๏ผ y} {q : y ๏ผ z} - โ†’ ap (_โˆ™ q) (refl-left-neutral โปยน) โˆ™ โˆ™assoc refl p q ๏ผ refl-left-neutral โปยน - II {๐“ค} {Y} {x} {y} {z} {refl} {refl} = refl - III : {Y : ๐“ค ฬ‡} {x y z : Y} {p : x ๏ผ y} {q : y ๏ผ z} - โ†’ โˆ™assoc p refl q โˆ™ ap (p โˆ™_) (refl-left-neutral) ๏ผ ap (_โˆ™ q) (refl) - III {๐“ค} {Y} {x} {y} {z} {refl} {refl} = refl + I : {Y : ๐“ค ฬ‡} {Z : ๐“ฅ ฬ‡} {x y : Y} {z' z : Z} {f' : Y โ†’ Z} + {p : x ๏ผ y} {q : f' y ๏ผ z} {p' : f' x ๏ผ z'} {q' : z' ๏ผ z} + {ฮฑ : p' โˆ™ q' ๏ผ (ap f' p) โˆ™ q} + โ†’ ฮฑ ๏ผ ap (_โˆ™ q') (refl-left-neutral โปยน) + โˆ™ โˆ™assoc refl p' q' + โˆ™ ap (refl โˆ™_) ฮฑ + โˆ™ โˆ™assoc refl (ap f' p) q โปยน + โˆ™ ap (_โˆ™ q) (homotopies-are-natural f' f' โˆผ-refl) + โˆ™ โˆ™assoc (ap f' p) refl q + โˆ™ ap (ap f' p โˆ™_) (refl-left-neutral) + I {๐“ค} {๐“ฅ} {Y} {Z} {x} {y} {z'} {z} {f'} {refl} {refl} {refl} {q'} {ฮฑ} = refl + II : (c : C) + โ†’ M c ๏ผ ap (_โˆ™ H' c) (refl-left-neutral โปยน) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (K (f c)) (H' c) + โˆ™ ap (โˆผ-refl (i (f c)) โˆ™_) (M c) + โˆ™ โˆ™assoc (โˆผ-refl (i (f c))) (ap u (H c)) (L (g c)) โปยน + โˆ™ ap (_โˆ™ L (g c)) (homotopies-are-natural u u โˆผ-refl) + โˆ™ โˆ™assoc (ap u (H c)) (โˆผ-refl (j (g c))) (L (g c)) + โˆ™ ap (ap u (H c) โˆ™_) (refl-left-neutral) + II c = I \end{code}