From 70559c6ef80c8a87632f64b583a19f7d6cc4daf6 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 11:52:25 +0100 Subject: [PATCH 01/39] Judgmentally involutive identity types --- src/foundation.lagda.md | 1 + ...entally-involutive-identity-types.lagda.md | 296 ++++++++++++++++++ 2 files changed, 297 insertions(+) create mode 100644 src/foundation/judgmentally-involutive-identity-types.lagda.md diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 1badf21b0d..a927bf8580 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -205,6 +205,7 @@ open import foundation.iterated-dependent-product-types public open import foundation.iterating-automorphisms public open import foundation.iterating-functions public open import foundation.iterating-involutions public +open import foundation.judgmentally-involutive-identity-types public open import foundation.kernel-span-diagrams-of-maps public open import foundation.large-binary-relations public open import foundation.large-dependent-pair-types public diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md new file mode 100644 index 0000000000..a8a5c4b991 --- /dev/null +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -0,0 +1,296 @@ +# Judgmentally involutive identity types + +```agda +module foundation.judgmentally-involutive-identity-types where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.cartesian-product-types +open import foundation.dependent-pair-types +open import foundation.equality-cartesian-product-types +open import foundation.universal-property-identity-systems +open import foundation.universe-levels + +open import foundation-core.contractible-types +open import foundation-core.equality-dependent-pair-types +open import foundation-core.equivalences +open import foundation-core.function-types +open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.identity-types +open import foundation-core.retractions +open import foundation-core.sections +open import foundation-core.torsorial-type-families +``` + +
+ +## Idea + +The [standard definition of identity types](foundation-core.identity-types.md) +suffer the limitation that many of the basic operations only satisfy algebraic +laws _weakly_. + +In this file, we consider the +{{#concept "judgmentally involutive identity types" Agda=involutive-Id}} + +```text + (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) +``` + +This type family is [equivalent](foundation-core.equivalences.md) to the +standard identity types, but satisfy the law + +```text + inv (inv p) = p +``` + +judgmentally. + +## Definition + +```agda +module _ + {l : Level} {A : UU l} + where + + involutive-Id : (x y : A) → UU l + involutive-Id x y = Σ A (λ z → (z = y) × (z = x)) + + infix 6 _=ⁱ_ + _=ⁱ_ : A → A → UU l + (a =ⁱ b) = involutive-Id a b + + refl-involutive-Id : {x : A} → x =ⁱ x + refl-involutive-Id {x} = (x , refl , refl) +``` + +### The judgmentally involutive identity types are equivalent to the standard identity types + +Moreover, the [retraction](foundation-core.retractions.md) is judgmental. + +```agda +module _ + {l : Level} {A : UU l} {x y : A} + where + + involutive-eq-eq : x = y → x =ⁱ y + involutive-eq-eq p = (x , p , refl) + + eq-involutive-eq : x =ⁱ y → x = y + eq-involutive-eq (z , p , q) = inv q ∙ p + + is-section-eq-involutive-eq : is-section involutive-eq-eq eq-involutive-eq + is-section-eq-involutive-eq (z , p , refl) = refl + + is-retraction-eq-involutive-eq : + is-retraction involutive-eq-eq eq-involutive-eq + is-retraction-eq-involutive-eq p = refl + + is-equiv-involutive-eq-eq : is-equiv involutive-eq-eq + pr1 (pr1 is-equiv-involutive-eq-eq) = eq-involutive-eq + pr2 (pr1 is-equiv-involutive-eq-eq) = is-section-eq-involutive-eq + pr1 (pr2 is-equiv-involutive-eq-eq) = eq-involutive-eq + pr2 (pr2 is-equiv-involutive-eq-eq) = is-retraction-eq-involutive-eq + + is-equiv-eq-involutive-eq : is-equiv eq-involutive-eq + pr1 (pr1 is-equiv-eq-involutive-eq) = involutive-eq-eq + pr2 (pr1 is-equiv-eq-involutive-eq) = is-retraction-eq-involutive-eq + pr1 (pr2 is-equiv-eq-involutive-eq) = involutive-eq-eq + pr2 (pr2 is-equiv-eq-involutive-eq) = is-section-eq-involutive-eq + + equiv-involutive-eq-eq : (x = y) ≃ (x =ⁱ y) + pr1 equiv-involutive-eq-eq = involutive-eq-eq + pr2 equiv-involutive-eq-eq = is-equiv-involutive-eq-eq + + equiv-eq-involutive-eq : (x =ⁱ y) ≃ (x = y) + pr1 equiv-eq-involutive-eq = eq-involutive-eq + pr2 equiv-eq-involutive-eq = is-equiv-eq-involutive-eq + +module _ + {l : Level} {A : UU l} + where + + involutive-eq-eq-refl : + {x : A} → involutive-eq-eq (refl {x = x}) = refl-involutive-Id + involutive-eq-eq-refl = refl + + eq-involutive-eq-refl : + {x : A} → eq-involutive-eq (refl-involutive-Id {x = x}) = refl + eq-involutive-eq-refl = refl +``` + +### The induction principle for judgmentally involutive identity types + +The judgementally involutive identity types satisfy the induction principle of +the identity types. This states that given a base point `x : A` and a family of +types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, +then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it +suffices to define it at `f x refl-involutive-Id`. + +```agda +module _ + {l : Level} {A : UU l} {x : A} + where + + is-torsorial-involutive-Id : is-torsorial (involutive-Id x) + is-torsorial-involutive-Id = + is-contr-equiv + ( Σ A (x =_)) + ( equiv-tot (λ y → equiv-eq-involutive-eq {x = x} {y})) + ( is-torsorial-path x) + + dependent-universal-property-identity-system-involutive-Id : + dependent-universal-property-identity-system + ( involutive-Id x) + ( refl-involutive-Id) + dependent-universal-property-identity-system-involutive-Id = + dependent-universal-property-identity-system-is-torsorial + ( refl-involutive-Id) + ( is-torsorial-involutive-Id) + + ind-involutive-Id : + {l1 l2 : Level} {A : UU l1} + (x : A) (B : (y : A) (p : x =ⁱ y) → UU l2) → + (B x refl-involutive-Id) → (y : A) (p : x =ⁱ y) → B y p + ind-involutive-Id x B b .x (.x , refl , refl) = b +``` + +## Structure + +The judgementally involutive identity types form a judgmentally involutive weak +groupoidal structure on types. + +### Inverting judgmentally involutive identifications + +```agda +module _ + {l : Level} {A : UU l} + where + + inv-involutive-eq : {x y : A} → x =ⁱ y → y =ⁱ x + inv-involutive-eq (z , p , q) = (z , q , p) + + inv-inv-involutive-eq : + {x y : A} (p : x =ⁱ y) → inv-involutive-eq (inv-involutive-eq p) = p + inv-inv-involutive-eq p = refl + + distributive-inv-involutive-eq-eq : + {x y : A} (p : x = y) → + involutive-eq-eq (inv p) = inv-involutive-eq (involutive-eq-eq p) + distributive-inv-involutive-eq-eq refl = refl + + distributive-inv-eq-involutive-eq : + {x y : A} (p : x =ⁱ y) → + eq-involutive-eq (inv-involutive-eq p) = inv (eq-involutive-eq p) + distributive-inv-eq-involutive-eq (z , p , q) = + ap (inv p ∙_) (inv (inv-inv q)) ∙ inv (distributive-inv-concat (inv q) p) +``` + +### Concatenation of identifications + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ⁱ_ + _∙ⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z + (z , p , q) ∙ⁱ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) + + concat-involutive-eq : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z + concat-involutive-eq p z q = p ∙ⁱ q + + concat-involutive-eq' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z + concat-involutive-eq' x q p = p ∙ⁱ q + + distributive-concat-involutive-eq-eq : + {x y z : A} (p : x = y) (q : y = z) → + involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ⁱ involutive-eq-eq q + distributive-concat-involutive-eq-eq refl q = refl + + distributive-concat-eq-involutive-eq : + {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → + eq-involutive-eq (p ∙ⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q + distributive-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = + ( ap + ( _∙ p') + ( ( distributive-inv-concat (q' ∙ inv p) q) ∙ + ( ap + ( inv q ∙_) + ( distributive-inv-concat q' (inv p) ∙ ap (_∙ inv q') (inv-inv p))) ∙ + ( inv (assoc (inv q) p (inv q'))))) ∙ + ( assoc (inv q ∙ p) (inv q') p') +``` + +### The groupoidal laws for the judgmentally involutive identity types + +```agda +module _ + {l : Level} {A : UU l} + where + + assoc-involutive-eq : + {x y z w : A} (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → + ((p ∙ⁱ q) ∙ⁱ r) = (p ∙ⁱ (q ∙ⁱ r)) + assoc-involutive-eq (z , p , q) (z' , p' , q') (z'' , p'' , q'') = + eq-pair-eq-pr2 + ( eq-pair-eq-pr2 + ( inv + ( ( ap (_∙ q) (assoc (q'' ∙ inv p') q' (inv p))) ∙ + ( assoc (q'' ∙ inv p') (q' ∙ inv p) q)))) + + left-unit-involutive-eq : + {x y : A} {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p + left-unit-involutive-eq = + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-unit)) + + right-unit-involutive-eq : + {x y : A} {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p + right-unit-involutive-eq {p = z , refl , q} = refl + + left-inv-involutive-eq : + {x y : A} (p : x =ⁱ y) → inv-involutive-eq p ∙ⁱ p = refl-involutive-Id + left-inv-involutive-eq (z , refl , q) = + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-inv q)) + + right-inv-involutive-eq : + {x y : A} (p : x =ⁱ y) → p ∙ⁱ inv-involutive-eq p = refl-involutive-Id + right-inv-involutive-eq (z , p , refl) = + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-inv p)) + + distributive-inv-concat-involutive-eq : + {x y : A} (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → + inv-involutive-eq (p ∙ⁱ q) = inv-involutive-eq q ∙ⁱ inv-involutive-eq p + distributive-inv-concat-involutive-eq (z , refl , q) (.z , p' , refl) = refl +``` + +### Transposing inverses + +```agda +module _ + {l : Level} {A : UU l} + where + + left-transpose-eq-concat-involutive-eq : + {x y : A} (p : x =ⁱ y) {z : A} (q : y =ⁱ z) (r : x =ⁱ z) → + p ∙ⁱ q = r → q = inv-involutive-eq p ∙ⁱ r + left-transpose-eq-concat-involutive-eq + ( z , p , q) (z' , refl , q') (.z' , refl , q'') refl = + eq-pair-eq-pr2 + ( eq-pair-eq-pr2 + ( ( inv right-unit) ∙ + ( ap + ( q' ∙_) + ( inv (left-inv p) ∙ + ap (λ x → inv p ∙ (x ∙ p)) (inv (right-inv q)))) ∙ + ( ( inv (assoc q' (inv p) (q ∙ inv q ∙ p))) ∙ + ( inv (assoc (q' ∙ inv p) (q ∙ inv q) p)) ∙ + ( ap (_∙ p) (inv (assoc (q' ∙ inv p) q (inv q))))))) +``` + +## References + +- From 00feefb7c74f495702b6e1ddee7199806f515e0a Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 12:03:33 +0100 Subject: [PATCH 02/39] fixes --- ...entally-involutive-identity-types.lagda.md | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index a8a5c4b991..9bbc534a72 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -41,7 +41,7 @@ In this file, we consider the ``` This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfy the law +standard identity types, but satisfies the law ```text inv (inv p) = p @@ -67,9 +67,12 @@ module _ refl-involutive-Id {x} = (x , refl , refl) ``` +## Properties + ### The judgmentally involutive identity types are equivalent to the standard identity types -Moreover, the [retraction](foundation-core.retractions.md) is judgmental. +In fact, the [retraction](foundation-core.retractions.md) is judgmental, and the +equivalence preserves the groupoid structure. ```agda module _ @@ -176,6 +179,15 @@ module _ inv-inv-involutive-eq : {x y : A} (p : x =ⁱ y) → inv-involutive-eq (inv-involutive-eq p) = p inv-inv-involutive-eq p = refl +``` + +The inversion operation corresponds to the standard inversion operation on +identifications: + +```agda +module _ + {l : Level} {A : UU l} + where distributive-inv-involutive-eq-eq : {x y : A} (p : x = y) → @@ -189,7 +201,7 @@ module _ ap (inv p ∙_) (inv (inv-inv q)) ∙ inv (distributive-inv-concat (inv q) p) ``` -### Concatenation of identifications +### Concatenation of judgmentally involutive identifications ```agda module _ @@ -205,6 +217,15 @@ module _ concat-involutive-eq' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z concat-involutive-eq' x q p = p ∙ⁱ q +``` + +The concatenation operation corresponds to the standard concatenation operation +on identifications: + +```agda +module _ + {l : Level} {A : UU l} + where distributive-concat-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → @@ -238,9 +259,8 @@ module _ assoc-involutive-eq (z , p , q) (z' , p' , q') (z'' , p'' , q'') = eq-pair-eq-pr2 ( eq-pair-eq-pr2 - ( inv - ( ( ap (_∙ q) (assoc (q'' ∙ inv p') q' (inv p))) ∙ - ( assoc (q'' ∙ inv p') (q' ∙ inv p) q)))) + ( ( inv (assoc (q'' ∙ inv p') (q' ∙ inv p) q)) ∙ + ( ap (_∙ q) (inv (assoc (q'' ∙ inv p') q' (inv p)))))) left-unit-involutive-eq : {x y : A} {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p @@ -267,7 +287,7 @@ module _ distributive-inv-concat-involutive-eq (z , refl , q) (.z , p' , refl) = refl ``` -### Transposing inverses +### Transposing inverses of judgmentally involutive identifications ```agda module _ @@ -284,8 +304,8 @@ module _ ( ( inv right-unit) ∙ ( ap ( q' ∙_) - ( inv (left-inv p) ∙ - ap (λ x → inv p ∙ (x ∙ p)) (inv (right-inv q)))) ∙ + ( ( inv (left-inv p)) ∙ + ( ap (λ x → inv p ∙ (x ∙ p)) (inv (right-inv q))))) ∙ ( ( inv (assoc q' (inv p) (q ∙ inv q ∙ p))) ∙ ( inv (assoc (q' ∙ inv p) (q ∙ inv q) p)) ∙ ( ap (_∙ p) (inv (assoc (q' ∙ inv p) q (inv q))))))) From 3eacf4bdc5092355d17093c3737dee8faec1b775 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 16:21:32 +0100 Subject: [PATCH 03/39] swap superscript `i` for superscript `-` --- ...entally-involutive-identity-types.lagda.md | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index 9bbc534a72..e7e13a1930 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -37,7 +37,7 @@ In this file, we consider the {{#concept "judgmentally involutive identity types" Agda=involutive-Id}} ```text - (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) + (x =⁻ y) := Σ (z : A) ((z = y) × (z = x)) ``` This type family is [equivalent](foundation-core.equivalences.md) to the @@ -59,11 +59,11 @@ module _ involutive-Id : (x y : A) → UU l involutive-Id x y = Σ A (λ z → (z = y) × (z = x)) - infix 6 _=ⁱ_ - _=ⁱ_ : A → A → UU l - (a =ⁱ b) = involutive-Id a b + infix 6 _=⁻_ + _=⁻_ : A → A → UU l + (a =⁻ b) = involutive-Id a b - refl-involutive-Id : {x : A} → x =ⁱ x + refl-involutive-Id : {x : A} → x =⁻ x refl-involutive-Id {x} = (x , refl , refl) ``` @@ -79,10 +79,10 @@ module _ {l : Level} {A : UU l} {x y : A} where - involutive-eq-eq : x = y → x =ⁱ y + involutive-eq-eq : x = y → x =⁻ y involutive-eq-eq p = (x , p , refl) - eq-involutive-eq : x =ⁱ y → x = y + eq-involutive-eq : x =⁻ y → x = y eq-involutive-eq (z , p , q) = inv q ∙ p is-section-eq-involutive-eq : is-section involutive-eq-eq eq-involutive-eq @@ -104,11 +104,11 @@ module _ pr1 (pr2 is-equiv-eq-involutive-eq) = involutive-eq-eq pr2 (pr2 is-equiv-eq-involutive-eq) = is-section-eq-involutive-eq - equiv-involutive-eq-eq : (x = y) ≃ (x =ⁱ y) + equiv-involutive-eq-eq : (x = y) ≃ (x =⁻ y) pr1 equiv-involutive-eq-eq = involutive-eq-eq pr2 equiv-involutive-eq-eq = is-equiv-involutive-eq-eq - equiv-eq-involutive-eq : (x =ⁱ y) ≃ (x = y) + equiv-eq-involutive-eq : (x =⁻ y) ≃ (x = y) pr1 equiv-eq-involutive-eq = eq-involutive-eq pr2 equiv-eq-involutive-eq = is-equiv-eq-involutive-eq @@ -129,8 +129,8 @@ module _ The judgementally involutive identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of -types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, -then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it +types over the identity types based at `x`, `B : (y : A) (p : x =⁻ y) → UU l2`, +then to construct a dependent function `f : (y : A) (p : x =⁻ y) → B y p` it suffices to define it at `f x refl-involutive-Id`. ```agda @@ -156,8 +156,8 @@ module _ ind-involutive-Id : {l1 l2 : Level} {A : UU l1} - (x : A) (B : (y : A) (p : x =ⁱ y) → UU l2) → - (B x refl-involutive-Id) → (y : A) (p : x =ⁱ y) → B y p + (x : A) (B : (y : A) (p : x =⁻ y) → UU l2) → + (B x refl-involutive-Id) → (y : A) (p : x =⁻ y) → B y p ind-involutive-Id x B b .x (.x , refl , refl) = b ``` @@ -173,11 +173,11 @@ module _ {l : Level} {A : UU l} where - inv-involutive-eq : {x y : A} → x =ⁱ y → y =ⁱ x + inv-involutive-eq : {x y : A} → x =⁻ y → y =⁻ x inv-involutive-eq (z , p , q) = (z , q , p) inv-inv-involutive-eq : - {x y : A} (p : x =ⁱ y) → inv-involutive-eq (inv-involutive-eq p) = p + {x y : A} (p : x =⁻ y) → inv-involutive-eq (inv-involutive-eq p) = p inv-inv-involutive-eq p = refl ``` @@ -195,7 +195,7 @@ module _ distributive-inv-involutive-eq-eq refl = refl distributive-inv-eq-involutive-eq : - {x y : A} (p : x =ⁱ y) → + {x y : A} (p : x =⁻ y) → eq-involutive-eq (inv-involutive-eq p) = inv (eq-involutive-eq p) distributive-inv-eq-involutive-eq (z , p , q) = ap (inv p ∙_) (inv (inv-inv q)) ∙ inv (distributive-inv-concat (inv q) p) @@ -208,15 +208,16 @@ module _ {l : Level} {A : UU l} where - infixl 15 _∙ⁱ_ - _∙ⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z - (z , p , q) ∙ⁱ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) + infixl 15 _∙⁻_ + _∙⁻_ : {x y z : A} → x =⁻ y → y =⁻ z → x =⁻ z + (z , p , q) ∙⁻ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) - concat-involutive-eq : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z - concat-involutive-eq p z q = p ∙ⁱ q + concat-involutive-eq : {x y : A} → x =⁻ y → (z : A) → y =⁻ z → x =⁻ z + concat-involutive-eq p z q = p ∙⁻ q + + concat-involutive-eq' : (x : A) {y z : A} → y =⁻ z → x =⁻ y → x =⁻ z + concat-involutive-eq' x q p = p ∙⁻ q - concat-involutive-eq' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z - concat-involutive-eq' x q p = p ∙ⁱ q ``` The concatenation operation corresponds to the standard concatenation operation @@ -229,12 +230,12 @@ module _ distributive-concat-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → - involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ⁱ involutive-eq-eq q + involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙⁻ involutive-eq-eq q distributive-concat-involutive-eq-eq refl q = refl distributive-concat-eq-involutive-eq : - {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → - eq-involutive-eq (p ∙ⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q + {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → + eq-involutive-eq (p ∙⁻ q) = eq-involutive-eq p ∙ eq-involutive-eq q distributive-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = ( ap ( _∙ p') @@ -254,8 +255,8 @@ module _ where assoc-involutive-eq : - {x y z w : A} (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → - ((p ∙ⁱ q) ∙ⁱ r) = (p ∙ⁱ (q ∙ⁱ r)) + {x y z w : A} (p : x =⁻ y) (q : y =⁻ z) (r : z =⁻ w) → + ((p ∙⁻ q) ∙⁻ r) = (p ∙⁻ (q ∙⁻ r)) assoc-involutive-eq (z , p , q) (z' , p' , q') (z'' , p'' , q'') = eq-pair-eq-pr2 ( eq-pair-eq-pr2 @@ -263,27 +264,27 @@ module _ ( ap (_∙ q) (inv (assoc (q'' ∙ inv p') q' (inv p)))))) left-unit-involutive-eq : - {x y : A} {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p + {x y : A} {p : x =⁻ y} → refl-involutive-Id ∙⁻ p = p left-unit-involutive-eq = eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-unit)) right-unit-involutive-eq : - {x y : A} {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p + {x y : A} {p : x =⁻ y} → p ∙⁻ refl-involutive-Id = p right-unit-involutive-eq {p = z , refl , q} = refl left-inv-involutive-eq : - {x y : A} (p : x =ⁱ y) → inv-involutive-eq p ∙ⁱ p = refl-involutive-Id + {x y : A} (p : x =⁻ y) → inv-involutive-eq p ∙⁻ p = refl-involutive-Id left-inv-involutive-eq (z , refl , q) = eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-inv q)) right-inv-involutive-eq : - {x y : A} (p : x =ⁱ y) → p ∙ⁱ inv-involutive-eq p = refl-involutive-Id + {x y : A} (p : x =⁻ y) → p ∙⁻ inv-involutive-eq p = refl-involutive-Id right-inv-involutive-eq (z , p , refl) = eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-inv p)) distributive-inv-concat-involutive-eq : - {x y : A} (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → - inv-involutive-eq (p ∙ⁱ q) = inv-involutive-eq q ∙ⁱ inv-involutive-eq p + {x y : A} (p : x =⁻ y) {z : A} (q : y =⁻ z) → + inv-involutive-eq (p ∙⁻ q) = inv-involutive-eq q ∙⁻ inv-involutive-eq p distributive-inv-concat-involutive-eq (z , refl , q) (.z , p' , refl) = refl ``` @@ -295,8 +296,8 @@ module _ where left-transpose-eq-concat-involutive-eq : - {x y : A} (p : x =ⁱ y) {z : A} (q : y =ⁱ z) (r : x =ⁱ z) → - p ∙ⁱ q = r → q = inv-involutive-eq p ∙ⁱ r + {x y : A} (p : x =⁻ y) {z : A} (q : y =⁻ z) (r : x =⁻ z) → + p ∙⁻ q = r → q = inv-involutive-eq p ∙⁻ r left-transpose-eq-concat-involutive-eq ( z , p , q) (z' , refl , q') (.z' , refl , q'') refl = eq-pair-eq-pr2 From c6922b8e4e223dd8e0a9980be12adab98ced7559 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 16:21:49 +0100 Subject: [PATCH 04/39] =?UTF-8?q?add=20`=5F=E2=88=99=E1=B5=A3=5F`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/foundation-core/identity-types.lagda.md | 37 +++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index 7e0f483ba4..2ae27d9e3a 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -93,6 +93,31 @@ The identity types form a weak groupoidal structure on types. ### Concatenation of identifications +The +{{#concept "concatenation operation on identifications" Agda=_∙_ Agda=_∙'_ Agda=concat}} +is a map + +```text + _∙_ : x = y → y = z → x = z +``` + +for all `x y z : A`. However, there are essentially three different ways we can +define concatenation of identifications, all with different computational +behaviours. + +1. We can define concatenation by induction on the equality `x = y`. This gives + us the computation rule `refl ∙ q = q`. +2. We can define concatenation by induction on the equality `y = z`. This gives + us the computation rule `p ∙ refl = p`. +3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only + gives us the computation rule `refl ∙ refl = refl`. + +While the third option may be preferred by some for its symmetry, for practical +reasons, we use the first alternative by convention. + +See also +[judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md). + ```agda module _ {l : Level} {A : UU l} @@ -107,6 +132,14 @@ module _ concat' : (x : A) {y z : A} → y = z → x = y → x = z concat' x q p = p ∙ q + + infixl 15 _∙ᵣ_ + _∙ᵣ_ : {x y z : A} → x = y → y = z → x = z + p ∙ᵣ refl = p + + coh-concat : + {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q + coh-concat refl refl = refl ``` ### Inverting identifications @@ -194,11 +227,11 @@ module _ where is-injective-concat : - {x y z : A} (p : x = y) {q r : y = z} → (p ∙ q) = (p ∙ r) → q = r + {x y z : A} (p : x = y) {q r : y = z} → p ∙ q = p ∙ r → q = r is-injective-concat refl s = s is-injective-concat' : - {x y z : A} (r : y = z) {p q : x = y} → (p ∙ r) = (q ∙ r) → p = q + {x y z : A} (r : y = z) {p q : x = y} → p ∙ r = q ∙ r → p = q is-injective-concat' refl s = (inv right-unit) ∙ (s ∙ right-unit) ``` From 3def29fd0f9f995ff8081d55dd4b8d75a4feaf8f Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 17:35:40 +0100 Subject: [PATCH 05/39] The judgmentally right unital concatenation operation on identifications --- src/foundation-core/identity-types.lagda.md | 12 +- src/foundation.lagda.md | 1 + ...tal-concatenation-identifications.lagda.md | 175 ++++++++++++++++++ 3 files changed, 179 insertions(+), 9 deletions(-) create mode 100644 src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index 2ae27d9e3a..ca914eabc5 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -116,7 +116,9 @@ While the third option may be preferred by some for its symmetry, for practical reasons, we use the first alternative by convention. See also -[judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md). + +- [judgmentally left unital concatenation operation on indentifications](foundation.judgmentally-left-unital-concatenation-operation-identifications.md) +- [judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) ```agda module _ @@ -132,14 +134,6 @@ module _ concat' : (x : A) {y z : A} → y = z → x = y → x = z concat' x q p = p ∙ q - - infixl 15 _∙ᵣ_ - _∙ᵣ_ : {x y z : A} → x = y → y = z → x = z - p ∙ᵣ refl = p - - coh-concat : - {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q - coh-concat refl refl = refl ``` ### Inverting identifications diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index a927bf8580..db110e83a6 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -206,6 +206,7 @@ open import foundation.iterating-automorphisms public open import foundation.iterating-functions public open import foundation.iterating-involutions public open import foundation.judgmentally-involutive-identity-types public +open import foundation.judgmentally-right-unital-concatenation-identifications public open import foundation.kernel-span-diagrams-of-maps public open import foundation.large-binary-relations public open import foundation.large-dependent-pair-types public diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md new file mode 100644 index 0000000000..e64b69d11f --- /dev/null +++ b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md @@ -0,0 +1,175 @@ +# The judgmentally right unital concatenation operation on identifications + +```agda +module foundation.judgmentally-right-unital-concatenation-identifications where +``` + +
Imports + +```agda +open import foundation.universe-levels +open import foundation-core.identity-types +open import foundation.action-on-identifications-functions +``` + +
+ +## Idea + +The +{{#concept "concatenation operation on identifications" Agda=_∙_ Agda=_∙'_ Agda=concat}} +is a map + +```text + _∙_ : x = y → y = z → x = z +``` + +for all `x y z : A`. However, there are essentially three different ways we can +define concatenation of identifications, all with different computational +behaviours. + +1. We can define concatenation by induction on the equality `x = y`. This gives + us the computation rule `refl ∙ q = q`. +2. We can define concatenation by induction on the equality `y = z`. This gives + us the computation rule `p ∙ refl = p`. +3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only + gives us the computation rule `refl ∙ refl = refl`. + +While the third option may be preferred by some for its symmetry, for practical +reasons, we use the first alternative by convention. + +However, there are cases where the second case may be preferred. Hence, in this +file we consider the +{{#concept "definitionally right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=rconcat Agda=rconcat'}}. + +This definition is for instance used with the +[judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) +to construct a judgmentally left unital concatenation operation. + +## Definition + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ᵣ_ + _∙ᵣ_ : {x y z : A} → x = y → y = z → x = z + p ∙ᵣ refl = p + + rconcat : {x y : A} → x = y → (z : A) → y = z → x = z + rconcat p z q = p ∙ᵣ q + + rconcat' : (x : A) {y z : A} → y = z → x = y → x = z + rconcat' x q p = p ∙ᵣ q +``` + +### Translating between the left and right unital versions of concatenation + +```agda +module _ + {l : Level} {A : UU l} + where + + eq-rconcat-concat : + {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q + eq-rconcat-concat refl refl = refl + + eq-concat-rconcat : + {x y z : A} (p : x = y) (q : y = z) → p ∙ᵣ q = p ∙ q + eq-concat-rconcat p q = inv (eq-rconcat-concat p q) + + eq-double-rconcat-concat-left-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + p ∙ q ∙ r = p ∙ᵣ q ∙ᵣ r + eq-double-rconcat-concat-left-associated p q r = + ap (_∙ r) (eq-rconcat-concat p q) ∙ eq-rconcat-concat (p ∙ᵣ q) r + + eq-double-rconcat-concat-right-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + p ∙ (q ∙ r) = p ∙ᵣ (q ∙ᵣ r) + eq-double-rconcat-concat-right-associated p q r = + ap (p ∙_) (eq-rconcat-concat q r) ∙ eq-rconcat-concat p (q ∙ᵣ r) + + eq-double-concat-rconcat-left-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + p ∙ᵣ q ∙ᵣ r = p ∙ q ∙ r + eq-double-concat-rconcat-left-associated p q r = + ap (_∙ᵣ r) (eq-concat-rconcat p q) ∙ eq-concat-rconcat (p ∙ q) r + + eq-double-concat-rconcat-right-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + p ∙ᵣ (q ∙ᵣ r) = p ∙ (q ∙ r) + eq-double-concat-rconcat-right-associated p q r = + ap (p ∙ᵣ_) (eq-concat-rconcat q r) ∙ eq-concat-rconcat p (q ∙ r) +``` + +## Properties + +### The groupoidal laws + +```agda +module _ + {l : Level} {A : UU l} + where + + assoc-rconcat : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + ((p ∙ᵣ q) ∙ᵣ r) = (p ∙ᵣ (q ∙ᵣ r)) + assoc-rconcat p q refl = refl + + left-unit-rconcat : {x y : A} {p : x = y} → refl ∙ᵣ p = p + left-unit-rconcat {p = refl} = refl + + right-unit-rconcat : {x y : A} {p : x = y} → p ∙ᵣ refl = p + right-unit-rconcat = refl + + left-inv-rconcat : {x y : A} (p : x = y) → inv p ∙ᵣ p = refl + left-inv-rconcat refl = refl + + right-inv-rconcat : {x y : A} (p : x = y) → p ∙ᵣ (inv p) = refl + right-inv-rconcat refl = refl + + inv-inv-rconcat : {x y : A} (p : x = y) → inv (inv p) = p + inv-inv-rconcat refl = refl + + distributive-inv-rconcat : + {x y : A} (p : x = y) {z : A} (q : y = z) → + inv (p ∙ᵣ q) = inv q ∙ᵣ inv p + distributive-inv-rconcat refl refl = refl +``` + +### Transposing inverses + +```agda +module _ + {l : Level} {A : UU l} + where + + left-transpose-eq-rconcat : + {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → + p ∙ᵣ q = r → q = inv p ∙ᵣ r + left-transpose-eq-rconcat refl q r s = + (inv left-unit-rconcat ∙ s) ∙ inv left-unit-rconcat + + right-transpose-eq-rconcat : + {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → + p ∙ᵣ q = r → p = r ∙ᵣ inv q + right-transpose-eq-rconcat p refl r s = s +``` + +### Concatenation is injective + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + is-injective-rconcat : + {x y z : A} (p : x = y) {q r : y = z} → p ∙ᵣ q = p ∙ᵣ r → q = r + is-injective-rconcat refl s = (inv left-unit-rconcat ∙ s) ∙ left-unit-rconcat + + is-injective-rconcat' : + {x y z : A} (r : y = z) {p q : x = y} → p ∙ᵣ r = q ∙ᵣ r → p = q + is-injective-rconcat' refl s = s +``` From d0f41aaeb434c13f3a28f9154506539c7d1f4a93 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 17:36:26 +0100 Subject: [PATCH 06/39] =?UTF-8?q?judgmental=20left=20unit=20law=20for=20`?= =?UTF-8?q?=5F=E2=88=99=E2=81=BB=5F`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...entally-involutive-identity-types.lagda.md | 86 +++++++++++-------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index e7e13a1930..67290bd075 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -11,6 +11,7 @@ open import foundation.action-on-identifications-functions open import foundation.cartesian-product-types open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types +open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.universal-property-identity-systems open import foundation.universe-levels @@ -203,6 +204,11 @@ module _ ### Concatenation of judgmentally involutive identifications +**Note.** We define the concatenation operation on the judgmentally involutive +identifications using the +[judgmentally right unital concatenation operation on identifications](foundation.judgmentally-right-unital-concatenation-operation-identifications.md), +to obtain a judgmental _left_ unit law. + ```agda module _ {l : Level} {A : UU l} @@ -210,14 +216,36 @@ module _ infixl 15 _∙⁻_ _∙⁻_ : {x y z : A} → x =⁻ y → y =⁻ z → x =⁻ z - (z , p , q) ∙⁻ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) + (z , p , q) ∙⁻ (z' , p' , q') = (z' , p' , (q' ∙ᵣ inv p) ∙ᵣ q) concat-involutive-eq : {x y : A} → x =⁻ y → (z : A) → y =⁻ z → x =⁻ z concat-involutive-eq p z q = p ∙⁻ q concat-involutive-eq' : (x : A) {y z : A} → y =⁻ z → x =⁻ y → x =⁻ z concat-involutive-eq' x q p = p ∙⁻ q +``` + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ₗ⁻_ + _∙ₗ⁻_ : {x y z : A} → x =⁻ y → y =⁻ z → x =⁻ z + (z , p , q) ∙ₗ⁻ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) + lconcat-involutive-eq : {x y : A} → x =⁻ y → (z : A) → y =⁻ z → x =⁻ z + lconcat-involutive-eq p z q = p ∙ₗ⁻ q + + lconcat-involutive-eq' : (x : A) {y z : A} → y =⁻ z → x =⁻ y → x =⁻ z + lconcat-involutive-eq' x q p = p ∙ₗ⁻ q + + eq-concat-lconcat-involutive-Id : + {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → p ∙ₗ⁻ q = p ∙⁻ q + eq-concat-lconcat-involutive-Id (z , p , q) (z' , p' , q') = + eq-pair-eq-pr2 + ( eq-pair-eq-pr2 + ( eq-double-rconcat-concat-left-associated q' (inv p) q)) ``` The concatenation operation corresponds to the standard concatenation operation @@ -233,10 +261,10 @@ module _ involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙⁻ involutive-eq-eq q distributive-concat-involutive-eq-eq refl q = refl - distributive-concat-eq-involutive-eq : + distributive-lconcat-eq-involutive-eq : {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → - eq-involutive-eq (p ∙⁻ q) = eq-involutive-eq p ∙ eq-involutive-eq q - distributive-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = + eq-involutive-eq (p ∙ₗ⁻ q) = eq-involutive-eq p ∙ eq-involutive-eq q + distributive-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q') = ( ap ( _∙ p') ( ( distributive-inv-concat (q' ∙ inv p) q) ∙ @@ -245,6 +273,15 @@ module _ ( distributive-inv-concat q' (inv p) ∙ ap (_∙ inv q') (inv-inv p))) ∙ ( inv (assoc (inv q) p (inv q'))))) ∙ ( assoc (inv q ∙ p) (inv q') p') + + distributive-concat-eq-involutive-eq : + {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → + eq-involutive-eq (p ∙⁻ q) = eq-involutive-eq p ∙ eq-involutive-eq q + distributive-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = + ( ap + ( λ x → inv x ∙ p') + ( eq-double-concat-rconcat-left-associated q' (inv p) q)) ∙ + ( distributive-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q')) ``` ### The groupoidal laws for the judgmentally involutive identity types @@ -260,56 +297,33 @@ module _ assoc-involutive-eq (z , p , q) (z' , p' , q') (z'' , p'' , q'') = eq-pair-eq-pr2 ( eq-pair-eq-pr2 - ( ( inv (assoc (q'' ∙ inv p') (q' ∙ inv p) q)) ∙ - ( ap (_∙ q) (inv (assoc (q'' ∙ inv p') q' (inv p)))))) + ( ( inv (assoc-rconcat (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ + ( ap (_∙ᵣ q) (inv (assoc-rconcat (q'' ∙ᵣ inv p') q' (inv p)))))) left-unit-involutive-eq : {x y : A} {p : x =⁻ y} → refl-involutive-Id ∙⁻ p = p - left-unit-involutive-eq = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-unit)) + left-unit-involutive-eq = refl right-unit-involutive-eq : {x y : A} {p : x =⁻ y} → p ∙⁻ refl-involutive-Id = p - right-unit-involutive-eq {p = z , refl , q} = refl + right-unit-involutive-eq {p = z , refl , q} = + eq-pair-eq-pr2 (eq-pair-eq-pr2 left-unit-rconcat) left-inv-involutive-eq : {x y : A} (p : x =⁻ y) → inv-involutive-eq p ∙⁻ p = refl-involutive-Id left-inv-involutive-eq (z , refl , q) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-inv q)) + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-rconcat q)) right-inv-involutive-eq : {x y : A} (p : x =⁻ y) → p ∙⁻ inv-involutive-eq p = refl-involutive-Id right-inv-involutive-eq (z , p , refl) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-unit ∙ right-inv p)) + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-rconcat p)) distributive-inv-concat-involutive-eq : {x y : A} (p : x =⁻ y) {z : A} (q : y =⁻ z) → inv-involutive-eq (p ∙⁻ q) = inv-involutive-eq q ∙⁻ inv-involutive-eq p - distributive-inv-concat-involutive-eq (z , refl , q) (.z , p' , refl) = refl -``` - -### Transposing inverses of judgmentally involutive identifications - -```agda -module _ - {l : Level} {A : UU l} - where - - left-transpose-eq-concat-involutive-eq : - {x y : A} (p : x =⁻ y) {z : A} (q : y =⁻ z) (r : x =⁻ z) → - p ∙⁻ q = r → q = inv-involutive-eq p ∙⁻ r - left-transpose-eq-concat-involutive-eq - ( z , p , q) (z' , refl , q') (.z' , refl , q'') refl = - eq-pair-eq-pr2 - ( eq-pair-eq-pr2 - ( ( inv right-unit) ∙ - ( ap - ( q' ∙_) - ( ( inv (left-inv p)) ∙ - ( ap (λ x → inv p ∙ (x ∙ p)) (inv (right-inv q))))) ∙ - ( ( inv (assoc q' (inv p) (q ∙ inv q ∙ p))) ∙ - ( inv (assoc (q' ∙ inv p) (q ∙ inv q) p)) ∙ - ( ap (_∙ p) (inv (assoc (q' ∙ inv p) q (inv q))))))) + distributive-inv-concat-involutive-eq (z , refl , refl) (z' , p' , refl) = + eq-pair-eq-pr2 (eq-pair-eq-pr2 (inv left-unit-rconcat)) ``` ## References From 43a71e3d2f12dfd9247eefc200388773ef6cdcb9 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 17:38:20 +0100 Subject: [PATCH 07/39] pre-commit --- ...entally-right-unital-concatenation-identifications.lagda.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md index e64b69d11f..f7c3e75efa 100644 --- a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md @@ -7,9 +7,10 @@ module foundation.judgmentally-right-unital-concatenation-identifications where
Imports ```agda +open import foundation.action-on-identifications-functions open import foundation.universe-levels + open import foundation-core.identity-types -open import foundation.action-on-identifications-functions ```
From 1a9d35c19284741116cea47b2fad6da8072cacaf Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 31 Jan 2024 17:38:35 +0100 Subject: [PATCH 08/39] merge --- src/foundation/judgmentally-involutive-identity-types.lagda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index 67290bd075..5520cc91fc 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -144,7 +144,7 @@ module _ is-contr-equiv ( Σ A (x =_)) ( equiv-tot (λ y → equiv-eq-involutive-eq {x = x} {y})) - ( is-torsorial-path x) + ( is-torsorial-Id x) dependent-universal-property-identity-system-involutive-Id : dependent-universal-property-identity-system From c5a6004da86d9dd2934a3eec270830b05d1fbb09 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 13:09:38 +0100 Subject: [PATCH 09/39] naming fixes judgmentally involutive identity types --- src/foundation-core/identity-types.lagda.md | 2 +- ...entally-involutive-identity-types.lagda.md | 184 +++++++++++------- 2 files changed, 111 insertions(+), 75 deletions(-) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index ca914eabc5..ad5208f1d3 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -117,7 +117,7 @@ reasons, we use the first alternative by convention. See also -- [judgmentally left unital concatenation operation on indentifications](foundation.judgmentally-left-unital-concatenation-operation-identifications.md) +- [judgmentally right unital concatenation operation on indentifications](foundation.judgmentally-right-unital-concatenation-operation-identifications.md) - [judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) ```agda diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index 5520cc91fc..e4d1e2e932 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -12,6 +12,7 @@ open import foundation.cartesian-product-types open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.judgmentally-right-unital-concatenation-identifications +open import foundation.multivariable-homotopies open import foundation.universal-property-identity-systems open import foundation.universe-levels @@ -38,7 +39,7 @@ In this file, we consider the {{#concept "judgmentally involutive identity types" Agda=involutive-Id}} ```text - (x =⁻ y) := Σ (z : A) ((z = y) × (z = x)) + (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) ``` This type family is [equivalent](foundation-core.equivalences.md) to the @@ -60,11 +61,11 @@ module _ involutive-Id : (x y : A) → UU l involutive-Id x y = Σ A (λ z → (z = y) × (z = x)) - infix 6 _=⁻_ - _=⁻_ : A → A → UU l - (a =⁻ b) = involutive-Id a b + infix 6 _=ⁱ_ + _=ⁱ_ : A → A → UU l + (a =ⁱ b) = involutive-Id a b - refl-involutive-Id : {x : A} → x =⁻ x + refl-involutive-Id : {x : A} → x =ⁱ x refl-involutive-Id {x} = (x , refl , refl) ``` @@ -80,10 +81,10 @@ module _ {l : Level} {A : UU l} {x y : A} where - involutive-eq-eq : x = y → x =⁻ y + involutive-eq-eq : x = y → x =ⁱ y involutive-eq-eq p = (x , p , refl) - eq-involutive-eq : x =⁻ y → x = y + eq-involutive-eq : x =ⁱ y → x = y eq-involutive-eq (z , p , q) = inv q ∙ p is-section-eq-involutive-eq : is-section involutive-eq-eq eq-involutive-eq @@ -105,11 +106,11 @@ module _ pr1 (pr2 is-equiv-eq-involutive-eq) = involutive-eq-eq pr2 (pr2 is-equiv-eq-involutive-eq) = is-section-eq-involutive-eq - equiv-involutive-eq-eq : (x = y) ≃ (x =⁻ y) + equiv-involutive-eq-eq : (x = y) ≃ (x =ⁱ y) pr1 equiv-involutive-eq-eq = involutive-eq-eq pr2 equiv-involutive-eq-eq = is-equiv-involutive-eq-eq - equiv-eq-involutive-eq : (x =⁻ y) ≃ (x = y) + equiv-eq-involutive-eq : (x =ⁱ y) ≃ (x = y) pr1 equiv-eq-involutive-eq = eq-involutive-eq pr2 equiv-eq-involutive-eq = is-equiv-eq-involutive-eq @@ -130,10 +131,14 @@ module _ The judgementally involutive identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of -types over the identity types based at `x`, `B : (y : A) (p : x =⁻ y) → UU l2`, -then to construct a dependent function `f : (y : A) (p : x =⁻ y) → B y p` it +types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, +then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it suffices to define it at `f x refl-involutive-Id`. +**Note.** The only reason we must apply +[function extensionality](foundation.function-extensionality.md) is to show +uniqueness of the induction principle up to _equality_. + ```agda module _ {l : Level} {A : UU l} {x : A} @@ -155,11 +160,24 @@ module _ ( refl-involutive-Id) ( is-torsorial-involutive-Id) +module _ + {l1 l2 : Level} {A : UU l1} + (x : A) (B : (y : A) (p : x =ⁱ y) → UU l2) + where + ind-involutive-Id : - {l1 l2 : Level} {A : UU l1} - (x : A) (B : (y : A) (p : x =⁻ y) → UU l2) → - (B x refl-involutive-Id) → (y : A) (p : x =⁻ y) → B y p - ind-involutive-Id x B b .x (.x , refl , refl) = b + B x refl-involutive-Id → (y : A) (p : x =ⁱ y) → B y p + ind-involutive-Id b .x (.x , refl , refl) = b + + compute-ind-involutive-Id : + (b : B x refl-involutive-Id) → ind-involutive-Id b x refl-involutive-Id = b + compute-ind-involutive-Id b = refl + + uniqueness-ind-involutive-Id : + (f : (y : A) (p : x =ⁱ y) → B y p) → + ind-involutive-Id (f x refl-involutive-Id) = f + uniqueness-ind-involutive-Id f = + eq-multivariable-htpy 2 (λ where .x (.x , refl , refl) → refl) ``` ## Structure @@ -169,17 +187,35 @@ groupoidal structure on types. ### Inverting judgmentally involutive identifications +We have an inversion operation on `involutive-Id` that satisfies the judgmental +laws + +```text + inv (inv p) = p +``` + +and + +```text + inv refl = refl. +``` + ```agda module _ {l : Level} {A : UU l} where - inv-involutive-eq : {x y : A} → x =⁻ y → y =⁻ x - inv-involutive-eq (z , p , q) = (z , q , p) + inv-involutive-Id : {x y : A} → x =ⁱ y → y =ⁱ x + inv-involutive-Id (z , p , q) = (z , q , p) + + compute-inv-involutive-Id-refl : + {x : A} → + inv-involutive-Id (refl-involutive-Id {x = x}) = refl-involutive-Id + compute-inv-involutive-Id-refl = refl - inv-inv-involutive-eq : - {x y : A} (p : x =⁻ y) → inv-involutive-eq (inv-involutive-eq p) = p - inv-inv-involutive-eq p = refl + inv-inv-involutive-Id : + {x y : A} (p : x =ⁱ y) → inv-involutive-Id (inv-involutive-Id p) = p + inv-inv-involutive-Id p = refl ``` The inversion operation corresponds to the standard inversion operation on @@ -190,15 +226,15 @@ module _ {l : Level} {A : UU l} where - distributive-inv-involutive-eq-eq : + commutative-inv-involutive-eq-eq : {x y : A} (p : x = y) → - involutive-eq-eq (inv p) = inv-involutive-eq (involutive-eq-eq p) - distributive-inv-involutive-eq-eq refl = refl + involutive-eq-eq (inv p) = inv-involutive-Id (involutive-eq-eq p) + commutative-inv-involutive-eq-eq refl = refl - distributive-inv-eq-involutive-eq : - {x y : A} (p : x =⁻ y) → - eq-involutive-eq (inv-involutive-eq p) = inv (eq-involutive-eq p) - distributive-inv-eq-involutive-eq (z , p , q) = + commutative-inv-eq-involutive-eq : + {x y : A} (p : x =ⁱ y) → + eq-involutive-eq (inv-involutive-Id p) = inv (eq-involutive-eq p) + commutative-inv-eq-involutive-eq (z , p , q) = ap (inv p ∙_) (inv (inv-inv q)) ∙ inv (distributive-inv-concat (inv q) p) ``` @@ -214,15 +250,15 @@ module _ {l : Level} {A : UU l} where - infixl 15 _∙⁻_ - _∙⁻_ : {x y z : A} → x =⁻ y → y =⁻ z → x =⁻ z - (z , p , q) ∙⁻ (z' , p' , q') = (z' , p' , (q' ∙ᵣ inv p) ∙ᵣ q) + infixl 15 _∙ⁱ_ + _∙ⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z + (z , p , q) ∙ⁱ (z' , p' , q') = (z' , p' , (q' ∙ᵣ inv p) ∙ᵣ q) - concat-involutive-eq : {x y : A} → x =⁻ y → (z : A) → y =⁻ z → x =⁻ z - concat-involutive-eq p z q = p ∙⁻ q + concat-involutive-Id : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z + concat-involutive-Id p z q = p ∙ⁱ q - concat-involutive-eq' : (x : A) {y z : A} → y =⁻ z → x =⁻ y → x =⁻ z - concat-involutive-eq' x q p = p ∙⁻ q + concat-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z + concat-involutive-Id' x q p = p ∙ⁱ q ``` ```agda @@ -230,18 +266,18 @@ module _ {l : Level} {A : UU l} where - infixl 15 _∙ₗ⁻_ - _∙ₗ⁻_ : {x y z : A} → x =⁻ y → y =⁻ z → x =⁻ z - (z , p , q) ∙ₗ⁻ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) + infixl 15 _∙ₗⁱ_ + _∙ₗⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z + (z , p , q) ∙ₗⁱ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) - lconcat-involutive-eq : {x y : A} → x =⁻ y → (z : A) → y =⁻ z → x =⁻ z - lconcat-involutive-eq p z q = p ∙ₗ⁻ q + lconcat-involutive-Id : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z + lconcat-involutive-Id p z q = p ∙ₗⁱ q - lconcat-involutive-eq' : (x : A) {y z : A} → y =⁻ z → x =⁻ y → x =⁻ z - lconcat-involutive-eq' x q p = p ∙ₗ⁻ q + lconcat-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z + lconcat-involutive-Id' x q p = p ∙ₗⁱ q eq-concat-lconcat-involutive-Id : - {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → p ∙ₗ⁻ q = p ∙⁻ q + {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → p ∙ₗⁱ q = p ∙ⁱ q eq-concat-lconcat-involutive-Id (z , p , q) (z' , p' , q') = eq-pair-eq-pr2 ( eq-pair-eq-pr2 @@ -256,15 +292,15 @@ module _ {l : Level} {A : UU l} where - distributive-concat-involutive-eq-eq : + commutative-concat-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → - involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙⁻ involutive-eq-eq q - distributive-concat-involutive-eq-eq refl q = refl + involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ⁱ involutive-eq-eq q + commutative-concat-involutive-eq-eq refl q = refl - distributive-lconcat-eq-involutive-eq : - {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → - eq-involutive-eq (p ∙ₗ⁻ q) = eq-involutive-eq p ∙ eq-involutive-eq q - distributive-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q') = + commutative-lconcat-eq-involutive-eq : + {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → + eq-involutive-eq (p ∙ₗⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q + commutative-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q') = ( ap ( _∙ p') ( ( distributive-inv-concat (q' ∙ inv p) q) ∙ @@ -274,14 +310,14 @@ module _ ( inv (assoc (inv q) p (inv q'))))) ∙ ( assoc (inv q ∙ p) (inv q') p') - distributive-concat-eq-involutive-eq : - {x y z : A} (p : x =⁻ y) (q : y =⁻ z) → - eq-involutive-eq (p ∙⁻ q) = eq-involutive-eq p ∙ eq-involutive-eq q - distributive-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = + commutative-concat-eq-involutive-eq : + {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → + eq-involutive-eq (p ∙ⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q + commutative-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = ( ap ( λ x → inv x ∙ p') ( eq-double-concat-rconcat-left-associated q' (inv p) q)) ∙ - ( distributive-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q')) + ( commutative-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q')) ``` ### The groupoidal laws for the judgmentally involutive identity types @@ -291,38 +327,38 @@ module _ {l : Level} {A : UU l} where - assoc-involutive-eq : - {x y z w : A} (p : x =⁻ y) (q : y =⁻ z) (r : z =⁻ w) → - ((p ∙⁻ q) ∙⁻ r) = (p ∙⁻ (q ∙⁻ r)) - assoc-involutive-eq (z , p , q) (z' , p' , q') (z'' , p'' , q'') = + assoc-involutive-Id : + {x y z w : A} (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → + ((p ∙ⁱ q) ∙ⁱ r) = (p ∙ⁱ (q ∙ⁱ r)) + assoc-involutive-Id (z , p , q) (z' , p' , q') (z'' , p'' , q'') = eq-pair-eq-pr2 ( eq-pair-eq-pr2 ( ( inv (assoc-rconcat (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ ( ap (_∙ᵣ q) (inv (assoc-rconcat (q'' ∙ᵣ inv p') q' (inv p)))))) - left-unit-involutive-eq : - {x y : A} {p : x =⁻ y} → refl-involutive-Id ∙⁻ p = p - left-unit-involutive-eq = refl + left-unit-involutive-Id : + {x y : A} {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p + left-unit-involutive-Id = refl - right-unit-involutive-eq : - {x y : A} {p : x =⁻ y} → p ∙⁻ refl-involutive-Id = p - right-unit-involutive-eq {p = z , refl , q} = + right-unit-involutive-Id : + {x y : A} {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p + right-unit-involutive-Id {p = z , refl , q} = eq-pair-eq-pr2 (eq-pair-eq-pr2 left-unit-rconcat) - left-inv-involutive-eq : - {x y : A} (p : x =⁻ y) → inv-involutive-eq p ∙⁻ p = refl-involutive-Id - left-inv-involutive-eq (z , refl , q) = + left-inv-involutive-Id : + {x y : A} (p : x =ⁱ y) → inv-involutive-Id p ∙ⁱ p = refl-involutive-Id + left-inv-involutive-Id (z , refl , q) = eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-rconcat q)) - right-inv-involutive-eq : - {x y : A} (p : x =⁻ y) → p ∙⁻ inv-involutive-eq p = refl-involutive-Id - right-inv-involutive-eq (z , p , refl) = + right-inv-involutive-Id : + {x y : A} (p : x =ⁱ y) → p ∙ⁱ inv-involutive-Id p = refl-involutive-Id + right-inv-involutive-Id (z , p , refl) = eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-rconcat p)) - distributive-inv-concat-involutive-eq : - {x y : A} (p : x =⁻ y) {z : A} (q : y =⁻ z) → - inv-involutive-eq (p ∙⁻ q) = inv-involutive-eq q ∙⁻ inv-involutive-eq p - distributive-inv-concat-involutive-eq (z , refl , refl) (z' , p' , refl) = + distributive-inv-concat-involutive-Id : + {x y : A} (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → + inv-involutive-Id (p ∙ⁱ q) = inv-involutive-Id q ∙ⁱ inv-involutive-Id p + distributive-inv-concat-involutive-Id (z , refl , refl) (z' , p' , refl) = eq-pair-eq-pr2 (eq-pair-eq-pr2 (inv left-unit-rconcat)) ``` From 58dfbfc100f7ddf08bcfc90c5665fc18b0fab72f Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 13:27:05 +0100 Subject: [PATCH 10/39] Judgmentally compositional identity types --- src/foundation.lagda.md | 1 + ...ally-compositional-identity-types.lagda.md | 465 ++++++++++++++++++ ...tal-concatenation-identifications.lagda.md | 4 + .../symmetric-identity-types.lagda.md | 2 +- ...universal-property-identity-types.lagda.md | 12 +- 5 files changed, 482 insertions(+), 2 deletions(-) create mode 100644 src/foundation/judgmentally-compositional-identity-types.lagda.md diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index db110e83a6..c95f8c7e4f 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -205,6 +205,7 @@ open import foundation.iterated-dependent-product-types public open import foundation.iterating-automorphisms public open import foundation.iterating-functions public open import foundation.iterating-involutions public +open import foundation.judgmentally-compositional-identity-types public open import foundation.judgmentally-involutive-identity-types public open import foundation.judgmentally-right-unital-concatenation-identifications public open import foundation.kernel-span-diagrams-of-maps public diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md new file mode 100644 index 0000000000..543e5408e7 --- /dev/null +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -0,0 +1,465 @@ +# Judgmentally compositional identity types + +```agda +module foundation.judgmentally-compositional-identity-types where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.cartesian-product-types +open import foundation.dependent-pair-types +open import foundation.equality-cartesian-product-types +open import foundation.function-extensionality +open import foundation.fundamental-theorem-of-identity-types +open import foundation.judgmentally-right-unital-concatenation-identifications +open import foundation.multivariable-homotopies +open import foundation.universal-property-identity-systems +open import foundation.universe-levels + +open import foundation-core.contractible-types +open import foundation-core.equality-dependent-pair-types +open import foundation-core.equivalences +open import foundation-core.function-types +open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.identity-types +open import foundation-core.retractions +open import foundation-core.sections +open import foundation-core.torsorial-type-families +``` + +
+ +## Idea + +The [standard definition of identity types](foundation-core.identity-types.md) +suffer the limitation that many of the basic operations only satisfy algebraic +laws _weakly_. + +In this file, we consider the +{{#concept "judgmentally compositional identity types" Agda=compositional-Id}} + +```text + (x =ᶜ y) := (z : A) → (z = x) → (z = y) +``` + +This type family is [equivalent](foundation-core.equivalences.md) to the +standard identity types, but satisfies the laws + +- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` +- `refl ∙ p = p` +- `p ∙ refl = p` + +judgmentally. This is achieved by proxiyng to, and using the computational +properties of function composition, and relies heavily on the +[function extensionality axiom](foundation.function-extensionality.md). + +## Definition + +```agda +module _ + {l : Level} {A : UU l} + where + + compositional-Id : (x y : A) → UU l + compositional-Id x y = (z : A) → z = x → z = y + + infix 6 _=ᶜ_ + _=ᶜ_ : A → A → UU l + (a =ᶜ b) = compositional-Id a b + + refl-compositional-Id : {x : A} → x =ᶜ x + refl-compositional-Id {x} z = id +``` + +## Properties + +### Elements of the judgmentally compositional identity type act as postconcatenation operations + +```agda +module _ + {l : Level} {A : UU l} + where + + commutative-concat-Id-compositional-Id : + {x y z w : A} (f : x =ᶜ y) (p : w = z) (q : z = x) → + f w (p ∙ q) = p ∙ f z q + commutative-concat-Id-compositional-Id f refl q = refl + + commutative-concat-refl-Id-compositional-Id : + {x y z : A} (f : x =ᶜ y) (q : z = x) → f z q = q ∙ f x refl + commutative-concat-refl-Id-compositional-Id {z = z} f q = + ap (f z) (inv right-unit) ∙ commutative-concat-Id-compositional-Id f q refl + + commutative-rconcat-Id-compositional-Id : + {x y z w : A} (f : x =ᶜ y) (p : w = z) (q : z = x) → + f w (p ∙ᵣ q) = p ∙ᵣ f z q + commutative-rconcat-Id-compositional-Id f refl refl = inv left-unit-rconcat + + commutative-rconcat-refl-Id-compositional-Id : + {x y z : A} (f : x =ᶜ y) (q : z = x) → f z q = q ∙ᵣ f x refl + commutative-rconcat-refl-Id-compositional-Id f q = + commutative-rconcat-Id-compositional-Id f q refl + + compute-inv-Id-compositional-Id : + {x y : A} (f : x =ᶜ y) → f y (inv (f x refl)) = refl + compute-inv-Id-compositional-Id {x} f = + ( commutative-concat-refl-Id-compositional-Id f (inv (f x refl))) ∙ + ( left-inv (f x refl)) + + compute-inv-Id-compositional-Id' : + {x y z : A} (f : x =ᶜ y) (p : x = x) → + f y (inv (f x p)) = f y (inv (f x refl) ∙ inv p) + compute-inv-Id-compositional-Id' {x} {y} f p = + ap + ( f y) + ( ( ap inv (commutative-concat-refl-Id-compositional-Id f p)) ∙ + ( distributive-inv-concat p (f x refl))) +``` + +### The judgmentally compositional identity types are equivalent to the standard identity types + +We define the equivalence `compositional-eq-eq : x = y → x =ᶜ y` using the +judgmentally right unital concatenation operation on identifications. While this +makes the proof it is a section non-judgmental, it instead gives us the +judgmental computation rules + +```text + compositional-eq-eq refl = refl-compositional-Id +``` + +and + +```text + eq-compositional-eq refl-compositional-Id = refl. +``` + +The proof that it is a retraction requires the +[function extensionality axiom](foundation.function-extensionality.md). However, +function extensionality will become indispensable regardless when we move to +proving miscellaneous algebraic laws of the type family. + +```agda +module _ + {l : Level} {A : UU l} {x y : A} + where + + compositional-eq-eq : x = y → x =ᶜ y + compositional-eq-eq p z q = q ∙ᵣ p + + eq-compositional-eq : x =ᶜ y → x = y + eq-compositional-eq f = f x refl + + is-section-eq-compositional-eq : + is-section compositional-eq-eq eq-compositional-eq + is-section-eq-compositional-eq f = + eq-multivariable-htpy 2 + ( λ z p → inv (commutative-rconcat-refl-Id-compositional-Id f p)) + + is-retraction-eq-compositional-eq : + is-retraction compositional-eq-eq eq-compositional-eq + is-retraction-eq-compositional-eq p = left-unit-rconcat + + is-equiv-compositional-eq-eq : is-equiv compositional-eq-eq + pr1 (pr1 is-equiv-compositional-eq-eq) = eq-compositional-eq + pr2 (pr1 is-equiv-compositional-eq-eq) = is-section-eq-compositional-eq + pr1 (pr2 is-equiv-compositional-eq-eq) = eq-compositional-eq + pr2 (pr2 is-equiv-compositional-eq-eq) = is-retraction-eq-compositional-eq + + is-equiv-eq-compositional-eq : is-equiv eq-compositional-eq + pr1 (pr1 is-equiv-eq-compositional-eq) = compositional-eq-eq + pr2 (pr1 is-equiv-eq-compositional-eq) = is-retraction-eq-compositional-eq + pr1 (pr2 is-equiv-eq-compositional-eq) = compositional-eq-eq + pr2 (pr2 is-equiv-eq-compositional-eq) = is-section-eq-compositional-eq + + equiv-compositional-eq-eq : (x = y) ≃ (x =ᶜ y) + pr1 equiv-compositional-eq-eq = compositional-eq-eq + pr2 equiv-compositional-eq-eq = is-equiv-compositional-eq-eq + + equiv-eq-compositional-eq : (x =ᶜ y) ≃ (x = y) + pr1 equiv-eq-compositional-eq = eq-compositional-eq + pr2 equiv-eq-compositional-eq = is-equiv-eq-compositional-eq + +module _ + {l : Level} {A : UU l} + where + + compute-compositional-eq-eq-refl : + {x : A} → compositional-eq-eq (refl {x = x}) = refl-compositional-Id + compute-compositional-eq-eq-refl = refl + + compute-eq-compositional-eq-refl : + {x : A} → eq-compositional-eq (refl-compositional-Id {x = x}) = refl + compute-eq-compositional-eq-refl = refl +``` + +An alternative definition of `compositional-eq-eq'` using the judgmentally left +unital concatenation operation on standard identity types. + +```agda +module _ + {l : Level} {A : UU l} {x y : A} + where + + compositional-eq-eq' : x = y → x =ᶜ y + compositional-eq-eq' p z q = q ∙ p + + is-section-eq-compositional-eq' : + is-section compositional-eq-eq' eq-compositional-eq + is-section-eq-compositional-eq' f = + eq-multivariable-htpy 2 + ( λ z p → inv (commutative-concat-refl-Id-compositional-Id f p)) + + is-retraction-eq-compositional-eq' : + is-retraction compositional-eq-eq' eq-compositional-eq + is-retraction-eq-compositional-eq' p = refl + +module _ + {l : Level} {A : UU l} + where + + compute-compositional-eq-eq-refl' : + {x : A} → compositional-eq-eq' (refl {x = x}) = refl-compositional-Id + compute-compositional-eq-eq-refl' = + eq-multivariable-htpy 2 (λ z p → right-unit) +``` + +### The induction principle for judgmentally compositional identity types + +The judgementally compositional identity types satisfy the induction principle +of the identity types. This states that given a base point `x : A` and a family +of types over the identity types based at `x`, +`B : (y : A) (p : x =ᶜ y) → UU l2`, then to construct a dependent function +`f : (y : A) (p : x =ᶜ y) → B y p` it suffices to define it at +`f x refl-compositional-Id`. + +**Note.** A drawback of the judgmentally compositional identity types is that +they do not satisfy a judgmental computation rule for this induction principle. + +```agda +module _ + {l : Level} {A : UU l} {x : A} + where + + is-torsorial-compositional-Id : is-torsorial (compositional-Id x) + is-torsorial-compositional-Id = + is-contr-equiv + ( Σ A (x =_)) + ( equiv-tot (λ y → equiv-eq-compositional-eq {x = x} {y})) + ( is-torsorial-Id x) + + dependent-universal-property-identity-system-compositional-Id : + dependent-universal-property-identity-system + ( compositional-Id x) + ( refl-compositional-Id) + dependent-universal-property-identity-system-compositional-Id = + dependent-universal-property-identity-system-is-torsorial + ( refl-compositional-Id) + ( is-torsorial-compositional-Id) + +module _ + {l1 l2 : Level} {A : UU l1} {x : A} + {B : (y : A) (p : x =ᶜ y) → UU l2} + where + + ind-compositional-Id : + (b : B x refl-compositional-Id) {y : A} (p : x =ᶜ y) → B y p + ind-compositional-Id b {y} = + map-inv-is-equiv + ( dependent-universal-property-identity-system-compositional-Id B) + ( b) + ( y) + + compute-ind-compositional-Id : + (b : B x refl-compositional-Id) → + ind-compositional-Id b refl-compositional-Id = b + compute-ind-compositional-Id = + is-section-map-inv-is-equiv + ( dependent-universal-property-identity-system-compositional-Id B) + + uniqueness-ind-compositional-Id : + (f : (y : A) (p : x =ᶜ y) → B y p) → + (λ y → ind-compositional-Id (f x refl-compositional-Id) {y}) = f + uniqueness-ind-compositional-Id = + is-retraction-map-inv-is-equiv + ( dependent-universal-property-identity-system-compositional-Id B) +``` + +## Structure + +The judgementally compositional identity types form a judgmentally compositional +weak groupoidal structure on types. + +### Inverting judgmentally compositional identifications + +```agda +module _ + {l : Level} {A : UU l} + where + + inv-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x + inv-compositional-Id {x} f z p = p ∙ inv (f x refl) + + compute-inv-compositional-Id-refl : + {x : A} → + inv-compositional-Id (refl-compositional-Id {x = x}) = + refl-compositional-Id + compute-inv-compositional-Id-refl = + eq-multivariable-htpy 2 (λ z p → right-unit) + + inv-inv-compositional-Id : + {x y : A} (p : x =ᶜ y) → inv-compositional-Id (inv-compositional-Id p) = p + inv-inv-compositional-Id {x} f = + eq-multivariable-htpy 2 + ( λ w p → + ap (p ∙_) (inv-inv (f x refl)) ∙ + inv (commutative-concat-refl-Id-compositional-Id f p)) +``` + +```agda +module _ + {l : Level} {A : UU l} + where + + inv-compositional-Id' : {x y : A} → x =ᶜ y → y =ᶜ x + inv-compositional-Id' {x} f z p = p ∙ᵣ inv (f x refl) + + compute-inv-compositional-Id-refl' : + {x : A} → + inv-compositional-Id' (refl-compositional-Id {x = x}) = + refl-compositional-Id + compute-inv-compositional-Id-refl' = refl + + inv-inv-compositional-Id' : + {x y : A} (p : x =ᶜ y) → + inv-compositional-Id' (inv-compositional-Id' p) = p + inv-inv-compositional-Id' {x} f = + eq-multivariable-htpy 2 + ( λ w p → + ( ap (p ∙ᵣ_) (ap inv left-unit-rconcat ∙ inv-inv (f x refl))) ∙ + ( inv (commutative-rconcat-refl-Id-compositional-Id f p))) +``` + +The inversion operation corresponds to the standard inversion operation on +identifications: + +```agda +module _ + {l : Level} {A : UU l} + where + + commutative-inv-compositional-eq-eq : + {x y : A} (p : x = y) → + compositional-eq-eq (inv p) = inv-compositional-Id (compositional-eq-eq p) + commutative-inv-compositional-eq-eq p = + eq-multivariable-htpy 2 + ( λ z q → + ( eq-concat-rconcat q (inv p)) ∙ + ( ap (λ x → q ∙ inv x) (inv left-unit-rconcat))) + + commutative-inv-eq-compositional-eq : + {x y : A} (p : x =ᶜ y) → + eq-compositional-eq (inv-compositional-Id p) = inv (eq-compositional-eq p) + commutative-inv-eq-compositional-eq f = refl +``` + +### Concatenation of judgmentally compositional identifications + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ᶜ_ + _∙ᶜ_ : {x y z : A} → x =ᶜ y → y =ᶜ z → x =ᶜ z + (f ∙ᶜ g) z p = g z (f z p) + + concat-compositional-Id : {x y : A} → x =ᶜ y → (z : A) → y =ᶜ z → x =ᶜ z + concat-compositional-Id p z q = p ∙ᶜ q + + concat-compositional-Id' : (x : A) {y z : A} → y =ᶜ z → x =ᶜ y → x =ᶜ z + concat-compositional-Id' x q p = p ∙ᶜ q +``` + +The concatenation operation corresponds to the standard concatenation operation +on identifications: + +```agda +module _ + {l : Level} {A : UU l} + where + + commutative-concat-compositional-eq-eq : + {x y z : A} (p : x = y) (q : y = z) → + compositional-eq-eq (p ∙ q) = compositional-eq-eq p ∙ᶜ compositional-eq-eq q + commutative-concat-compositional-eq-eq refl refl = refl + + commutative-concat-eq-compositional-eq : + {x y z : A} (p : x =ᶜ y) (q : y =ᶜ z) → + eq-compositional-eq (p ∙ᶜ q) = eq-compositional-eq p ∙ eq-compositional-eq q + commutative-concat-eq-compositional-eq {x} {y} {z} f g = + commutative-concat-refl-Id-compositional-Id g (f x refl) +``` + +### The groupoidal laws for the judgmentally compositional identity types + +```agda +module _ + {l : Level} {A : UU l} + where + + assoc-compositional-Id : + {x y z w : A} (p : x =ᶜ y) (q : y =ᶜ z) (r : z =ᶜ w) → + ((p ∙ᶜ q) ∙ᶜ r) = (p ∙ᶜ (q ∙ᶜ r)) + assoc-compositional-Id f g h = refl + + left-unit-compositional-Id : + {x y : A} {p : x =ᶜ y} → refl-compositional-Id ∙ᶜ p = p + left-unit-compositional-Id = refl + + right-unit-compositional-Id : + {x y : A} {p : x =ᶜ y} → p ∙ᶜ refl-compositional-Id = p + right-unit-compositional-Id = refl + + left-inv-compositional-Id : + {x y : A} (p : x =ᶜ y) → + inv-compositional-Id p ∙ᶜ p = refl-compositional-Id + left-inv-compositional-Id {x} f = + eq-multivariable-htpy 2 + ( λ z p → + ( commutative-concat-Id-compositional-Id f p (inv (f x refl))) ∙ + ( ap (p ∙_) (compute-inv-Id-compositional-Id f) ∙ right-unit)) + + right-inv-compositional-Id : + {x y : A} (p : x =ᶜ y) → + p ∙ᶜ inv-compositional-Id p = refl-compositional-Id + right-inv-compositional-Id {x} f = + eq-multivariable-htpy 2 + ( λ z p → + ( ap + ( _∙ inv (f x refl)) + ( commutative-concat-refl-Id-compositional-Id f p)) ∙ + ( assoc p (f x refl) (inv (f x refl))) ∙ + ( ap (p ∙_) (right-inv (f x refl))) ∙ + ( right-unit)) + + distributive-inv-concat-compositional-Id : + {x y : A} (p : x =ᶜ y) {z : A} (q : y =ᶜ z) → + inv-compositional-Id (p ∙ᶜ q) = + inv-compositional-Id q ∙ᶜ inv-compositional-Id p + distributive-inv-concat-compositional-Id {x} {y} f g = + eq-multivariable-htpy 2 + ( λ z p → + ( ap + ( p ∙_) + ( ( ap + ( inv) + ( commutative-concat-refl-Id-compositional-Id g (f x refl))) ∙ + ( distributive-inv-concat (f x refl) (g y refl)))) ∙ + ( inv (assoc p (inv (g y refl)) (inv (f x refl))))) +``` + +## References + +- diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md index f7c3e75efa..2bd2597ca4 100644 --- a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md @@ -174,3 +174,7 @@ module _ {x y z : A} (r : y = z) {p q : x = y} → p ∙ᵣ r = q ∙ᵣ r → p = q is-injective-rconcat' refl s = s ``` + +## See also + +- [judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) diff --git a/src/foundation/symmetric-identity-types.lagda.md b/src/foundation/symmetric-identity-types.lagda.md index 4390404734..a51d51b76a 100644 --- a/src/foundation/symmetric-identity-types.lagda.md +++ b/src/foundation/symmetric-identity-types.lagda.md @@ -72,7 +72,7 @@ module _ ( is-torsorial-htpy H) Eq-eq-symmetric-Id : - (p q : symmetric-Id a) → (p = q) → Eq-symmetric-Id p q + (p q : symmetric-Id a) → p = q → Eq-symmetric-Id p q Eq-eq-symmetric-Id p .p refl = refl-Eq-symmetric-Id p is-equiv-Eq-eq-symmetric-Id : diff --git a/src/foundation/universal-property-identity-types.lagda.md b/src/foundation/universal-property-identity-types.lagda.md index 74679cffd1..04df943de4 100644 --- a/src/foundation/universal-property-identity-types.lagda.md +++ b/src/foundation/universal-property-identity-types.lagda.md @@ -47,10 +47,15 @@ ev-refl : ((x : A) (p : a = x) → B x p) → B a refl ev-refl a f = f a refl +ev-refl' : + {l1 l2 : Level} {A : UU l1} (a : A) {B : (x : A) → x = a → UU l2} → + ((x : A) (p : x = a) → B x p) → B a refl +ev-refl' a f = f a refl + abstract is-equiv-ev-refl : {l1 l2 : Level} {A : UU l1} (a : A) - {B : (x : A) → a = x → UU l2} → is-equiv (ev-refl a {B = B}) + {B : (x : A) → a = x → UU l2} → is-equiv (ev-refl a {B}) is-equiv-ev-refl a = is-equiv-is-invertible ( ind-Id a _) @@ -73,6 +78,11 @@ equiv-ev-refl' : equiv-ev-refl' a {B} = ( equiv-ev-refl a) ∘e ( equiv-Π-equiv-family (λ x → equiv-precomp-Π (equiv-inv a x) (B x))) + +is-equv-ev-refl' : + {l1 l2 : Level} {A : UU l1} (a : A) + {B : (x : A) → x = a → UU l2} → is-equiv (ev-refl' a {B}) +is-equv-ev-refl' a = is-equiv-map-equiv (equiv-ev-refl' a) ``` ### `Id : A → (A → 𝒰)` is an embedding From a588ecee41fea58edf3332f60ac6be6007fb5edf Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 16:23:44 +0100 Subject: [PATCH 11/39] vscode code snippets for equational reasoning --- .vscode/agda.code-snippets | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.vscode/agda.code-snippets b/.vscode/agda.code-snippets index 82e9eea39f..1869ef9188 100644 --- a/.vscode/agda.code-snippets +++ b/.vscode/agda.code-snippets @@ -8,11 +8,27 @@ "Full width equals sign (=)": { "body": ["="], "description": "Full width equals sign", - "prefix": ["Id", "equals"] + "prefix": ["Id"] }, "Yoneda embedding (ょ)": { "body": ["ょ"], "description": "Yoneda embedding", "prefix": ["yoneda"] + }, + + "Equational reasoning": { + "body": ["equational-reasoning ? = ? by ?"], + "description": "Equational reasoning", + "prefix": ["equational-reasoning"] + }, + "Homotopy-reasoning": { + "body": ["homotopy-reasoning ? ~ ? by ?"], + "description": "Homotopy-reasoning", + "prefix": ["homotopy-reasoning"] + }, + "Equivalence-reasoning": { + "body": ["equivalence-reasoning ? ≃ ? by ?"], + "description": "Equivalence-reasoning", + "prefix": ["equivalence-reasoning"] } } From 9d12fbf66cc14447482ba7b849669a2c4963c502 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 16:24:47 +0100 Subject: [PATCH 12/39] The inversion operation on the judgmentally compositional identity types defined by the judgmentally right unital concatenation operation on identifications --- ...ally-compositional-identity-types.lagda.md | 217 +++++++++++++----- 1 file changed, 155 insertions(+), 62 deletions(-) diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index 543e5408e7..f3ee924b19 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -75,7 +75,7 @@ module _ ## Properties -### Elements of the judgmentally compositional identity type act as postconcatenation operations +### Elements of the judgmentally compositional identity type act like postconcatenation operations ```agda module _ @@ -92,15 +92,15 @@ module _ commutative-concat-refl-Id-compositional-Id {z = z} f q = ap (f z) (inv right-unit) ∙ commutative-concat-Id-compositional-Id f q refl - commutative-rconcat-Id-compositional-Id : + commutative-concatr-Id-compositional-Id : {x y z w : A} (f : x =ᶜ y) (p : w = z) (q : z = x) → f w (p ∙ᵣ q) = p ∙ᵣ f z q - commutative-rconcat-Id-compositional-Id f refl refl = inv left-unit-rconcat + commutative-concatr-Id-compositional-Id f refl refl = inv left-unit-concatr - commutative-rconcat-refl-Id-compositional-Id : + commutative-concatr-refl-Id-compositional-Id : {x y z : A} (f : x =ᶜ y) (q : z = x) → f z q = q ∙ᵣ f x refl - commutative-rconcat-refl-Id-compositional-Id f q = - commutative-rconcat-Id-compositional-Id f q refl + commutative-concatr-refl-Id-compositional-Id f q = + commutative-concatr-Id-compositional-Id f q refl compute-inv-Id-compositional-Id : {x y : A} (f : x =ᶜ y) → f y (inv (f x refl)) = refl @@ -155,11 +155,11 @@ module _ is-section compositional-eq-eq eq-compositional-eq is-section-eq-compositional-eq f = eq-multivariable-htpy 2 - ( λ z p → inv (commutative-rconcat-refl-Id-compositional-Id f p)) + ( λ z p → inv (commutative-concatr-refl-Id-compositional-Id f p)) is-retraction-eq-compositional-eq : is-retraction compositional-eq-eq eq-compositional-eq - is-retraction-eq-compositional-eq p = left-unit-rconcat + is-retraction-eq-compositional-eq p = left-unit-concatr is-equiv-compositional-eq-eq : is-equiv compositional-eq-eq pr1 (pr1 is-equiv-compositional-eq-eq) = eq-compositional-eq @@ -230,8 +230,8 @@ module _ The judgementally compositional identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, -`B : (y : A) (p : x =ᶜ y) → UU l2`, then to construct a dependent function -`f : (y : A) (p : x =ᶜ y) → B y p` it suffices to define it at +`B : (y : A) (f : x =ᶜ y) → UU l2`, then to construct a dependent function +`f : (y : A) (f : x =ᶜ y) → B y p` it suffices to define it at `f x refl-compositional-Id`. **Note.** A drawback of the judgmentally compositional identity types is that @@ -260,11 +260,11 @@ module _ module _ {l1 l2 : Level} {A : UU l1} {x : A} - {B : (y : A) (p : x =ᶜ y) → UU l2} + (B : (y : A) (f : x =ᶜ y) → UU l2) where ind-compositional-Id : - (b : B x refl-compositional-Id) {y : A} (p : x =ᶜ y) → B y p + (b : B x refl-compositional-Id) {y : A} (f : x =ᶜ y) → B y f ind-compositional-Id b {y} = map-inv-is-equiv ( dependent-universal-property-identity-system-compositional-Id B) @@ -279,8 +279,8 @@ module _ ( dependent-universal-property-identity-system-compositional-Id B) uniqueness-ind-compositional-Id : - (f : (y : A) (p : x =ᶜ y) → B y p) → - (λ y → ind-compositional-Id (f x refl-compositional-Id) {y}) = f + (b : (y : A) (f : x =ᶜ y) → B y f) → + (λ y → ind-compositional-Id (b x refl-compositional-Id) {y}) = b uniqueness-ind-compositional-Id = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-compositional-Id B) @@ -293,75 +293,133 @@ weak groupoidal structure on types. ### Inverting judgmentally compositional identifications +We consider two ways of defining the inversion operation on judgmentally +compositional identifications: by the judgmentally left unital, and judgmentally +right unital concatenation respectively. Elsewhere, we will prefer the latter by +convention. + +#### The inversion operation defined by the judgmentally left unital concatenation operation on identifications + ```agda module _ {l : Level} {A : UU l} where - inv-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x - inv-compositional-Id {x} f z p = p ∙ inv (f x refl) + invl-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x + invl-compositional-Id {x} f z p = p ∙ inv (f x refl) - compute-inv-compositional-Id-refl : + compute-invl-compositional-Id-refl : {x : A} → - inv-compositional-Id (refl-compositional-Id {x = x}) = + invl-compositional-Id (refl-compositional-Id {x = x}) = refl-compositional-Id - compute-inv-compositional-Id-refl = + compute-invl-compositional-Id-refl = eq-multivariable-htpy 2 (λ z p → right-unit) - inv-inv-compositional-Id : - {x y : A} (p : x =ᶜ y) → inv-compositional-Id (inv-compositional-Id p) = p - inv-inv-compositional-Id {x} f = + invl-invl-compositional-Id : + {x y : A} (f : x =ᶜ y) → invl-compositional-Id (invl-compositional-Id f) = f + invl-invl-compositional-Id {x} f = eq-multivariable-htpy 2 ( λ w p → ap (p ∙_) (inv-inv (f x refl)) ∙ inv (commutative-concat-refl-Id-compositional-Id f p)) ``` +The inversion operation corresponds to the standard inversion operation on +identifications: + ```agda module _ {l : Level} {A : UU l} where - inv-compositional-Id' : {x y : A} → x =ᶜ y → y =ᶜ x - inv-compositional-Id' {x} f z p = p ∙ᵣ inv (f x refl) + commutative-invl-compositional-eq-eq : + {x y : A} (p : x = y) → + compositional-eq-eq (inv p) = invl-compositional-Id (compositional-eq-eq p) + commutative-invl-compositional-eq-eq p = + eq-multivariable-htpy 2 + ( λ z q → + ( eq-concat-concatr q (inv p)) ∙ + ( ap (λ x → q ∙ inv x) (inv left-unit-concatr))) + + commutative-invl-eq-compositional-eq : + {x y : A} (f : x =ᶜ y) → + eq-compositional-eq (invl-compositional-Id f) = inv (eq-compositional-eq f) + commutative-invl-eq-compositional-eq f = refl +``` + +#### The inversion operation defined by the judgmentally right unital concatenation operation on identifications - compute-inv-compositional-Id-refl' : +```agda +module _ + {l : Level} {A : UU l} + where + + invr-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x + invr-compositional-Id {x} f z p = p ∙ᵣ inv (f x refl) + + compute-invr-compositional-Id-refl : {x : A} → - inv-compositional-Id' (refl-compositional-Id {x = x}) = + invr-compositional-Id (refl-compositional-Id {x = x}) = refl-compositional-Id - compute-inv-compositional-Id-refl' = refl + compute-invr-compositional-Id-refl = refl - inv-inv-compositional-Id' : - {x y : A} (p : x =ᶜ y) → - inv-compositional-Id' (inv-compositional-Id' p) = p - inv-inv-compositional-Id' {x} f = + invr-invr-compositional-Id : + {x y : A} (f : x =ᶜ y) → + invr-compositional-Id (invr-compositional-Id f) = f + invr-invr-compositional-Id {x} f = eq-multivariable-htpy 2 ( λ w p → - ( ap (p ∙ᵣ_) (ap inv left-unit-rconcat ∙ inv-inv (f x refl))) ∙ - ( inv (commutative-rconcat-refl-Id-compositional-Id f p))) + ( ap (p ∙ᵣ_) (ap inv left-unit-concatr ∙ inv-inv (f x refl))) ∙ + ( inv (commutative-concatr-refl-Id-compositional-Id f p))) ``` -The inversion operation corresponds to the standard inversion operation on -identifications: - ```agda module _ {l : Level} {A : UU l} where - commutative-inv-compositional-eq-eq : + commutative-invr-compositional-eq-eq' : {x y : A} (p : x = y) → - compositional-eq-eq (inv p) = inv-compositional-Id (compositional-eq-eq p) - commutative-inv-compositional-eq-eq p = - eq-multivariable-htpy 2 - ( λ z q → - ( eq-concat-rconcat q (inv p)) ∙ - ( ap (λ x → q ∙ inv x) (inv left-unit-rconcat))) + compositional-eq-eq (inv p) = invr-compositional-Id (compositional-eq-eq' p) + commutative-invr-compositional-eq-eq' p = refl - commutative-inv-eq-compositional-eq : - {x y : A} (p : x =ᶜ y) → - eq-compositional-eq (inv-compositional-Id p) = inv (eq-compositional-eq p) - commutative-inv-eq-compositional-eq f = refl + commutative-invr-compositional-eq-eq : + {x y : A} (p : x = y) → + compositional-eq-eq (inv p) = invr-compositional-Id (compositional-eq-eq p) + commutative-invr-compositional-eq-eq refl = refl + + commutative-invr-eq-compositional-eq : + {x y : A} (f : x =ᶜ y) → + eq-compositional-eq (invr-compositional-Id f) = inv (eq-compositional-eq f) + commutative-invr-eq-compositional-eq {x} {y} f = left-unit-concatr +``` + +We prefer the inversion operation defined by the judgmentally right unital +concatenation operation on identifications by convention, as it satisfies the +judgmental computation law + +```text + inv refl = refl. +``` + +```agda +module _ + {l : Level} {A : UU l} + where + + inv-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x + inv-compositional-Id = invr-compositional-Id + + compute-inv-compositional-Id-refl : + {x : A} → + inv-compositional-Id (refl-compositional-Id {x = x}) = + refl-compositional-Id + compute-inv-compositional-Id-refl = compute-invr-compositional-Id-refl + + inv-inv-compositional-Id : + {x y : A} (f : x =ᶜ y) → + inv-compositional-Id (inv-compositional-Id f) = f + inv-inv-compositional-Id = invr-invr-compositional-Id ``` ### Concatenation of judgmentally compositional identifications @@ -376,10 +434,10 @@ module _ (f ∙ᶜ g) z p = g z (f z p) concat-compositional-Id : {x y : A} → x =ᶜ y → (z : A) → y =ᶜ z → x =ᶜ z - concat-compositional-Id p z q = p ∙ᶜ q + concat-compositional-Id f z g = f ∙ᶜ g concat-compositional-Id' : (x : A) {y z : A} → y =ᶜ z → x =ᶜ y → x =ᶜ z - concat-compositional-Id' x q p = p ∙ᶜ q + concat-compositional-Id' x g f = f ∙ᶜ g ``` The concatenation operation corresponds to the standard concatenation operation @@ -396,8 +454,8 @@ module _ commutative-concat-compositional-eq-eq refl refl = refl commutative-concat-eq-compositional-eq : - {x y z : A} (p : x =ᶜ y) (q : y =ᶜ z) → - eq-compositional-eq (p ∙ᶜ q) = eq-compositional-eq p ∙ eq-compositional-eq q + {x y z : A} (f : x =ᶜ y) (g : y =ᶜ z) → + eq-compositional-eq (f ∙ᶜ g) = eq-compositional-eq f ∙ eq-compositional-eq g commutative-concat-eq-compositional-eq {x} {y} {z} f g = commutative-concat-refl-Id-compositional-Id g (f x refl) ``` @@ -410,31 +468,51 @@ module _ where assoc-compositional-Id : - {x y z w : A} (p : x =ᶜ y) (q : y =ᶜ z) (r : z =ᶜ w) → - ((p ∙ᶜ q) ∙ᶜ r) = (p ∙ᶜ (q ∙ᶜ r)) + {x y z w : A} (f : x =ᶜ y) (g : y =ᶜ z) (h : z =ᶜ w) → + (f ∙ᶜ g) ∙ᶜ h = f ∙ᶜ (g ∙ᶜ h) assoc-compositional-Id f g h = refl left-unit-compositional-Id : - {x y : A} {p : x =ᶜ y} → refl-compositional-Id ∙ᶜ p = p + {x y : A} {f : x =ᶜ y} → refl-compositional-Id ∙ᶜ f = f left-unit-compositional-Id = refl right-unit-compositional-Id : - {x y : A} {p : x =ᶜ y} → p ∙ᶜ refl-compositional-Id = p + {x y : A} {f : x =ᶜ y} → f ∙ᶜ refl-compositional-Id = f right-unit-compositional-Id = refl left-inv-compositional-Id : - {x y : A} (p : x =ᶜ y) → - inv-compositional-Id p ∙ᶜ p = refl-compositional-Id + {x y : A} (f : x =ᶜ y) → + inv-compositional-Id f ∙ᶜ f = refl-compositional-Id left-inv-compositional-Id {x} f = + eq-multivariable-htpy 2 + ( λ z p → + ( commutative-concatr-Id-compositional-Id f p (inv (f x refl))) ∙ + ( ap (p ∙ᵣ_) (compute-inv-Id-compositional-Id f))) + + left-invl-compositional-Id : + {x y : A} (f : x =ᶜ y) → + invl-compositional-Id f ∙ᶜ f = refl-compositional-Id + left-invl-compositional-Id {x} f = eq-multivariable-htpy 2 ( λ z p → ( commutative-concat-Id-compositional-Id f p (inv (f x refl))) ∙ ( ap (p ∙_) (compute-inv-Id-compositional-Id f) ∙ right-unit)) right-inv-compositional-Id : - {x y : A} (p : x =ᶜ y) → - p ∙ᶜ inv-compositional-Id p = refl-compositional-Id + {x y : A} (f : x =ᶜ y) → + f ∙ᶜ inv-compositional-Id f = refl-compositional-Id right-inv-compositional-Id {x} f = + eq-multivariable-htpy 2 + ( λ z p → + ( ap (_∙ᵣ inv (f x refl)) + ( commutative-concatr-refl-Id-compositional-Id f p)) ∙ + ( assoc-concatr p (f x refl) (inv (f x refl))) ∙ + ( ap (p ∙ᵣ_) (right-inv-concatr (f x refl)))) + + right-invl-compositional-Id : + {x y : A} (f : x =ᶜ y) → + f ∙ᶜ invl-compositional-Id f = refl-compositional-Id + right-invl-compositional-Id {x} f = eq-multivariable-htpy 2 ( λ z p → ( ap @@ -445,10 +523,25 @@ module _ ( right-unit)) distributive-inv-concat-compositional-Id : - {x y : A} (p : x =ᶜ y) {z : A} (q : y =ᶜ z) → - inv-compositional-Id (p ∙ᶜ q) = - inv-compositional-Id q ∙ᶜ inv-compositional-Id p + {x y : A} (f : x =ᶜ y) {z : A} (g : y =ᶜ z) → + inv-compositional-Id (f ∙ᶜ g) = + inv-compositional-Id g ∙ᶜ inv-compositional-Id f distributive-inv-concat-compositional-Id {x} {y} f g = + eq-multivariable-htpy 2 + ( λ z p → + ( ap + ( p ∙ᵣ_) + ( ( ap + ( inv) + ( commutative-concatr-refl-Id-compositional-Id g (f x refl))) ∙ + ( distributive-inv-concatr (f x refl) (g y refl)))) ∙ + ( inv (assoc-concatr p (inv (g y refl)) (inv (f x refl))))) + + distributive-invl-concat-compositional-Id : + {x y : A} (f : x =ᶜ y) {z : A} (g : y =ᶜ z) → + invl-compositional-Id (f ∙ᶜ g) = + invl-compositional-Id g ∙ᶜ invl-compositional-Id f + distributive-invl-concat-compositional-Id {x} {y} f g = eq-multivariable-htpy 2 ( λ z p → ( ap From 36530730ea90f03666d99a259b55d1ff36c0525b Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 16:25:51 +0100 Subject: [PATCH 13/39] The judgmentally right unital concatenation operation on the judgmentally involutive identity types --- ...entally-involutive-identity-types.lagda.md | 204 ++++++++++++------ 1 file changed, 136 insertions(+), 68 deletions(-) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index e4d1e2e932..ce8ed0265e 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -43,13 +43,19 @@ In this file, we consider the ``` This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the law +standard identity types, but satisfies the judgmental law ```text - inv (inv p) = p + inv (inv p) = p. ``` -judgmentally. +In addition, we maintain the following judgmental laws + +- `inv refl = refl` +- `ind-Id f refl = f refl` +- `refl ∙ p = p` + +among other more technical ones considered in this file. ## Definition @@ -240,10 +246,15 @@ module _ ### Concatenation of judgmentally involutive identifications -**Note.** We define the concatenation operation on the judgmentally involutive +We define the concatenation operation on the judgmentally involutive identifications using the [judgmentally right unital concatenation operation on identifications](foundation.judgmentally-right-unital-concatenation-operation-identifications.md), -to obtain a judgmental _left_ unit law. +to obtain a one-sided judgmental unit law. There is both a judgmentally left +unital definition and a judgmentally right unital definition. To be consistent +with the convention for the standard identity types, we take the judgmentally +left unital concatenation operation as the default. + +#### The judgmentally left unital concatenation operation ```agda module _ @@ -252,114 +263,171 @@ module _ infixl 15 _∙ⁱ_ _∙ⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z - (z , p , q) ∙ⁱ (z' , p' , q') = (z' , p' , (q' ∙ᵣ inv p) ∙ᵣ q) + (w , p , q) ∙ⁱ (w' , p' , q') = (w' , p' , (q' ∙ᵣ inv p) ∙ᵣ q) concat-involutive-Id : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z concat-involutive-Id p z q = p ∙ⁱ q concat-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z concat-involutive-Id' x q p = p ∙ⁱ q + + commutative-concat-involutive-eq-eq : + {x y z : A} (p : x = y) (q : y = z) → + involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ⁱ involutive-eq-eq q + commutative-concat-involutive-eq-eq refl q = refl + + commutative-concat-eq-involutive-eq : + {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → + eq-involutive-eq (p ∙ⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q + commutative-concat-eq-involutive-eq (w , p , q) (w' , p' , q') = + ( ap + ( _∙ p') + ( ( distributive-inv-concatr (q' ∙ᵣ inv p) q) ∙ + ( ( ap + ( inv q ∙ᵣ_) + ( ( distributive-inv-concatr q' (inv p)) ∙ + ( ap (_∙ᵣ inv q') (inv-inv p)))) ∙ + ( inv (assoc-concatr (inv q) p (inv q'))) ∙ + ( eq-double-concat-concatr-left-associated (inv q) p (inv q'))))) ∙ + ( assoc (inv q ∙ p) (inv q') p') ``` +#### The judgmentally right unital concatenation operation + ```agda module _ {l : Level} {A : UU l} where - infixl 15 _∙ₗⁱ_ - _∙ₗⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z - (z , p , q) ∙ₗⁱ (z' , p' , q') = (z' , p' , (q' ∙ inv p) ∙ q) - - lconcat-involutive-Id : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z - lconcat-involutive-Id p z q = p ∙ₗⁱ q + infixl 15 _∙ᵣⁱ_ + _∙ᵣⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z + (w , p , q) ∙ᵣⁱ (w' , p' , q') = (w , (p ∙ᵣ inv q') ∙ᵣ p' , q) - lconcat-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z - lconcat-involutive-Id' x q p = p ∙ₗⁱ q - - eq-concat-lconcat-involutive-Id : - {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → p ∙ₗⁱ q = p ∙ⁱ q - eq-concat-lconcat-involutive-Id (z , p , q) (z' , p' , q') = - eq-pair-eq-pr2 - ( eq-pair-eq-pr2 - ( eq-double-rconcat-concat-left-associated q' (inv p) q)) -``` + concatr-involutive-Id : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z + concatr-involutive-Id p z q = p ∙ᵣⁱ q -The concatenation operation corresponds to the standard concatenation operation -on identifications: + concatr-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z + concatr-involutive-Id' x q p = p ∙ᵣⁱ q -```agda -module _ - {l : Level} {A : UU l} - where + eq-concat-concatr-involutive-Id : + {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → p ∙ᵣⁱ q = p ∙ⁱ q + eq-concat-concatr-involutive-Id (w , refl , q) (w' , p' , refl) = + eq-pair-eq-pr2 (eq-pair (left-unit-concatr) (inv left-unit-concatr)) - commutative-concat-involutive-eq-eq : + commutative-concatr-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → - involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ⁱ involutive-eq-eq q - commutative-concat-involutive-eq-eq refl q = refl + involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ᵣⁱ involutive-eq-eq q + commutative-concatr-involutive-eq-eq p refl = ap involutive-eq-eq right-unit - commutative-lconcat-eq-involutive-eq : - {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → - eq-involutive-eq (p ∙ₗⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q - commutative-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q') = - ( ap - ( _∙ p') - ( ( distributive-inv-concat (q' ∙ inv p) q) ∙ - ( ap - ( inv q ∙_) - ( distributive-inv-concat q' (inv p) ∙ ap (_∙ inv q') (inv-inv p))) ∙ - ( inv (assoc (inv q) p (inv q'))))) ∙ - ( assoc (inv q ∙ p) (inv q') p') - - commutative-concat-eq-involutive-eq : + commutative-concatr-eq-involutive-eq : {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → - eq-involutive-eq (p ∙ⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q - commutative-concat-eq-involutive-eq (z , p , q) (z' , p' , q') = + eq-involutive-eq (p ∙ᵣⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q + commutative-concatr-eq-involutive-eq (w , p , q) (w' , p' , q') = ( ap - ( λ x → inv x ∙ p') - ( eq-double-concat-rconcat-left-associated q' (inv p) q)) ∙ - ( commutative-lconcat-eq-involutive-eq (z , p , q) (z' , p' , q')) + ( inv q ∙_) + ( ( eq-double-concat-concatr-left-associated p (inv q') p') ∙ + ( assoc p (inv q') p'))) ∙ + ( inv (assoc (inv q) p (inv q' ∙ p'))) ``` ### The groupoidal laws for the judgmentally involutive identity types +The general proof-technique is to induct on the necessary paths to make the left +endpoints judgmentally equal, and then proceed by reasoning with the +groupoid-laws of the underlying identity system. + +#### The groupoidal laws for the judgmentally left unital concatenation operation + ```agda module _ - {l : Level} {A : UU l} + {l : Level} {A : UU l} {x y z w : A} where assoc-involutive-Id : - {x y z w : A} (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → + (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → ((p ∙ⁱ q) ∙ⁱ r) = (p ∙ⁱ (q ∙ⁱ r)) - assoc-involutive-Id (z , p , q) (z' , p' , q') (z'' , p'' , q'') = + assoc-involutive-Id (_ , p , q) (_ , p' , q') (_ , p'' , q'') = eq-pair-eq-pr2 ( eq-pair-eq-pr2 - ( ( inv (assoc-rconcat (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ - ( ap (_∙ᵣ q) (inv (assoc-rconcat (q'' ∙ᵣ inv p') q' (inv p)))))) + ( ( inv (assoc-concatr (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ + ( ap (_∙ᵣ q) (inv (assoc-concatr (q'' ∙ᵣ inv p') q' (inv p)))))) + +module _ + {l : Level} {A : UU l} {x y : A} + where left-unit-involutive-Id : - {x y : A} {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p + {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p left-unit-involutive-Id = refl right-unit-involutive-Id : - {x y : A} {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p - right-unit-involutive-Id {p = z , refl , q} = - eq-pair-eq-pr2 (eq-pair-eq-pr2 left-unit-rconcat) + {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p + right-unit-involutive-Id {p = .y , refl , q} = + eq-pair-eq-pr2 (eq-pair-eq-pr2 left-unit-concatr) left-inv-involutive-Id : - {x y : A} (p : x =ⁱ y) → inv-involutive-Id p ∙ⁱ p = refl-involutive-Id - left-inv-involutive-Id (z , refl , q) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-rconcat q)) + (p : x =ⁱ y) → inv-involutive-Id p ∙ⁱ p = refl-involutive-Id + left-inv-involutive-Id (.y , refl , q) = + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-concatr q)) right-inv-involutive-Id : - {x y : A} (p : x =ⁱ y) → p ∙ⁱ inv-involutive-Id p = refl-involutive-Id - right-inv-involutive-Id (z , p , refl) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-rconcat p)) + (p : x =ⁱ y) → p ∙ⁱ inv-involutive-Id p = refl-involutive-Id + right-inv-involutive-Id (.x , p , refl) = + eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-concatr p)) distributive-inv-concat-involutive-Id : - {x y : A} (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → + (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → inv-involutive-Id (p ∙ⁱ q) = inv-involutive-Id q ∙ⁱ inv-involutive-Id p - distributive-inv-concat-involutive-Id (z , refl , refl) (z' , p' , refl) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (inv left-unit-rconcat)) + distributive-inv-concat-involutive-Id (.y , refl , q') (.y , p' , refl) = + eq-pair-eq-pr2 (eq-pair (left-unit-concatr) (inv left-unit-concatr)) +``` + +#### The groupoidal laws for the judgmentally right unital concatenation operation + +```agda +module _ + {l : Level} {A : UU l} {x y z w : A} + where + + assoc-concatr-involutive-Id : + (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → + ((p ∙ᵣⁱ q) ∙ᵣⁱ r) = (p ∙ᵣⁱ (q ∙ᵣⁱ r)) + assoc-concatr-involutive-Id (_ , p , q) (_ , p' , q') (_ , p'' , q'') = + eq-pair-eq-pr2 + ( eq-pair + ( ( assoc-concatr (p ∙ᵣ inv q' ∙ᵣ p') (inv q'') p'') ∙ + ( assoc-concatr (p ∙ᵣ inv q') p' (inv q'' ∙ᵣ p'')) ∙ + ( ap (p ∙ᵣ inv q' ∙ᵣ_) (inv (assoc-concatr p' (inv q'') p'')))) + ( refl)) + +module _ + {l : Level} {A : UU l} {x y : A} + where + + left-unit-concatr-involutive-Id : + {p : x =ⁱ y} → refl-involutive-Id ∙ᵣⁱ p = p + left-unit-concatr-involutive-Id {p = .x , p , refl} = + eq-pair-eq-pr2 (eq-pair left-unit-concatr refl) + + right-unit-concatr-involutive-Id : + {p : x =ⁱ y} → p ∙ᵣⁱ refl-involutive-Id = p + right-unit-concatr-involutive-Id = refl + + left-inv-concatr-involutive-Id : + (p : x =ⁱ y) → inv-involutive-Id p ∙ᵣⁱ p = refl-involutive-Id + left-inv-concatr-involutive-Id (.y , refl , q) = + eq-pair-eq-pr2 (eq-pair (right-inv-concatr q) refl) + + right-inv-concatr-involutive-Id : + (p : x =ⁱ y) → p ∙ᵣⁱ inv-involutive-Id p = refl-involutive-Id + right-inv-concatr-involutive-Id (.x , p , refl) = + eq-pair-eq-pr2 (eq-pair (right-inv-concatr p) refl) + + distributive-inv-concatr-involutive-Id : + (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → + inv-involutive-Id (p ∙ᵣⁱ q) = inv-involutive-Id q ∙ᵣⁱ inv-involutive-Id p + distributive-inv-concatr-involutive-Id (.y , refl , q) (.y , p' , refl) = + eq-pair-eq-pr2 (eq-pair (inv left-unit-concatr) (left-unit-concatr)) ``` ## References From 9ffa4ca15336f7a99c60ae2b2c9785812f831338 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 16:26:10 +0100 Subject: [PATCH 14/39] `rconcat` -> `concatr` --- ...tal-concatenation-identifications.lagda.md | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md index 2bd2597ca4..62ae3836f9 100644 --- a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md @@ -41,7 +41,7 @@ reasons, we use the first alternative by convention. However, there are cases where the second case may be preferred. Hence, in this file we consider the -{{#concept "definitionally right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=rconcat Agda=rconcat'}}. +{{#concept "definitionally right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=concatr Agda=concatr'}}. This definition is for instance used with the [judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) @@ -58,11 +58,11 @@ module _ _∙ᵣ_ : {x y z : A} → x = y → y = z → x = z p ∙ᵣ refl = p - rconcat : {x y : A} → x = y → (z : A) → y = z → x = z - rconcat p z q = p ∙ᵣ q + concatr : {x y : A} → x = y → (z : A) → y = z → x = z + concatr p z q = p ∙ᵣ q - rconcat' : (x : A) {y z : A} → y = z → x = y → x = z - rconcat' x q p = p ∙ᵣ q + concatr' : (x : A) {y z : A} → y = z → x = y → x = z + concatr' x q p = p ∙ᵣ q ``` ### Translating between the left and right unital versions of concatenation @@ -72,37 +72,37 @@ module _ {l : Level} {A : UU l} where - eq-rconcat-concat : + eq-concatr-concat : {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q - eq-rconcat-concat refl refl = refl + eq-concatr-concat refl refl = refl - eq-concat-rconcat : + eq-concat-concatr : {x y z : A} (p : x = y) (q : y = z) → p ∙ᵣ q = p ∙ q - eq-concat-rconcat p q = inv (eq-rconcat-concat p q) + eq-concat-concatr p q = inv (eq-concatr-concat p q) - eq-double-rconcat-concat-left-associated : + eq-double-concatr-concat-left-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → p ∙ q ∙ r = p ∙ᵣ q ∙ᵣ r - eq-double-rconcat-concat-left-associated p q r = - ap (_∙ r) (eq-rconcat-concat p q) ∙ eq-rconcat-concat (p ∙ᵣ q) r + eq-double-concatr-concat-left-associated p q r = + ap (_∙ r) (eq-concatr-concat p q) ∙ eq-concatr-concat (p ∙ᵣ q) r - eq-double-rconcat-concat-right-associated : + eq-double-concatr-concat-right-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → p ∙ (q ∙ r) = p ∙ᵣ (q ∙ᵣ r) - eq-double-rconcat-concat-right-associated p q r = - ap (p ∙_) (eq-rconcat-concat q r) ∙ eq-rconcat-concat p (q ∙ᵣ r) + eq-double-concatr-concat-right-associated p q r = + ap (p ∙_) (eq-concatr-concat q r) ∙ eq-concatr-concat p (q ∙ᵣ r) - eq-double-concat-rconcat-left-associated : + eq-double-concat-concatr-left-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → p ∙ᵣ q ∙ᵣ r = p ∙ q ∙ r - eq-double-concat-rconcat-left-associated p q r = - ap (_∙ᵣ r) (eq-concat-rconcat p q) ∙ eq-concat-rconcat (p ∙ q) r + eq-double-concat-concatr-left-associated p q r = + ap (_∙ᵣ r) (eq-concat-concatr p q) ∙ eq-concat-concatr (p ∙ q) r - eq-double-concat-rconcat-right-associated : + eq-double-concat-concatr-right-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → p ∙ᵣ (q ∙ᵣ r) = p ∙ (q ∙ r) - eq-double-concat-rconcat-right-associated p q r = - ap (p ∙ᵣ_) (eq-concat-rconcat q r) ∙ eq-concat-rconcat p (q ∙ r) + eq-double-concat-concatr-right-associated p q r = + ap (p ∙ᵣ_) (eq-concat-concatr q r) ∙ eq-concat-concatr p (q ∙ r) ``` ## Properties @@ -114,30 +114,30 @@ module _ {l : Level} {A : UU l} where - assoc-rconcat : + assoc-concatr : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → ((p ∙ᵣ q) ∙ᵣ r) = (p ∙ᵣ (q ∙ᵣ r)) - assoc-rconcat p q refl = refl + assoc-concatr p q refl = refl - left-unit-rconcat : {x y : A} {p : x = y} → refl ∙ᵣ p = p - left-unit-rconcat {p = refl} = refl + left-unit-concatr : {x y : A} {p : x = y} → refl ∙ᵣ p = p + left-unit-concatr {p = refl} = refl - right-unit-rconcat : {x y : A} {p : x = y} → p ∙ᵣ refl = p - right-unit-rconcat = refl + right-unit-concatr : {x y : A} {p : x = y} → p ∙ᵣ refl = p + right-unit-concatr = refl - left-inv-rconcat : {x y : A} (p : x = y) → inv p ∙ᵣ p = refl - left-inv-rconcat refl = refl + left-inv-concatr : {x y : A} (p : x = y) → inv p ∙ᵣ p = refl + left-inv-concatr refl = refl - right-inv-rconcat : {x y : A} (p : x = y) → p ∙ᵣ (inv p) = refl - right-inv-rconcat refl = refl + right-inv-concatr : {x y : A} (p : x = y) → p ∙ᵣ (inv p) = refl + right-inv-concatr refl = refl - inv-inv-rconcat : {x y : A} (p : x = y) → inv (inv p) = p - inv-inv-rconcat refl = refl + inv-inv-concatr : {x y : A} (p : x = y) → inv (inv p) = p + inv-inv-concatr refl = refl - distributive-inv-rconcat : + distributive-inv-concatr : {x y : A} (p : x = y) {z : A} (q : y = z) → inv (p ∙ᵣ q) = inv q ∙ᵣ inv p - distributive-inv-rconcat refl refl = refl + distributive-inv-concatr refl refl = refl ``` ### Transposing inverses @@ -147,16 +147,16 @@ module _ {l : Level} {A : UU l} where - left-transpose-eq-rconcat : + left-transpose-eq-concatr : {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → p ∙ᵣ q = r → q = inv p ∙ᵣ r - left-transpose-eq-rconcat refl q r s = - (inv left-unit-rconcat ∙ s) ∙ inv left-unit-rconcat + left-transpose-eq-concatr refl q r s = + (inv left-unit-concatr ∙ s) ∙ inv left-unit-concatr - right-transpose-eq-rconcat : + right-transpose-eq-concatr : {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → p ∙ᵣ q = r → p = r ∙ᵣ inv q - right-transpose-eq-rconcat p refl r s = s + right-transpose-eq-concatr p refl r s = s ``` ### Concatenation is injective @@ -166,13 +166,13 @@ module _ {l1 : Level} {A : UU l1} where - is-injective-rconcat : + is-injective-concatr : {x y z : A} (p : x = y) {q r : y = z} → p ∙ᵣ q = p ∙ᵣ r → q = r - is-injective-rconcat refl s = (inv left-unit-rconcat ∙ s) ∙ left-unit-rconcat + is-injective-concatr refl s = (inv left-unit-concatr ∙ s) ∙ left-unit-concatr - is-injective-rconcat' : + is-injective-concatr' : {x y z : A} (r : y = z) {p q : x = y} → p ∙ᵣ r = q ∙ᵣ r → p = q - is-injective-rconcat' refl s = s + is-injective-concatr' refl s = s ``` ## See also From 5d4353439e7a6ff6a0359fed58d12ebf7bb7abea Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 17:25:10 +0100 Subject: [PATCH 15/39] wip computational identity types --- src/foundation.lagda.md | 1 + .../computational-identity-types.lagda.md | 404 ++++++++++++++++++ ...ally-compositional-identity-types.lagda.md | 4 + 3 files changed, 409 insertions(+) create mode 100644 src/foundation/computational-identity-types.lagda.md diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index c95f8c7e4f..a3b861184c 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -61,6 +61,7 @@ open import foundation.complements public open import foundation.complements-subtypes public open import foundation.composite-maps-in-inverse-sequential-diagrams public open import foundation.composition-algebra public +open import foundation.computational-identity-types public open import foundation.cones-over-cospan-diagrams public open import foundation.cones-over-inverse-sequential-diagrams public open import foundation.conjunction public diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md new file mode 100644 index 0000000000..2c9cac3f41 --- /dev/null +++ b/src/foundation/computational-identity-types.lagda.md @@ -0,0 +1,404 @@ +# Computational identity types + +```agda +module foundation.computational-identity-types where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.cartesian-product-types +open import foundation.dependent-pair-types +open import foundation.equality-cartesian-product-types +open import foundation.fundamental-theorem-of-identity-types +open import foundation.judgmentally-compositional-identity-types +open import foundation.judgmentally-right-unital-concatenation-identifications +open import foundation.multivariable-homotopies +open import foundation.universal-property-identity-systems +open import foundation.universe-levels + +open import foundation-core.contractible-types +open import foundation-core.equality-dependent-pair-types +open import foundation-core.equivalences +open import foundation-core.function-types +open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.identity-types +open import foundation-core.retractions +open import foundation-core.sections +open import foundation-core.torsorial-type-families +``` + +
+ +## Idea + +The [standard definition of identity types](foundation-core.identity-types.md) +suffer the limitation that many of the basic operations only satisfy algebraic +laws _weakly_. + +In this file, we consider the +{{#concept "computational identity types" Agda=computational-Id}} + +```text + (x =ʲ y) := Σ (z : A) ((z =ᶜ y) × (z =ᶜ x)) +``` + +where `x =ᶜ y` is the +[judgmentally compositional identity type](foundation.judgmentally-compositional-identity-types.md) + +```text + (x =ᶜ y) := (z : A) → (z = x) → (z = y) +``` + +This type family is [equivalent](foundation-core.equivalences.md) to the +standard identity types, but is computational and compositional, meaning all the +laws + +```text + inv (inv p) = p +``` + +judgmentally. + +## Definition + +```agda +module _ + {l : Level} {A : UU l} + where + + computational-Id : (x y : A) → UU l + computational-Id x y = Σ A (λ z → (z =ᶜ y) × (z =ᶜ x)) + + infix 6 _=ʲ_ + _=ʲ_ : A → A → UU l + (a =ʲ b) = computational-Id a b + + refl-computational-Id : {x : A} → x =ʲ x + refl-computational-Id {x} = + (x , refl-compositional-Id , refl-compositional-Id) +``` + +## Properties + +### The computational identity types are equivalent to the standard identity types + +In fact, the [retraction](foundation-core.retractions.md) is judgmental, and the +equivalence preserves the groupoid structure. + +```agda +module _ + {l : Level} {A : UU l} + where + + computational-eq-eq : {x y : A} → x = y → x =ʲ y + computational-eq-eq {x} p = + ( x , compositional-eq-eq p , refl-compositional-Id) + + eq-computational-eq : {x y : A} → x =ʲ y → x = y + eq-computational-eq (z , p , q) = + eq-compositional-eq (inv-compositional-Id q ∙ᶜ p) + + is-retraction-eq-computational-eq : + {x y : A} → is-retraction computational-eq-eq (eq-computational-eq {x} {y}) + is-retraction-eq-computational-eq p = left-unit-concatr + + is-section-eq-computational-eq : + {x y : A} → + is-section computational-eq-eq (eq-computational-eq {x} {y}) + is-section-eq-computational-eq (z , p , q) = + ind-compositional-Id + ( λ _ q → + computational-eq-eq (eq-computational-eq (z , p , q)) = (z , p , q)) + ( eq-pair-eq-pr2 (eq-pair (is-section-eq-compositional-eq p) refl)) + ( q) + + is-equiv-computational-eq-eq : + {x y : A} → is-equiv (computational-eq-eq {x} {y}) + pr1 (pr1 is-equiv-computational-eq-eq) = eq-computational-eq + pr2 (pr1 is-equiv-computational-eq-eq) = is-section-eq-computational-eq + pr1 (pr2 is-equiv-computational-eq-eq) = eq-computational-eq + pr2 (pr2 is-equiv-computational-eq-eq) = is-retraction-eq-computational-eq + + is-equiv-eq-computational-eq : + {x y : A} → is-equiv (eq-computational-eq {x} {y}) + pr1 (pr1 is-equiv-eq-computational-eq) = computational-eq-eq + pr2 (pr1 is-equiv-eq-computational-eq) = is-retraction-eq-computational-eq + pr1 (pr2 is-equiv-eq-computational-eq) = computational-eq-eq + pr2 (pr2 is-equiv-eq-computational-eq) = is-section-eq-computational-eq + + equiv-computational-eq-eq : {x y : A} → (x = y) ≃ (x =ʲ y) + pr1 equiv-computational-eq-eq = computational-eq-eq + pr2 equiv-computational-eq-eq = is-equiv-computational-eq-eq + + equiv-eq-computational-eq : {x y : A} → (x =ʲ y) ≃ (x = y) + pr1 equiv-eq-computational-eq = eq-computational-eq + pr2 equiv-eq-computational-eq = is-equiv-eq-computational-eq +``` + +The reflexivities are mapped to the reflexivities judgementally. + +```agda +module _ + {l : Level} {A : UU l} + where + + computational-eq-eq-refl : + {x : A} → computational-eq-eq (refl {x = x}) = refl-computational-Id + computational-eq-eq-refl = refl + + eq-computational-eq-refl : + {x : A} → eq-computational-eq (refl-computational-Id {x = x}) = refl + eq-computational-eq-refl = refl +``` + +### The induction principle for computational identity types + +The judgementally computational identity types satisfy the induction principle +of the identity types. This states that given a base point `x : A` and a family +of types over the identity types based at `x`, +`B : (y : A) (p : x =ʲ y) → UU l2`, then to construct a dependent function +`f : (y : A) (p : x =ʲ y) → B y p` it suffices to define it at +`f x refl-computational-Id`. + +**Note.** The only reason we must apply +[function extensionality](foundation.function-extensionality.md) is to show +uniqueness of the induction principle up to _equality_. + +```agda +module _ + {l : Level} {A : UU l} {x : A} + where + + is-torsorial-computational-Id : is-torsorial (computational-Id x) + is-torsorial-computational-Id = + is-contr-equiv + ( Σ A (x =_)) + ( equiv-tot (λ y → equiv-eq-computational-eq {x = x} {y})) + ( is-torsorial-Id x) + + dependent-universal-property-identity-system-computational-Id : + dependent-universal-property-identity-system + ( computational-Id x) + ( refl-computational-Id) + dependent-universal-property-identity-system-computational-Id = + dependent-universal-property-identity-system-is-torsorial + ( refl-computational-Id) + ( is-torsorial-computational-Id) + +module _ + {l1 l2 : Level} {A : UU l1} {x : A} + (B : (y : A) (p : x =ʲ y) → UU l2) + where + + ind-computational-Id : + (b : B x refl-computational-Id) {y : A} (p : x =ʲ y) → B y p + ind-computational-Id b {y} = + map-inv-is-equiv + ( dependent-universal-property-identity-system-computational-Id B) + ( b) + ( y) + + compute-ind-computational-Id : + (b : B x refl-computational-Id) → + ind-computational-Id b refl-computational-Id = b + compute-ind-computational-Id = + is-section-map-inv-is-equiv + ( dependent-universal-property-identity-system-computational-Id B) + + uniqueness-ind-computational-Id : + (b : (y : A) (p : x =ʲ y) → B y p) → + (λ y → ind-computational-Id (b x refl-computational-Id) {y}) = b + uniqueness-ind-computational-Id = + is-retraction-map-inv-is-equiv + ( dependent-universal-property-identity-system-computational-Id B) +``` + +## Structure + +The computational identity types form a groupoidal structure on types. This +structure satisfies the following algebraic laws strictly + +- `inv refl = refl` +- `inv (inv p) = p` +- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` +- `refl ∙ p = p` or `p ∙ refl = p` + +but not + +- `refl ∙ p = p` and `p ∙ refl = p` +- `inv p ∙ p = refl` +- `p ∙ inv p = refl`. + +### Inverting computational identifications + +```agda +module _ + {l : Level} {A : UU l} + where + + inv-computational-Id : {x y : A} → x =ʲ y → y =ʲ x + inv-computational-Id (z , p , q) = (z , q , p) + + compute-inv-computational-Id-refl : + {x : A} → + inv-computational-Id (refl-computational-Id {x = x}) = refl-computational-Id + compute-inv-computational-Id-refl = refl + + inv-inv-computational-Id : + {x y : A} (p : x =ʲ y) → inv-computational-Id (inv-computational-Id p) = p + inv-inv-computational-Id p = refl +``` + +The inversion operation corresponds to the standard inversion operation on +identifications: + +```agda +module _ + {l : Level} {A : UU l} {x y : A} + where + + commutative-inv-computational-eq-eq : + (p : x = y) → + computational-eq-eq (inv p) = inv-computational-Id (computational-eq-eq p) + commutative-inv-computational-eq-eq refl = refl + + -- commutative-inv-eq-computational-eq : + -- (p : x =ʲ y) → + -- eq-computational-eq (inv-computational-Id p) = inv (eq-computational-eq p) + -- commutative-inv-eq-computational-eq (z , f , g) = + -- equational-reasoning g y (refl ∙ᵣ inv (f z refl)) = inv (f x (refl ∙ᵣ inv (g z refl))) by {! !} +``` + +### The concatenation operations on computational identifications + +There is both a judgmentally left unital concatenation operation and a +judgmentally right unital concatenation operation, although both are +judgmentally associative. + +**Note.** Since they are judgmentally associative, the only instances where they +will not reduce is thus when the reflexivity appears all the way to the right, +or all the way to the left in a string of concatenations respectively. + +#### The judgmentally left unital concatenation operation + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ₗʲ_ + _∙ₗʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z + (z , p , q) ∙ₗʲ (z' , p' , q') = + (z' , p' , q' ∙ᶜ invr-compositional-Id p ∙ᶜ q) + + concatl-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z + concatl-computational-Id p z q = p ∙ₗʲ q + + concatl-computational-Id' : (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z + concatl-computational-Id' x q p = p ∙ₗʲ q +``` + +#### The judgmentally left unital concatenation operation + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ᵣʲ_ + _∙ᵣʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z + (w , p , q) ∙ᵣʲ (w' , p' , q') = + (w , p ∙ᶜ invr-compositional-Id q' ∙ᶜ p' , q) + + concatr-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z + concatr-computational-Id p z q = p ∙ᵣʲ q + + concatr-computational-Id' : (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z + concatr-computational-Id' x q p = p ∙ᵣʲ q +``` + +### The groupoidal laws for the computational identity types + +#### The groupoidal laws for the judgmentally left unital concatenation operation + +```agda +module _ + {l : Level} {A : UU l} {x y z w : A} + where + + assoc-concatl-computational-Id : + (p : x =ʲ y) (q : y =ʲ z) (r : z =ʲ w) → + (p ∙ₗʲ q) ∙ₗʲ r = p ∙ₗʲ (q ∙ₗʲ r) + assoc-concatl-computational-Id p q r = refl + +module _ + {l : Level} {A : UU l} {x y : A} + where + + left-unit-concatl-computational-Id : + {p : x =ʲ y} → refl-computational-Id ∙ₗʲ p = p + left-unit-concatl-computational-Id = refl + + right-unit-concatl-computational-Id : + {p : x =ʲ y} → p ∙ₗʲ refl-computational-Id = p + right-unit-concatl-computational-Id {z , p , q} = + ind-compositional-Id + ( λ _ p → (z , p , q) ∙ₗʲ refl-computational-Id = (z , p , q)) + ( refl) + ( p) + + left-inv-concatl-computational-Id : + (p : x =ʲ y) → inv-computational-Id p ∙ₗʲ p = refl-computational-Id + left-inv-concatl-computational-Id (z , p , q) = + ind-compositional-Id + ( λ _ p → + inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q) = refl-computational-Id) + ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-compositional-Id q))) + ( p) + + right-inv-concatl-computational-Id : + (p : x =ʲ y) → p ∙ₗʲ inv-computational-Id p = refl-computational-Id + right-inv-concatl-computational-Id (z , p , q) = + ind-compositional-Id + ( λ _ q → + (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q) = refl-computational-Id) + ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-compositional-Id p))) + ( q) + + -- distributive-inv-concatl-computational-Id : + -- {x y : A} (p : x =ʲ y) {z : A} (q : y =ʲ z) → + -- inv-computational-Id (p ∙ₗʲ q) = inv-computational-Id q ∙ₗʲ inv-computational-Id p + -- distributive-inv-concatl-computational-Id (z , refl , refl) (z' , p' , refl) = + -- eq-pair-eq-pr2 (eq-pair-eq-pr2 (inv left-unit-concatr)) +``` + +#### The groupoidal laws for the judgmentally right unital concatenation operation + +```agda +module _ + {l : Level} {A : UU l} + where + + assoc-concatr-computational-Id : + {x y z w : A} (p : x =ʲ y) (q : y =ʲ z) (r : z =ʲ w) → + (p ∙ᵣʲ q) ∙ᵣʲ r = p ∙ᵣʲ (q ∙ᵣʲ r) + assoc-concatr-computational-Id p q r = refl + + left-unit-concatr-computational-Id : + {x y : A} {p : x =ʲ y} → refl-computational-Id ∙ᵣʲ p = p + left-unit-concatr-computational-Id {x} {y} {z , p , q} = + ind-compositional-Id + ( λ w q → refl-computational-Id ∙ᵣʲ (z , p , q) = (z , p , q)) + ( refl) + ( q) + + right-unit-concatr-computational-Id : + {x y : A} {p : x =ʲ y} → p ∙ᵣʲ refl-computational-Id = p + right-unit-concatr-computational-Id = refl +``` + +## References + +- diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index f3ee924b19..5cd9a38f93 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -180,7 +180,11 @@ module _ equiv-eq-compositional-eq : (x =ᶜ y) ≃ (x = y) pr1 equiv-eq-compositional-eq = eq-compositional-eq pr2 equiv-eq-compositional-eq = is-equiv-eq-compositional-eq +``` + +The reflexivity witnesses are mapped to reflexivity witnesses judgementally. +```agda module _ {l : Level} {A : UU l} where From e181181f3409a606e724ca59745bb475808c4dfb Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 17:36:27 +0100 Subject: [PATCH 16/39] checks --- src/foundation-core/identity-types.lagda.md | 2 +- src/foundation/computational-identity-types.lagda.md | 8 +++++--- .../judgmentally-involutive-identity-types.lagda.md | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index ad5208f1d3..2067d0dd7a 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -117,7 +117,7 @@ reasons, we use the first alternative by convention. See also -- [judgmentally right unital concatenation operation on indentifications](foundation.judgmentally-right-unital-concatenation-operation-identifications.md) +- [judgmentally right unital concatenation operation on indentifications](foundation.judgmentally-right-unital-concatenation-identifications.md) - [judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) ```agda diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 2c9cac3f41..b5cca2283a 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -227,7 +227,7 @@ structure satisfies the following algebraic laws strictly but not -- `refl ∙ p = p` and `p ∙ refl = p` +- `refl ∙ p = p` and `p ∙ refl = p` simultaneously - `inv p ∙ p = refl` - `p ∙ inv p = refl`. @@ -354,7 +354,8 @@ module _ left-inv-concatl-computational-Id (z , p , q) = ind-compositional-Id ( λ _ p → - inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q) = refl-computational-Id) + ( inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q)) = + ( refl-computational-Id)) ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-compositional-Id q))) ( p) @@ -363,7 +364,8 @@ module _ right-inv-concatl-computational-Id (z , p , q) = ind-compositional-Id ( λ _ q → - (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q) = refl-computational-Id) + ( (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q)) = + ( refl-computational-Id)) ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-compositional-Id p))) ( q) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index ce8ed0265e..ccda1f78bc 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -248,7 +248,7 @@ module _ We define the concatenation operation on the judgmentally involutive identifications using the -[judgmentally right unital concatenation operation on identifications](foundation.judgmentally-right-unital-concatenation-operation-identifications.md), +[judgmentally right unital concatenation operation on identifications](foundation.judgmentally-right-unital-concatenation-identifications.md), to obtain a one-sided judgmental unit law. There is both a judgmentally left unital definition and a judgmentally right unital definition. To be consistent with the convention for the standard identity types, we take the judgmentally From fcee6691af871548b86b25a352688419524c930d Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Thu, 1 Feb 2024 17:43:45 +0100 Subject: [PATCH 17/39] remove wrong text --- .../computational-identity-types.lagda.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index b5cca2283a..188f8a4d39 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -52,14 +52,18 @@ where `x =ᶜ y` is the ``` This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but is computational and compositional, meaning all the -laws +standard identity types, but satisfies the algebraic laws -```text - inv (inv p) = p -``` +- `inv refl = refl` +- `inv (inv p) = p` +- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` +- `refl ∙ p = p` or `p ∙ refl = p` + +judgmentally, but not -judgmentally. +- `refl ∙ p = p` and `p ∙ refl = p` simultaneously, +- `inv p ∙ p = refl`, or +- `p ∙ inv p = refl`. ## Definition @@ -144,13 +148,13 @@ module _ {l : Level} {A : UU l} where - computational-eq-eq-refl : + compute-computational-eq-eq-refl : {x : A} → computational-eq-eq (refl {x = x}) = refl-computational-Id - computational-eq-eq-refl = refl + compute-computational-eq-eq-refl = refl - eq-computational-eq-refl : + compute-eq-computational-eq-refl : {x : A} → eq-computational-eq (refl-computational-Id {x = x}) = refl - eq-computational-eq-refl = refl + compute-eq-computational-eq-refl = refl ``` ### The induction principle for computational identity types @@ -162,10 +166,6 @@ of types over the identity types based at `x`, `f : (y : A) (p : x =ʲ y) → B y p` it suffices to define it at `f x refl-computational-Id`. -**Note.** The only reason we must apply -[function extensionality](foundation.function-extensionality.md) is to show -uniqueness of the induction principle up to _equality_. - ```agda module _ {l : Level} {A : UU l} {x : A} @@ -223,7 +223,7 @@ structure satisfies the following algebraic laws strictly - `inv refl = refl` - `inv (inv p) = p` - `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` or `p ∙ refl = p` +- `refl ∙ p = p` or `p ∙ refl = p`, but not @@ -274,12 +274,13 @@ module _ ### The concatenation operations on computational identifications There is both a judgmentally left unital concatenation operation and a -judgmentally right unital concatenation operation, although both are -judgmentally associative. +judgmentally right unital concatenation operation, while both are judgmentally +associative. -**Note.** Since they are judgmentally associative, the only instances where they -will not reduce is thus when the reflexivity appears all the way to the right, -or all the way to the left in a string of concatenations respectively. +**Observation.** Since they are judgmentally associative, the only instances +where they will not reduce is thus when the reflexivity appears all the way to +the right, or all the way to the left in a string of concatenations +respectively. #### The judgmentally left unital concatenation operation From 470df2f9cad4882e021b3637594e37e5164601b7 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Fri, 2 Feb 2024 13:12:31 +0100 Subject: [PATCH 18/39] finish work? --- .../computational-identity-types.lagda.md | 272 ++++++--- ...ally-compositional-identity-types.lagda.md | 544 +++++++++--------- ...entally-involutive-identity-types.lagda.md | 87 +-- ...tal-concatenation-identifications.lagda.md | 2 +- 4 files changed, 518 insertions(+), 387 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 188f8a4d39..de9fe662ac 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -1,4 +1,4 @@ -# Computational identity types +# The computational identity types ```agda module foundation.computational-identity-types where @@ -7,6 +7,7 @@ module foundation.computational-identity-types where
Imports ```agda +open import foundation.action-on-identifications-binary-functions open import foundation.action-on-identifications-functions open import foundation.cartesian-product-types open import foundation.dependent-pair-types @@ -35,35 +36,37 @@ open import foundation-core.torsorial-type-families The [standard definition of identity types](foundation-core.identity-types.md) suffer the limitation that many of the basic operations only satisfy algebraic -laws _weakly_. - -In this file, we consider the +laws _weakly_. In this file, we consider the {{#concept "computational identity types" Agda=computational-Id}} ```text - (x =ʲ y) := Σ (z : A) ((z =ᶜ y) × (z =ᶜ x)) + (x =ʲ y) := Σ (z : A) ((z =ʸ y) × (z =ʸ x)) ``` -where `x =ᶜ y` is the +where `x =ʸ y` is the [judgmentally compositional identity type](foundation.judgmentally-compositional-identity-types.md) ```text - (x =ᶜ y) := (z : A) → (z = x) → (z = y) + (x =ʸ y) := (z : A) → (z = x) → (z = y). ``` -This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the algebraic laws +The computational identity types are +[equivalent](foundation-core.equivalences.md) to the standard identity types, +but satisfy the the following algebraic laws judgmentally: + +- `inv refl = refl` +- `inv (inv p) = p` +- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` +- `refl ∙ p = p` or `p ∙ refl = p`. -- `inv refl = refl` -- `inv (inv p) = p` -- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` or `p ∙ refl = p` +**Note.** The computational identity types do not satisfy the judgmental laws -judgmentally, but not +- `refl ∙ p = p` and `p ∙ refl = p` simultaneously, +- `inv p ∙ p = refl`, or +- `p ∙ inv p = refl`, -- `refl ∙ p = p` and `p ∙ refl = p` simultaneously, -- `inv p ∙ p = refl`, or -- `p ∙ inv p = refl`. +and they do not have a judgmental computation property for their induction +principle. ## Definition @@ -73,23 +76,22 @@ module _ where computational-Id : (x y : A) → UU l - computational-Id x y = Σ A (λ z → (z =ᶜ y) × (z =ᶜ x)) + computational-Id x y = Σ A (λ z → (z =ʸ y) × (z =ʸ x)) infix 6 _=ʲ_ _=ʲ_ : A → A → UU l (a =ʲ b) = computational-Id a b refl-computational-Id : {x : A} → x =ʲ x - refl-computational-Id {x} = - (x , refl-compositional-Id , refl-compositional-Id) + refl-computational-Id {x} = (x , refl-yoneda-Id , refl-yoneda-Id) ``` ## Properties ### The computational identity types are equivalent to the standard identity types -In fact, the [retraction](foundation-core.retractions.md) is judgmental, and the -equivalence preserves the groupoid structure. +This equivalence preserves the groupoid structure of the computational identity +types and moreover preserves the reflexivity witnesses judgmentally. ```agda module _ @@ -97,12 +99,10 @@ module _ where computational-eq-eq : {x y : A} → x = y → x =ʲ y - computational-eq-eq {x} p = - ( x , compositional-eq-eq p , refl-compositional-Id) + computational-eq-eq {x} p = (x , yoneda-eq-eq p , refl-yoneda-Id) eq-computational-eq : {x y : A} → x =ʲ y → x = y - eq-computational-eq (z , p , q) = - eq-compositional-eq (inv-compositional-Id q ∙ᶜ p) + eq-computational-eq (z , p , q) = eq-yoneda-eq (inv-yoneda-Id q ∙ʸ p) is-retraction-eq-computational-eq : {x y : A} → is-retraction computational-eq-eq (eq-computational-eq {x} {y}) @@ -112,10 +112,10 @@ module _ {x y : A} → is-section computational-eq-eq (eq-computational-eq {x} {y}) is-section-eq-computational-eq (z , p , q) = - ind-compositional-Id + ind-yoneda-Id ( λ _ q → computational-eq-eq (eq-computational-eq (z , p , q)) = (z , p , q)) - ( eq-pair-eq-pr2 (eq-pair (is-section-eq-compositional-eq p) refl)) + ( eq-pair-eq-pr2 (eq-pair (is-section-eq-yoneda-eq p) refl)) ( q) is-equiv-computational-eq-eq : @@ -141,30 +141,29 @@ module _ pr2 equiv-eq-computational-eq = is-equiv-eq-computational-eq ``` -The reflexivities are mapped to the reflexivities judgementally. +The reflexivity witnesses are preserved judgmentally. ```agda module _ {l : Level} {A : UU l} where - compute-computational-eq-eq-refl : + preserves-refl-computational-eq-eq : {x : A} → computational-eq-eq (refl {x = x}) = refl-computational-Id - compute-computational-eq-eq-refl = refl + preserves-refl-computational-eq-eq = refl - compute-eq-computational-eq-refl : + preserves-refl-eq-computational-eq : {x : A} → eq-computational-eq (refl-computational-Id {x = x}) = refl - compute-eq-computational-eq-refl = refl + preserves-refl-eq-computational-eq = refl ``` ### The induction principle for computational identity types -The judgementally computational identity types satisfy the induction principle -of the identity types. This states that given a base point `x : A` and a family -of types over the identity types based at `x`, -`B : (y : A) (p : x =ʲ y) → UU l2`, then to construct a dependent function -`f : (y : A) (p : x =ʲ y) → B y p` it suffices to define it at -`f x refl-computational-Id`. +The judgmentally computational identity types satisfy the induction principle of +the identity types. This states that given a base point `x : A` and a family of +types over the identity types based at `x`, `B : (y : A) (p : x =ʲ y) → UU l2`, +then to construct a dependent function `f : (y : A) (p : x =ʲ y) → B y p` it +suffices to define it at `f x refl-computational-Id`. ```agda module _ @@ -220,16 +219,16 @@ module _ The computational identity types form a groupoidal structure on types. This structure satisfies the following algebraic laws strictly -- `inv refl = refl` -- `inv (inv p) = p` -- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` or `p ∙ refl = p`, +- `inv refl = refl` +- `inv (inv p) = p` +- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` +- `refl ∙ p = p` or `p ∙ refl = p`. -but not +Note, however, that they do not satisfy the strict algebraic laws -- `refl ∙ p = p` and `p ∙ refl = p` simultaneously -- `inv p ∙ p = refl` -- `p ∙ inv p = refl`. +- `refl ∙ p = p` and `p ∙ refl = p` simultaneously +- `inv p ∙ p = refl` +- `p ∙ inv p = refl`. ### Inverting computational identifications @@ -243,11 +242,13 @@ module _ compute-inv-computational-Id-refl : {x : A} → - inv-computational-Id (refl-computational-Id {x = x}) = refl-computational-Id + inv-computational-Id (refl-computational-Id {x = x}) = + refl-computational-Id compute-inv-computational-Id-refl = refl inv-inv-computational-Id : - {x y : A} (p : x =ʲ y) → inv-computational-Id (inv-computational-Id p) = p + {x y : A} (p : x =ʲ y) → + inv-computational-Id (inv-computational-Id p) = p inv-inv-computational-Id p = refl ``` @@ -259,16 +260,18 @@ module _ {l : Level} {A : UU l} {x y : A} where - commutative-inv-computational-eq-eq : + preserves-inv-computational-eq-eq : (p : x = y) → computational-eq-eq (inv p) = inv-computational-Id (computational-eq-eq p) - commutative-inv-computational-eq-eq refl = refl - - -- commutative-inv-eq-computational-eq : - -- (p : x =ʲ y) → - -- eq-computational-eq (inv-computational-Id p) = inv (eq-computational-eq p) - -- commutative-inv-eq-computational-eq (z , f , g) = - -- equational-reasoning g y (refl ∙ᵣ inv (f z refl)) = inv (f x (refl ∙ᵣ inv (g z refl))) by {! !} + preserves-inv-computational-eq-eq refl = refl + + preserves-inv-eq-computational-eq : + (p : x =ʲ y) → + eq-computational-eq (inv-computational-Id p) = inv (eq-computational-eq p) + preserves-inv-eq-computational-eq (z , f , g) = + ( ap (g y) (left-unit-concatr)) ∙ + ( distributive-inv-Id-yoneda-Id g f) ∙ + ( ap (λ r → inv (f x r)) (inv left-unit-concatr)) ``` ### The concatenation operations on computational identifications @@ -291,8 +294,7 @@ module _ infixl 15 _∙ₗʲ_ _∙ₗʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z - (z , p , q) ∙ₗʲ (z' , p' , q') = - (z' , p' , q' ∙ᶜ invr-compositional-Id p ∙ᶜ q) + (z , p , q) ∙ₗʲ (z' , p' , q') = (z' , p' , q' ∙ʸ invr-yoneda-Id p ∙ʸ q) concatl-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z concatl-computational-Id p z q = p ∙ₗʲ q @@ -301,7 +303,46 @@ module _ concatl-computational-Id' x q p = p ∙ₗʲ q ``` -#### The judgmentally left unital concatenation operation +```agda +module _ + {l : Level} {A : UU l} {x y z : A} + where + + preserves-concatl-computational-eq-eq : + (p : x = y) (q : y = z) → + computational-eq-eq (p ∙ q) = + computational-eq-eq p ∙ₗʲ computational-eq-eq q + preserves-concatl-computational-eq-eq refl q = refl + + preserves-concatl-eq-computational-eq : + (p : x =ʲ y) (q : y =ʲ z) → + eq-computational-eq (p ∙ₗʲ q) = + eq-computational-eq p ∙ eq-computational-eq q + preserves-concatl-eq-computational-eq (w , f , g) (w' , f' , g') = + ( ap (f' x) left-unit-concatr) ∙ + ( ap + ( f' x) + ( ( ap + ( inv) + ( commutative-postconcatr-Id-yoneda-Id + ( g) + ( g' w' refl) + ( inv (f w refl)))) ∙ + ( ( distributive-inv-concatr (g' w' refl) (g y (inv (f w refl)))) ∙ + ( ( ap + ( _∙ᵣ inv (g' w' refl)) + ( inv-distributive-inv-Id-yoneda-Id f g)) ∙ + ( eq-concat-concatr (f x (inv (g w refl))) (inv (g' w' refl)))))) ∙ + ( commutative-postconcat-Id-yoneda-Id f' + ( f x (inv (g w refl))) + ( inv (g' w' refl)))) ∙ + ( ap-binary + ( _∙_) + ( ap (f x) (inv left-unit-concatr)) + ( ap (f' y) (inv left-unit-concatr))) +``` + +#### The judgmentally right unital concatenation operation ```agda module _ @@ -311,7 +352,7 @@ module _ infixl 15 _∙ᵣʲ_ _∙ᵣʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z (w , p , q) ∙ᵣʲ (w' , p' , q') = - (w , p ∙ᶜ invr-compositional-Id q' ∙ᶜ p' , q) + (w , p ∙ʸ invr-yoneda-Id q' ∙ʸ p' , q) concatr-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z concatr-computational-Id p z q = p ∙ᵣʲ q @@ -320,6 +361,33 @@ module _ concatr-computational-Id' x q p = p ∙ᵣʲ q ``` +```agda +module _ + {l : Level} {A : UU l} {x y z : A} + where + + preserves-concatr-computational-eq-eq : + (p : x = y) (q : y = z) → + computational-eq-eq (p ∙ᵣ q) = + computational-eq-eq p ∙ᵣʲ computational-eq-eq q + preserves-concatr-computational-eq-eq p refl = refl + + preserves-concatr-eq-computational-eq : + (p : x =ʲ y) (q : y =ʲ z) → + eq-computational-eq (p ∙ᵣʲ q) = + eq-computational-eq p ∙ᵣ eq-computational-eq q + preserves-concatr-eq-computational-eq (w , f , g) (w' , f' , g') = + ( ap (λ r → f' x (f x r ∙ᵣ inv (g' w' refl))) left-unit-concatr) ∙ + ( commutative-postconcatr-Id-yoneda-Id + ( f') + ( f x (inv (g w refl))) + ( inv (g' w' refl))) ∙ + ( ap-binary + ( _∙ᵣ_) + ( ap (f x) (inv left-unit-concatr)) + ( ap (f' y) (inv left-unit-concatr))) +``` + ### The groupoidal laws for the computational identity types #### The groupoidal laws for the judgmentally left unital concatenation operation @@ -345,7 +413,7 @@ module _ right-unit-concatl-computational-Id : {p : x =ʲ y} → p ∙ₗʲ refl-computational-Id = p right-unit-concatl-computational-Id {z , p , q} = - ind-compositional-Id + ind-yoneda-Id ( λ _ p → (z , p , q) ∙ₗʲ refl-computational-Id = (z , p , q)) ( refl) ( p) @@ -353,28 +421,34 @@ module _ left-inv-concatl-computational-Id : (p : x =ʲ y) → inv-computational-Id p ∙ₗʲ p = refl-computational-Id left-inv-concatl-computational-Id (z , p , q) = - ind-compositional-Id + ind-yoneda-Id ( λ _ p → ( inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q)) = ( refl-computational-Id)) - ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-compositional-Id q))) + ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-yoneda-Id q))) ( p) right-inv-concatl-computational-Id : (p : x =ʲ y) → p ∙ₗʲ inv-computational-Id p = refl-computational-Id right-inv-concatl-computational-Id (z , p , q) = - ind-compositional-Id + ind-yoneda-Id ( λ _ q → ( (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q)) = ( refl-computational-Id)) - ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-compositional-Id p))) + ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-yoneda-Id p))) ( q) - -- distributive-inv-concatl-computational-Id : - -- {x y : A} (p : x =ʲ y) {z : A} (q : y =ʲ z) → - -- inv-computational-Id (p ∙ₗʲ q) = inv-computational-Id q ∙ₗʲ inv-computational-Id p - -- distributive-inv-concatl-computational-Id (z , refl , refl) (z' , p' , refl) = - -- eq-pair-eq-pr2 (eq-pair-eq-pr2 (inv left-unit-concatr)) + distributive-inv-concatl-computational-Id : + (p : x =ʲ y) {z : A} (q : y =ʲ z) → + inv-computational-Id (p ∙ₗʲ q) = + inv-computational-Id q ∙ₗʲ inv-computational-Id p + distributive-inv-concatl-computational-Id p q = + ind-computational-Id + ( λ _ q → + inv-computational-Id (p ∙ₗʲ q) = + inv-computational-Id q ∙ₗʲ inv-computational-Id p) + ( ap inv-computational-Id (right-unit-concatl-computational-Id)) + ( q) ``` #### The groupoidal laws for the judgmentally right unital concatenation operation @@ -389,19 +463,59 @@ module _ (p ∙ᵣʲ q) ∙ᵣʲ r = p ∙ᵣʲ (q ∙ᵣʲ r) assoc-concatr-computational-Id p q r = refl +module _ + {l : Level} {A : UU l} {x y : A} + where + + right-unit-concatr-computational-Id : + {p : x =ʲ y} → p ∙ᵣʲ refl-computational-Id = p + right-unit-concatr-computational-Id = refl + left-unit-concatr-computational-Id : - {x y : A} {p : x =ʲ y} → refl-computational-Id ∙ᵣʲ p = p - left-unit-concatr-computational-Id {x} {y} {z , p , q} = - ind-compositional-Id + {p : x =ʲ y} → refl-computational-Id ∙ᵣʲ p = p + left-unit-concatr-computational-Id {z , p , q} = + ind-yoneda-Id ( λ w q → refl-computational-Id ∙ᵣʲ (z , p , q) = (z , p , q)) ( refl) ( q) - right-unit-concatr-computational-Id : - {x y : A} {p : x =ʲ y} → p ∙ᵣʲ refl-computational-Id = p - right-unit-concatr-computational-Id = refl + left-inv-concatr-computational-Id : + (p : x =ʲ y) → inv-computational-Id p ∙ᵣʲ p = refl-computational-Id + left-inv-concatr-computational-Id (z , p , q) = + ind-yoneda-Id + ( λ _ p → + ( inv-computational-Id (z , p , q) ∙ᵣʲ (z , p , q)) = + ( refl-computational-Id)) + ( eq-pair-eq-pr2 (eq-pair (right-inv-yoneda-Id q) refl)) + ( p) + + right-inv-concatr-computational-Id : + (p : x =ʲ y) → p ∙ᵣʲ inv-computational-Id p = refl-computational-Id + right-inv-concatr-computational-Id (z , p , q) = + ind-yoneda-Id + ( λ _ q → + ( (z , p , q) ∙ᵣʲ inv-computational-Id (z , p , q)) = + ( refl-computational-Id)) + ( eq-pair-eq-pr2 (eq-pair (right-inv-yoneda-Id p) refl)) + ( q) + +module _ + {l : Level} {A : UU l} {x y : A} + where + + distributive-inv-concatr-computational-Id : + (p : x =ʲ y) {z : A} (q : y =ʲ z) → + inv-computational-Id (p ∙ᵣʲ q) = + inv-computational-Id q ∙ᵣʲ inv-computational-Id p + distributive-inv-concatr-computational-Id p q = + ind-computational-Id + ( λ _ q → + inv-computational-Id (p ∙ᵣʲ q) = + inv-computational-Id q ∙ᵣʲ inv-computational-Id p) + ( inv left-unit-concatr-computational-Id) + ( q) ``` -## References +## See also -- +- [The judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index 5cd9a38f93..fd0e6d032a 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -1,4 +1,4 @@ -# Judgmentally compositional identity types +# The judgmentally compositional identity types ```agda module foundation.judgmentally-compositional-identity-types where @@ -27,6 +27,7 @@ open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families +open import foundation-core.transport-along-identifications ```
@@ -35,26 +36,28 @@ open import foundation-core.torsorial-type-families The [standard definition of identity types](foundation-core.identity-types.md) suffer the limitation that many of the basic operations only satisfy algebraic -laws _weakly_. - -In this file, we consider the -{{#concept "judgmentally compositional identity types" Agda=compositional-Id}} +laws _weakly_. In this file, we consider the +{{#concept "judgmentally compositional identity types" Agda=yoneda-Id}} ```text - (x =ᶜ y) := (z : A) → (z = x) → (z = y) + (x =ʸ y) := (z : A) → (z = x) → (z = y) ``` This type family is [equivalent](foundation-core.equivalences.md) to the standard identity types, but satisfies the laws -- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` -- `p ∙ refl = p` +- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` +- `refl ∙ p = p` +- `p ∙ refl = p` -judgmentally. This is achieved by proxiyng to, and using the computational -properties of function composition, and relies heavily on the +judgmentally. This is achieved by proxiyng to function composition and utilizing +its computational properties, and relies heavily on the [function extensionality axiom](foundation.function-extensionality.md). +In addition, we can make the type satisfy the judgmental law + +- `inv refl = refl`. + ## Definition ```agda @@ -62,15 +65,15 @@ module _ {l : Level} {A : UU l} where - compositional-Id : (x y : A) → UU l - compositional-Id x y = (z : A) → z = x → z = y + yoneda-Id : (x y : A) → UU l + yoneda-Id x y = (z : A) → z = x → z = y - infix 6 _=ᶜ_ - _=ᶜ_ : A → A → UU l - (a =ᶜ b) = compositional-Id a b + infix 6 _=ʸ_ + _=ʸ_ : A → A → UU l + (a =ʸ b) = yoneda-Id a b - refl-compositional-Id : {x : A} → x =ᶜ x - refl-compositional-Id {x} z = id + refl-yoneda-Id : {x : A} → x =ʸ x + refl-yoneda-Id {x} z = id ``` ## Properties @@ -82,57 +85,66 @@ module _ {l : Level} {A : UU l} where - commutative-concat-Id-compositional-Id : - {x y z w : A} (f : x =ᶜ y) (p : w = z) (q : z = x) → + commutative-postconcat-Id-yoneda-Id : + {x y z w : A} (f : x =ʸ y) (p : w = z) (q : z = x) → f w (p ∙ q) = p ∙ f z q - commutative-concat-Id-compositional-Id f refl q = refl + commutative-postconcat-Id-yoneda-Id f refl q = refl - commutative-concat-refl-Id-compositional-Id : - {x y z : A} (f : x =ᶜ y) (q : z = x) → f z q = q ∙ f x refl - commutative-concat-refl-Id-compositional-Id {z = z} f q = - ap (f z) (inv right-unit) ∙ commutative-concat-Id-compositional-Id f q refl + commutative-postconcat-refl-Id-yoneda-Id : + {x y z : A} (f : x =ʸ y) (q : z = x) → f z q = q ∙ f x refl + commutative-postconcat-refl-Id-yoneda-Id {z = z} f q = + ap (f z) (inv right-unit) ∙ commutative-postconcat-Id-yoneda-Id f q refl - commutative-concatr-Id-compositional-Id : - {x y z w : A} (f : x =ᶜ y) (p : w = z) (q : z = x) → + commutative-postconcatr-Id-yoneda-Id : + {x y z w : A} (f : x =ʸ y) (p : w = z) (q : z = x) → f w (p ∙ᵣ q) = p ∙ᵣ f z q - commutative-concatr-Id-compositional-Id f refl refl = inv left-unit-concatr - - commutative-concatr-refl-Id-compositional-Id : - {x y z : A} (f : x =ᶜ y) (q : z = x) → f z q = q ∙ᵣ f x refl - commutative-concatr-refl-Id-compositional-Id f q = - commutative-concatr-Id-compositional-Id f q refl - - compute-inv-Id-compositional-Id : - {x y : A} (f : x =ᶜ y) → f y (inv (f x refl)) = refl - compute-inv-Id-compositional-Id {x} f = - ( commutative-concat-refl-Id-compositional-Id f (inv (f x refl))) ∙ + commutative-postconcatr-Id-yoneda-Id {x} {y} {z} {w} f p q = + ( ap (f w) (eq-concat-concatr p q)) ∙ + ( commutative-postconcat-Id-yoneda-Id f p q) ∙ + ( eq-concatr-concat p (f z q)) + + commutative-postconcatr-refl-Id-yoneda-Id : + {x y z : A} (f : x =ʸ y) (q : z = x) → f z q = q ∙ᵣ f x refl + commutative-postconcatr-refl-Id-yoneda-Id f q = + commutative-postconcatr-Id-yoneda-Id f q refl + + compute-inv-Id-yoneda-Id : + {x y : A} (f : x =ʸ y) → f y (inv (f x refl)) = refl + compute-inv-Id-yoneda-Id {x} f = + ( commutative-postconcat-refl-Id-yoneda-Id f (inv (f x refl))) ∙ ( left-inv (f x refl)) - compute-inv-Id-compositional-Id' : - {x y z : A} (f : x =ᶜ y) (p : x = x) → - f y (inv (f x p)) = f y (inv (f x refl) ∙ inv p) - compute-inv-Id-compositional-Id' {x} {y} f p = - ap - ( f y) - ( ( ap inv (commutative-concat-refl-Id-compositional-Id f p)) ∙ - ( distributive-inv-concat p (f x refl))) + inv-distributive-inv-Id-yoneda-Id : + {x y z : A} (f : x =ʸ y) (g : x =ʸ z) → + inv (g y (inv (f x refl))) = f z (inv (g x refl)) + inv-distributive-inv-Id-yoneda-Id {x} {y} f g = + ( ap inv (commutative-postconcat-refl-Id-yoneda-Id g (inv (f x refl)))) ∙ + ( distributive-inv-concat (inv (f x refl)) (g x refl)) ∙ + ( ap (inv (g x refl) ∙_) (inv-inv (f x refl))) ∙ + ( inv (commutative-postconcat-refl-Id-yoneda-Id f (inv (g x refl)))) + + distributive-inv-Id-yoneda-Id : + {x y z : A} (f : x =ʸ y) (g : x =ʸ z) → + f z (inv (g x refl)) = inv (g y (inv (f x refl))) + distributive-inv-Id-yoneda-Id f g = + inv (inv-distributive-inv-Id-yoneda-Id f g) ``` ### The judgmentally compositional identity types are equivalent to the standard identity types -We define the equivalence `compositional-eq-eq : x = y → x =ᶜ y` using the +We define the equivalence `yoneda-eq-eq : x = y → x =ʸ y` using the judgmentally right unital concatenation operation on identifications. While this makes the proof it is a section non-judgmental, it instead gives us the judgmental computation rules ```text - compositional-eq-eq refl = refl-compositional-Id + yoneda-eq-eq refl = refl-yoneda-Id ``` and ```text - eq-compositional-eq refl-compositional-Id = refl. + eq-yoneda-eq refl-yoneda-Id = refl. ``` The proof that it is a retraction requires the @@ -145,98 +157,97 @@ module _ {l : Level} {A : UU l} {x y : A} where - compositional-eq-eq : x = y → x =ᶜ y - compositional-eq-eq p z q = q ∙ᵣ p + yoneda-eq-eq : x = y → x =ʸ y + yoneda-eq-eq p z q = q ∙ᵣ p - eq-compositional-eq : x =ᶜ y → x = y - eq-compositional-eq f = f x refl + eq-yoneda-eq : x =ʸ y → x = y + eq-yoneda-eq f = f x refl - is-section-eq-compositional-eq : - is-section compositional-eq-eq eq-compositional-eq - is-section-eq-compositional-eq f = + is-section-eq-yoneda-eq : + is-section yoneda-eq-eq eq-yoneda-eq + is-section-eq-yoneda-eq f = eq-multivariable-htpy 2 - ( λ z p → inv (commutative-concatr-refl-Id-compositional-Id f p)) - - is-retraction-eq-compositional-eq : - is-retraction compositional-eq-eq eq-compositional-eq - is-retraction-eq-compositional-eq p = left-unit-concatr - - is-equiv-compositional-eq-eq : is-equiv compositional-eq-eq - pr1 (pr1 is-equiv-compositional-eq-eq) = eq-compositional-eq - pr2 (pr1 is-equiv-compositional-eq-eq) = is-section-eq-compositional-eq - pr1 (pr2 is-equiv-compositional-eq-eq) = eq-compositional-eq - pr2 (pr2 is-equiv-compositional-eq-eq) = is-retraction-eq-compositional-eq - - is-equiv-eq-compositional-eq : is-equiv eq-compositional-eq - pr1 (pr1 is-equiv-eq-compositional-eq) = compositional-eq-eq - pr2 (pr1 is-equiv-eq-compositional-eq) = is-retraction-eq-compositional-eq - pr1 (pr2 is-equiv-eq-compositional-eq) = compositional-eq-eq - pr2 (pr2 is-equiv-eq-compositional-eq) = is-section-eq-compositional-eq - - equiv-compositional-eq-eq : (x = y) ≃ (x =ᶜ y) - pr1 equiv-compositional-eq-eq = compositional-eq-eq - pr2 equiv-compositional-eq-eq = is-equiv-compositional-eq-eq - - equiv-eq-compositional-eq : (x =ᶜ y) ≃ (x = y) - pr1 equiv-eq-compositional-eq = eq-compositional-eq - pr2 equiv-eq-compositional-eq = is-equiv-eq-compositional-eq + ( λ _ p → inv (commutative-postconcatr-refl-Id-yoneda-Id f p)) + + is-retraction-eq-yoneda-eq : + is-retraction yoneda-eq-eq eq-yoneda-eq + is-retraction-eq-yoneda-eq p = left-unit-concatr + + is-equiv-yoneda-eq-eq : is-equiv yoneda-eq-eq + pr1 (pr1 is-equiv-yoneda-eq-eq) = eq-yoneda-eq + pr2 (pr1 is-equiv-yoneda-eq-eq) = is-section-eq-yoneda-eq + pr1 (pr2 is-equiv-yoneda-eq-eq) = eq-yoneda-eq + pr2 (pr2 is-equiv-yoneda-eq-eq) = is-retraction-eq-yoneda-eq + + is-equiv-eq-yoneda-eq : is-equiv eq-yoneda-eq + pr1 (pr1 is-equiv-eq-yoneda-eq) = yoneda-eq-eq + pr2 (pr1 is-equiv-eq-yoneda-eq) = is-retraction-eq-yoneda-eq + pr1 (pr2 is-equiv-eq-yoneda-eq) = yoneda-eq-eq + pr2 (pr2 is-equiv-eq-yoneda-eq) = is-section-eq-yoneda-eq + + equiv-yoneda-eq-eq : (x = y) ≃ (x =ʸ y) + pr1 equiv-yoneda-eq-eq = yoneda-eq-eq + pr2 equiv-yoneda-eq-eq = is-equiv-yoneda-eq-eq + + equiv-eq-yoneda-eq : (x =ʸ y) ≃ (x = y) + pr1 equiv-eq-yoneda-eq = eq-yoneda-eq + pr2 equiv-eq-yoneda-eq = is-equiv-eq-yoneda-eq ``` -The reflexivity witnesses are mapped to reflexivity witnesses judgementally. +The reflexivity witnesses are mapped to reflexivity witnesses judgmentally. ```agda module _ {l : Level} {A : UU l} where - compute-compositional-eq-eq-refl : - {x : A} → compositional-eq-eq (refl {x = x}) = refl-compositional-Id - compute-compositional-eq-eq-refl = refl + preserves-refl-yoneda-eq-eq : + {x : A} → yoneda-eq-eq (refl {x = x}) = refl-yoneda-Id + preserves-refl-yoneda-eq-eq = refl - compute-eq-compositional-eq-refl : - {x : A} → eq-compositional-eq (refl-compositional-Id {x = x}) = refl - compute-eq-compositional-eq-refl = refl + preserves-refl-eq-yoneda-eq : + {x : A} → eq-yoneda-eq (refl-yoneda-Id {x = x}) = refl + preserves-refl-eq-yoneda-eq = refl ``` -An alternative definition of `compositional-eq-eq'` using the judgmentally left -unital concatenation operation on standard identity types. +An alternative definition of `yoneda-eq-eq'` using the judgmentally left unital +concatenation operation on standard identity types. ```agda module _ {l : Level} {A : UU l} {x y : A} where - compositional-eq-eq' : x = y → x =ᶜ y - compositional-eq-eq' p z q = q ∙ p + yoneda-eq-eq' : x = y → x =ʸ y + yoneda-eq-eq' p z q = q ∙ p - is-section-eq-compositional-eq' : - is-section compositional-eq-eq' eq-compositional-eq - is-section-eq-compositional-eq' f = + is-section-eq-yoneda-eq' : + is-section yoneda-eq-eq' eq-yoneda-eq + is-section-eq-yoneda-eq' f = eq-multivariable-htpy 2 - ( λ z p → inv (commutative-concat-refl-Id-compositional-Id f p)) + ( λ _ p → inv (commutative-postconcat-refl-Id-yoneda-Id f p)) - is-retraction-eq-compositional-eq' : - is-retraction compositional-eq-eq' eq-compositional-eq - is-retraction-eq-compositional-eq' p = refl + is-retraction-eq-yoneda-eq' : + is-retraction yoneda-eq-eq' eq-yoneda-eq + is-retraction-eq-yoneda-eq' p = refl module _ {l : Level} {A : UU l} where - compute-compositional-eq-eq-refl' : - {x : A} → compositional-eq-eq' (refl {x = x}) = refl-compositional-Id - compute-compositional-eq-eq-refl' = - eq-multivariable-htpy 2 (λ z p → right-unit) + preserves-refl-yoneda-eq-eq' : + {x : A} → yoneda-eq-eq' (refl {x = x}) = refl-yoneda-Id + preserves-refl-yoneda-eq-eq' = + eq-multivariable-htpy 2 (λ _ p → right-unit) ``` ### The induction principle for judgmentally compositional identity types -The judgementally compositional identity types satisfy the induction principle -of the identity types. This states that given a base point `x : A` and a family -of types over the identity types based at `x`, -`B : (y : A) (f : x =ᶜ y) → UU l2`, then to construct a dependent function -`f : (y : A) (f : x =ᶜ y) → B y p` it suffices to define it at -`f x refl-compositional-Id`. +The judgmentally compositional identity types satisfy the induction principle of +the identity types. This states that given a base point `x : A` and a family of +types over the identity types based at `x`, `B : (y : A) (f : x =ʸ y) → UU l2`, +then to construct a dependent function `f : (y : A) (f : x =ʸ y) → B y p` it +suffices to define it at `f x refl-yoneda-Id`. **Note.** A drawback of the judgmentally compositional identity types is that they do not satisfy a judgmental computation rule for this induction principle. @@ -246,61 +257,67 @@ module _ {l : Level} {A : UU l} {x : A} where - is-torsorial-compositional-Id : is-torsorial (compositional-Id x) - is-torsorial-compositional-Id = + is-torsorial-yoneda-Id : is-torsorial (yoneda-Id x) + is-torsorial-yoneda-Id = is-contr-equiv ( Σ A (x =_)) - ( equiv-tot (λ y → equiv-eq-compositional-eq {x = x} {y})) + ( equiv-tot (λ y → equiv-eq-yoneda-eq {x = x} {y})) ( is-torsorial-Id x) - dependent-universal-property-identity-system-compositional-Id : + dependent-universal-property-identity-system-yoneda-Id : dependent-universal-property-identity-system - ( compositional-Id x) - ( refl-compositional-Id) - dependent-universal-property-identity-system-compositional-Id = + ( yoneda-Id x) + ( refl-yoneda-Id) + dependent-universal-property-identity-system-yoneda-Id = dependent-universal-property-identity-system-is-torsorial - ( refl-compositional-Id) - ( is-torsorial-compositional-Id) + ( refl-yoneda-Id) + ( is-torsorial-yoneda-Id) module _ {l1 l2 : Level} {A : UU l1} {x : A} - (B : (y : A) (f : x =ᶜ y) → UU l2) + (B : (y : A) (f : x =ʸ y) → UU l2) where - ind-compositional-Id : - (b : B x refl-compositional-Id) {y : A} (f : x =ᶜ y) → B y f - ind-compositional-Id b {y} = + ind-yoneda-Id : + (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y f + ind-yoneda-Id b {y} = map-inv-is-equiv - ( dependent-universal-property-identity-system-compositional-Id B) + ( dependent-universal-property-identity-system-yoneda-Id B) ( b) ( y) - compute-ind-compositional-Id : - (b : B x refl-compositional-Id) → - ind-compositional-Id b refl-compositional-Id = b - compute-ind-compositional-Id = + compute-ind-yoneda-Id : + (b : B x refl-yoneda-Id) → + ind-yoneda-Id b refl-yoneda-Id = b + compute-ind-yoneda-Id = is-section-map-inv-is-equiv - ( dependent-universal-property-identity-system-compositional-Id B) + ( dependent-universal-property-identity-system-yoneda-Id B) - uniqueness-ind-compositional-Id : - (b : (y : A) (f : x =ᶜ y) → B y f) → - (λ y → ind-compositional-Id (b x refl-compositional-Id) {y}) = b - uniqueness-ind-compositional-Id = + uniqueness-ind-yoneda-Id : + (b : (y : A) (f : x =ʸ y) → B y f) → + (λ y → ind-yoneda-Id (b x refl-yoneda-Id) {y}) = b + uniqueness-ind-yoneda-Id = is-retraction-map-inv-is-equiv - ( dependent-universal-property-identity-system-compositional-Id B) + ( dependent-universal-property-identity-system-yoneda-Id B) ``` ## Structure -The judgementally compositional identity types form a judgmentally compositional +The judgmentally compositional identity types form a judgmentally compositional weak groupoidal structure on types. ### Inverting judgmentally compositional identifications We consider two ways of defining the inversion operation on judgmentally compositional identifications: by the judgmentally left unital, and judgmentally -right unital concatenation respectively. Elsewhere, we will prefer the latter by -convention. +right unital concatenation operation on the underlying identity type +respectively. The latter enjoys the computational property + +```text + inv refl = refl, +``` + +hence will be preferred elsewhere. #### The inversion operation defined by the judgmentally left unital concatenation operation on identifications @@ -309,23 +326,21 @@ module _ {l : Level} {A : UU l} where - invl-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x - invl-compositional-Id {x} f z p = p ∙ inv (f x refl) + invl-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x + invl-yoneda-Id {x} f z p = p ∙ inv (f x refl) - compute-invl-compositional-Id-refl : + compute-invl-yoneda-Id-refl : {x : A} → - invl-compositional-Id (refl-compositional-Id {x = x}) = - refl-compositional-Id - compute-invl-compositional-Id-refl = - eq-multivariable-htpy 2 (λ z p → right-unit) - - invl-invl-compositional-Id : - {x y : A} (f : x =ᶜ y) → invl-compositional-Id (invl-compositional-Id f) = f - invl-invl-compositional-Id {x} f = + invl-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + compute-invl-yoneda-Id-refl = eq-multivariable-htpy 2 (λ _ p → right-unit) + + invl-invl-yoneda-Id : + {x y : A} (f : x =ʸ y) → invl-yoneda-Id (invl-yoneda-Id f) = f + invl-invl-yoneda-Id {x} f = eq-multivariable-htpy 2 - ( λ w p → + ( λ _ p → ap (p ∙_) (inv-inv (f x refl)) ∙ - inv (commutative-concat-refl-Id-compositional-Id f p)) + inv (commutative-postconcat-refl-Id-yoneda-Id f p)) ``` The inversion operation corresponds to the standard inversion operation on @@ -336,19 +351,19 @@ module _ {l : Level} {A : UU l} where - commutative-invl-compositional-eq-eq : + preserves-invl-yoneda-eq-eq : {x y : A} (p : x = y) → - compositional-eq-eq (inv p) = invl-compositional-Id (compositional-eq-eq p) - commutative-invl-compositional-eq-eq p = + yoneda-eq-eq (inv p) = invl-yoneda-Id (yoneda-eq-eq p) + preserves-invl-yoneda-eq-eq p = eq-multivariable-htpy 2 - ( λ z q → + ( λ _ q → ( eq-concat-concatr q (inv p)) ∙ - ( ap (λ x → q ∙ inv x) (inv left-unit-concatr))) + ( ap (λ r → q ∙ inv r) (inv left-unit-concatr))) - commutative-invl-eq-compositional-eq : - {x y : A} (f : x =ᶜ y) → - eq-compositional-eq (invl-compositional-Id f) = inv (eq-compositional-eq f) - commutative-invl-eq-compositional-eq f = refl + preserves-invl-eq-yoneda-eq : + {x y : A} (f : x =ʸ y) → + eq-yoneda-eq (invl-yoneda-Id f) = inv (eq-yoneda-eq f) + preserves-invl-eq-yoneda-eq f = refl ``` #### The inversion operation defined by the judgmentally right unital concatenation operation on identifications @@ -358,23 +373,22 @@ module _ {l : Level} {A : UU l} where - invr-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x - invr-compositional-Id {x} f z p = p ∙ᵣ inv (f x refl) + invr-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x + invr-yoneda-Id {x} f z p = p ∙ᵣ inv (f x refl) - compute-invr-compositional-Id-refl : + compute-invr-yoneda-Id-refl : {x : A} → - invr-compositional-Id (refl-compositional-Id {x = x}) = - refl-compositional-Id - compute-invr-compositional-Id-refl = refl - - invr-invr-compositional-Id : - {x y : A} (f : x =ᶜ y) → - invr-compositional-Id (invr-compositional-Id f) = f - invr-invr-compositional-Id {x} f = + invr-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + compute-invr-yoneda-Id-refl = refl + + invr-invr-yoneda-Id : + {x y : A} (f : x =ʸ y) → + invr-yoneda-Id (invr-yoneda-Id f) = f + invr-invr-yoneda-Id {x} f = eq-multivariable-htpy 2 - ( λ w p → + ( λ _ p → ( ap (p ∙ᵣ_) (ap inv left-unit-concatr ∙ inv-inv (f x refl))) ∙ - ( inv (commutative-concatr-refl-Id-compositional-Id f p))) + ( inv (commutative-postconcatr-refl-Id-yoneda-Id f p))) ``` ```agda @@ -382,23 +396,23 @@ module _ {l : Level} {A : UU l} where - commutative-invr-compositional-eq-eq' : + preserves-invr-yoneda-eq-eq' : {x y : A} (p : x = y) → - compositional-eq-eq (inv p) = invr-compositional-Id (compositional-eq-eq' p) - commutative-invr-compositional-eq-eq' p = refl + yoneda-eq-eq (inv p) = invr-yoneda-Id (yoneda-eq-eq' p) + preserves-invr-yoneda-eq-eq' p = refl - commutative-invr-compositional-eq-eq : + preserves-invr-yoneda-eq-eq : {x y : A} (p : x = y) → - compositional-eq-eq (inv p) = invr-compositional-Id (compositional-eq-eq p) - commutative-invr-compositional-eq-eq refl = refl + yoneda-eq-eq (inv p) = invr-yoneda-Id (yoneda-eq-eq p) + preserves-invr-yoneda-eq-eq refl = refl - commutative-invr-eq-compositional-eq : - {x y : A} (f : x =ᶜ y) → - eq-compositional-eq (invr-compositional-Id f) = inv (eq-compositional-eq f) - commutative-invr-eq-compositional-eq {x} {y} f = left-unit-concatr + preserves-invr-eq-yoneda-eq : + {x y : A} (f : x =ʸ y) → + eq-yoneda-eq (invr-yoneda-Id f) = inv (eq-yoneda-eq f) + preserves-invr-eq-yoneda-eq {x} {y} f = left-unit-concatr ``` -We prefer the inversion operation defined by the judgmentally right unital +We will prefer the inversion operation defined by the judgmentally right unital concatenation operation on identifications by convention, as it satisfies the judgmental computation law @@ -411,19 +425,16 @@ module _ {l : Level} {A : UU l} where - inv-compositional-Id : {x y : A} → x =ᶜ y → y =ᶜ x - inv-compositional-Id = invr-compositional-Id + inv-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x + inv-yoneda-Id = invr-yoneda-Id - compute-inv-compositional-Id-refl : - {x : A} → - inv-compositional-Id (refl-compositional-Id {x = x}) = - refl-compositional-Id - compute-inv-compositional-Id-refl = compute-invr-compositional-Id-refl - - inv-inv-compositional-Id : - {x y : A} (f : x =ᶜ y) → - inv-compositional-Id (inv-compositional-Id f) = f - inv-inv-compositional-Id = invr-invr-compositional-Id + compute-inv-yoneda-Id-refl : + {x : A} → inv-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + compute-inv-yoneda-Id-refl = compute-invr-yoneda-Id-refl + + inv-inv-yoneda-Id : + {x y : A} (f : x =ʸ y) → inv-yoneda-Id (inv-yoneda-Id f) = f + inv-inv-yoneda-Id = invr-invr-yoneda-Id ``` ### Concatenation of judgmentally compositional identifications @@ -433,15 +444,15 @@ module _ {l : Level} {A : UU l} where - infixl 15 _∙ᶜ_ - _∙ᶜ_ : {x y z : A} → x =ᶜ y → y =ᶜ z → x =ᶜ z - (f ∙ᶜ g) z p = g z (f z p) + infixl 15 _∙ʸ_ + _∙ʸ_ : {x y z : A} → x =ʸ y → y =ʸ z → x =ʸ z + (f ∙ʸ g) z p = g z (f z p) - concat-compositional-Id : {x y : A} → x =ᶜ y → (z : A) → y =ᶜ z → x =ᶜ z - concat-compositional-Id f z g = f ∙ᶜ g + concat-yoneda-Id : {x y : A} → x =ʸ y → (z : A) → y =ʸ z → x =ʸ z + concat-yoneda-Id f z g = f ∙ʸ g - concat-compositional-Id' : (x : A) {y z : A} → y =ᶜ z → x =ᶜ y → x =ᶜ z - concat-compositional-Id' x g f = f ∙ᶜ g + concat-yoneda-Id' : (x : A) {y z : A} → y =ʸ z → x =ʸ y → x =ʸ z + concat-yoneda-Id' x g f = f ∙ʸ g ``` The concatenation operation corresponds to the standard concatenation operation @@ -452,111 +463,116 @@ module _ {l : Level} {A : UU l} where - commutative-concat-compositional-eq-eq : + preserves-concat-yoneda-eq-eq : {x y z : A} (p : x = y) (q : y = z) → - compositional-eq-eq (p ∙ q) = compositional-eq-eq p ∙ᶜ compositional-eq-eq q - commutative-concat-compositional-eq-eq refl refl = refl - - commutative-concat-eq-compositional-eq : - {x y z : A} (f : x =ᶜ y) (g : y =ᶜ z) → - eq-compositional-eq (f ∙ᶜ g) = eq-compositional-eq f ∙ eq-compositional-eq g - commutative-concat-eq-compositional-eq {x} {y} {z} f g = - commutative-concat-refl-Id-compositional-Id g (f x refl) + yoneda-eq-eq (p ∙ q) = yoneda-eq-eq p ∙ʸ yoneda-eq-eq q + preserves-concat-yoneda-eq-eq refl refl = refl + + preserves-concat-eq-yoneda-eq : + {x y z : A} (f : x =ʸ y) (g : y =ʸ z) → + eq-yoneda-eq (f ∙ʸ g) = eq-yoneda-eq f ∙ eq-yoneda-eq g + preserves-concat-eq-yoneda-eq {x} f g = + commutative-postconcat-refl-Id-yoneda-Id g (f x refl) ``` ### The groupoidal laws for the judgmentally compositional identity types ```agda module _ - {l : Level} {A : UU l} + {l : Level} {A : UU l} {x y : A} where - assoc-compositional-Id : - {x y z w : A} (f : x =ᶜ y) (g : y =ᶜ z) (h : z =ᶜ w) → - (f ∙ᶜ g) ∙ᶜ h = f ∙ᶜ (g ∙ᶜ h) - assoc-compositional-Id f g h = refl + assoc-yoneda-Id : + (f : x =ʸ y) {z w : A} (g : y =ʸ z) (h : z =ʸ w) → + (f ∙ʸ g) ∙ʸ h = f ∙ʸ (g ∙ʸ h) + assoc-yoneda-Id f g h = refl - left-unit-compositional-Id : - {x y : A} {f : x =ᶜ y} → refl-compositional-Id ∙ᶜ f = f - left-unit-compositional-Id = refl + left-unit-yoneda-Id : + {f : x =ʸ y} → refl-yoneda-Id ∙ʸ f = f + left-unit-yoneda-Id = refl - right-unit-compositional-Id : - {x y : A} {f : x =ᶜ y} → f ∙ᶜ refl-compositional-Id = f - right-unit-compositional-Id = refl + right-unit-yoneda-Id : + {f : x =ʸ y} → f ∙ʸ refl-yoneda-Id = f + right-unit-yoneda-Id = refl - left-inv-compositional-Id : - {x y : A} (f : x =ᶜ y) → - inv-compositional-Id f ∙ᶜ f = refl-compositional-Id - left-inv-compositional-Id {x} f = + left-inv-yoneda-Id : + (f : x =ʸ y) → inv-yoneda-Id f ∙ʸ f = refl-yoneda-Id + left-inv-yoneda-Id f = eq-multivariable-htpy 2 - ( λ z p → - ( commutative-concatr-Id-compositional-Id f p (inv (f x refl))) ∙ - ( ap (p ∙ᵣ_) (compute-inv-Id-compositional-Id f))) - - left-invl-compositional-Id : - {x y : A} (f : x =ᶜ y) → - invl-compositional-Id f ∙ᶜ f = refl-compositional-Id - left-invl-compositional-Id {x} f = + ( λ _ p → + ( commutative-postconcatr-Id-yoneda-Id f p (inv (f x refl))) ∙ + ( ap (p ∙ᵣ_) (compute-inv-Id-yoneda-Id f))) + + left-invl-yoneda-Id : + (f : x =ʸ y) → invl-yoneda-Id f ∙ʸ f = refl-yoneda-Id + left-invl-yoneda-Id f = eq-multivariable-htpy 2 - ( λ z p → - ( commutative-concat-Id-compositional-Id f p (inv (f x refl))) ∙ - ( ap (p ∙_) (compute-inv-Id-compositional-Id f) ∙ right-unit)) - - right-inv-compositional-Id : - {x y : A} (f : x =ᶜ y) → - f ∙ᶜ inv-compositional-Id f = refl-compositional-Id - right-inv-compositional-Id {x} f = + ( λ _ p → + ( commutative-postconcat-Id-yoneda-Id f p (inv (f x refl))) ∙ + ( ap (p ∙_) (compute-inv-Id-yoneda-Id f) ∙ right-unit)) + + right-inv-yoneda-Id : + (f : x =ʸ y) → f ∙ʸ inv-yoneda-Id f = refl-yoneda-Id + right-inv-yoneda-Id f = eq-multivariable-htpy 2 - ( λ z p → - ( ap (_∙ᵣ inv (f x refl)) - ( commutative-concatr-refl-Id-compositional-Id f p)) ∙ + ( λ _ p → + ( ap + ( _∙ᵣ inv (f x refl)) + ( commutative-postconcatr-refl-Id-yoneda-Id f p)) ∙ ( assoc-concatr p (f x refl) (inv (f x refl))) ∙ ( ap (p ∙ᵣ_) (right-inv-concatr (f x refl)))) - right-invl-compositional-Id : - {x y : A} (f : x =ᶜ y) → - f ∙ᶜ invl-compositional-Id f = refl-compositional-Id - right-invl-compositional-Id {x} f = + right-invl-yoneda-Id : + (f : x =ʸ y) → f ∙ʸ invl-yoneda-Id f = refl-yoneda-Id + right-invl-yoneda-Id f = eq-multivariable-htpy 2 - ( λ z p → + ( λ _ p → ( ap ( _∙ inv (f x refl)) - ( commutative-concat-refl-Id-compositional-Id f p)) ∙ + ( commutative-postconcat-refl-Id-yoneda-Id f p)) ∙ ( assoc p (f x refl) (inv (f x refl))) ∙ ( ap (p ∙_) (right-inv (f x refl))) ∙ ( right-unit)) - distributive-inv-concat-compositional-Id : - {x y : A} (f : x =ᶜ y) {z : A} (g : y =ᶜ z) → - inv-compositional-Id (f ∙ᶜ g) = - inv-compositional-Id g ∙ᶜ inv-compositional-Id f - distributive-inv-concat-compositional-Id {x} {y} f g = + distributive-inv-concat-yoneda-Id : + (f : x =ʸ y) {z : A} (g : y =ʸ z) → + inv-yoneda-Id (f ∙ʸ g) = inv-yoneda-Id g ∙ʸ inv-yoneda-Id f + distributive-inv-concat-yoneda-Id f g = eq-multivariable-htpy 2 - ( λ z p → + ( λ _ p → ( ap ( p ∙ᵣ_) ( ( ap ( inv) - ( commutative-concatr-refl-Id-compositional-Id g (f x refl))) ∙ + ( commutative-postconcatr-refl-Id-yoneda-Id g (f x refl))) ∙ ( distributive-inv-concatr (f x refl) (g y refl)))) ∙ ( inv (assoc-concatr p (inv (g y refl)) (inv (f x refl))))) - distributive-invl-concat-compositional-Id : - {x y : A} (f : x =ᶜ y) {z : A} (g : y =ᶜ z) → - invl-compositional-Id (f ∙ᶜ g) = - invl-compositional-Id g ∙ᶜ invl-compositional-Id f - distributive-invl-concat-compositional-Id {x} {y} f g = + distributive-invl-concat-yoneda-Id : + (f : x =ʸ y) {z : A} (g : y =ʸ z) → + invl-yoneda-Id (f ∙ʸ g) = invl-yoneda-Id g ∙ʸ invl-yoneda-Id f + distributive-invl-concat-yoneda-Id f g = eq-multivariable-htpy 2 - ( λ z p → + ( λ _ p → ( ap ( p ∙_) ( ( ap ( inv) - ( commutative-concat-refl-Id-compositional-Id g (f x refl))) ∙ + ( commutative-postconcat-refl-Id-yoneda-Id g (f x refl))) ∙ ( distributive-inv-concat (f x refl) (g y refl)))) ∙ ( inv (assoc p (inv (g y refl)) (inv (f x refl))))) ``` +## See also + +- [The judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) + for an identity relation that is strictly involutive, one-sided unital, and + has a judgmentally computational induction principle. +- [The computational identity types](foundation.computational-identity-types.md) + for an identity relation that is judgmentally involutive, associative, and + one-sided unital, but does not have a judgmentally computational induction + principle. + ## References - diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index ccda1f78bc..b8e589e245 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -1,4 +1,4 @@ -# Judgmentally involutive identity types +# The judgmentally involutive identity types ```agda module foundation.judgmentally-involutive-identity-types where @@ -33,9 +33,7 @@ open import foundation-core.torsorial-type-families The [standard definition of identity types](foundation-core.identity-types.md) suffer the limitation that many of the basic operations only satisfy algebraic -laws _weakly_. - -In this file, we consider the +laws _weakly_. In this file, we consider the {{#concept "judgmentally involutive identity types" Agda=involutive-Id}} ```text @@ -43,17 +41,16 @@ In this file, we consider the ``` This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the judgmental law +standard identity types, but satisfies the judgmental laws -```text - inv (inv p) = p. -``` +- `inv (inv p) = p` +- `inv refl = refl` In addition, we maintain the following judgmental laws -- `inv refl = refl` -- `ind-Id f refl = f refl` -- `refl ∙ p = p` +- `inv refl = refl` +- `ind-Id f refl = f refl` +- `refl ∙ p = p` or `p ∙ refl = p` among other more technical ones considered in this file. @@ -79,8 +76,9 @@ module _ ### The judgmentally involutive identity types are equivalent to the standard identity types -In fact, the [retraction](foundation-core.retractions.md) is judgmental, and the -equivalence preserves the groupoid structure. +In fact, the [retraction](foundation-core.retractions.md) is judgmental, the +equivalence preserves the groupoid structure, and moreover preserves the +reflexivities judgmentally. ```agda module _ @@ -124,18 +122,18 @@ module _ {l : Level} {A : UU l} where - involutive-eq-eq-refl : + preserves-refl-involutive-eq-eq : {x : A} → involutive-eq-eq (refl {x = x}) = refl-involutive-Id - involutive-eq-eq-refl = refl + preserves-refl-involutive-eq-eq = refl - eq-involutive-eq-refl : + preserves-refl-eq-involutive-eq : {x : A} → eq-involutive-eq (refl-involutive-Id {x = x}) = refl - eq-involutive-eq-refl = refl + preserves-refl-eq-involutive-eq = refl ``` ### The induction principle for judgmentally involutive identity types -The judgementally involutive identity types satisfy the induction principle of +The judgmentally involutive identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it @@ -188,7 +186,7 @@ module _ ## Structure -The judgementally involutive identity types form a judgmentally involutive weak +The judgmentally involutive identity types form a judgmentally involutive weak groupoidal structure on types. ### Inverting judgmentally involutive identifications @@ -196,15 +194,8 @@ groupoidal structure on types. We have an inversion operation on `involutive-Id` that satisfies the judgmental laws -```text - inv (inv p) = p -``` - -and - -```text - inv refl = refl. -``` +- `inv (inv p) = p`, and +- `inv refl = refl`. ```agda module _ @@ -232,15 +223,15 @@ module _ {l : Level} {A : UU l} where - commutative-inv-involutive-eq-eq : + preserves-inv-involutive-eq-eq : {x y : A} (p : x = y) → involutive-eq-eq (inv p) = inv-involutive-Id (involutive-eq-eq p) - commutative-inv-involutive-eq-eq refl = refl + preserves-inv-involutive-eq-eq refl = refl - commutative-inv-eq-involutive-eq : + preserves-inv-eq-involutive-eq : {x y : A} (p : x =ⁱ y) → eq-involutive-eq (inv-involutive-Id p) = inv (eq-involutive-eq p) - commutative-inv-eq-involutive-eq (z , p , q) = + preserves-inv-eq-involutive-eq (z , p , q) = ap (inv p ∙_) (inv (inv-inv q)) ∙ inv (distributive-inv-concat (inv q) p) ``` @@ -252,7 +243,7 @@ identifications using the to obtain a one-sided judgmental unit law. There is both a judgmentally left unital definition and a judgmentally right unital definition. To be consistent with the convention for the standard identity types, we take the judgmentally -left unital concatenation operation as the default. +left unital concatenation operation to be the default. #### The judgmentally left unital concatenation operation @@ -271,15 +262,15 @@ module _ concat-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z concat-involutive-Id' x q p = p ∙ⁱ q - commutative-concat-involutive-eq-eq : + preserves-concat-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ⁱ involutive-eq-eq q - commutative-concat-involutive-eq-eq refl q = refl + preserves-concat-involutive-eq-eq refl q = refl - commutative-concat-eq-involutive-eq : + preserves-concat-eq-involutive-eq : {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → eq-involutive-eq (p ∙ⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q - commutative-concat-eq-involutive-eq (w , p , q) (w' , p' , q') = + preserves-concat-eq-involutive-eq (w , p , q) (w' , p' , q') = ( ap ( _∙ p') ( ( distributive-inv-concatr (q' ∙ᵣ inv p) q) ∙ @@ -314,15 +305,15 @@ module _ eq-concat-concatr-involutive-Id (w , refl , q) (w' , p' , refl) = eq-pair-eq-pr2 (eq-pair (left-unit-concatr) (inv left-unit-concatr)) - commutative-concatr-involutive-eq-eq : + preserves-concatr-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ᵣⁱ involutive-eq-eq q - commutative-concatr-involutive-eq-eq p refl = ap involutive-eq-eq right-unit + preserves-concatr-involutive-eq-eq p refl = ap involutive-eq-eq right-unit - commutative-concatr-eq-involutive-eq : + preserves-concatr-eq-involutive-eq : {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → eq-involutive-eq (p ∙ᵣⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q - commutative-concatr-eq-involutive-eq (w , p , q) (w' , p' , q') = + preserves-concatr-eq-involutive-eq (w , p , q) (w' , p' , q') = ( ap ( inv q ∙_) ( ( eq-double-concat-concatr-left-associated p (inv q') p') ∙ @@ -332,9 +323,9 @@ module _ ### The groupoidal laws for the judgmentally involutive identity types -The general proof-technique is to induct on the necessary paths to make the left +The general proof-strategy is to induct on the necessary paths to make the left endpoints judgmentally equal, and then proceed by reasoning with the -groupoid-laws of the underlying identity system. +groupoid-laws of the underlying identity types. #### The groupoidal laws for the judgmentally left unital concatenation operation @@ -430,6 +421,16 @@ module _ eq-pair-eq-pr2 (eq-pair (inv left-unit-concatr) (left-unit-concatr)) ``` +## See also + +- [The judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) + for an identity relation that is strictly associative and unital, but does not + have a judgmentally computational induction principle. +- [The computational identity types](foundation.computational-identity-types.md) + for an identity relation that is judgmentally involutive, associative, and + one-sided unital, but does not have a judgmentally computational induction + principle. + ## References - diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md index 62ae3836f9..fbcb7857b5 100644 --- a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md @@ -74,7 +74,7 @@ module _ eq-concatr-concat : {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q - eq-concatr-concat refl refl = refl + eq-concatr-concat p refl = right-unit eq-concat-concatr : {x y z : A} (p : x = y) (q : y = z) → p ∙ᵣ q = p ∙ q From 332929cde443764974bb0d20af0f12f945abbc4d Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Fri, 2 Feb 2024 13:31:05 +0100 Subject: [PATCH 19/39] remove unused imports --- src/foundation/computational-identity-types.lagda.md | 7 ++----- .../judgmentally-compositional-identity-types.lagda.md | 6 ------ .../judgmentally-involutive-identity-types.lagda.md | 3 +-- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index de9fe662ac..5e8dd1ce97 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -9,20 +9,17 @@ module foundation.computational-identity-types where ```agda open import foundation.action-on-identifications-binary-functions open import foundation.action-on-identifications-functions -open import foundation.cartesian-product-types open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types -open import foundation.fundamental-theorem-of-identity-types open import foundation.judgmentally-compositional-identity-types open import foundation.judgmentally-right-unital-concatenation-identifications -open import foundation.multivariable-homotopies open import foundation.universal-property-identity-systems open import foundation.universe-levels +open import foundation-core.cartesian-product-types open import foundation-core.contractible-types open import foundation-core.equality-dependent-pair-types open import foundation-core.equivalences -open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types open import foundation-core.identity-types open import foundation-core.retractions @@ -52,7 +49,7 @@ where `x =ʸ y` is the The computational identity types are [equivalent](foundation-core.equivalences.md) to the standard identity types, -but satisfy the the following algebraic laws judgmentally: +but satisfy the following algebraic laws judgmentally: - `inv refl = refl` - `inv (inv p) = p` diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index fd0e6d032a..b907832d8f 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -8,18 +8,13 @@ module foundation.judgmentally-compositional-identity-types where ```agda open import foundation.action-on-identifications-functions -open import foundation.cartesian-product-types open import foundation.dependent-pair-types -open import foundation.equality-cartesian-product-types -open import foundation.function-extensionality -open import foundation.fundamental-theorem-of-identity-types open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.multivariable-homotopies open import foundation.universal-property-identity-systems open import foundation.universe-levels open import foundation-core.contractible-types -open import foundation-core.equality-dependent-pair-types open import foundation-core.equivalences open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types @@ -27,7 +22,6 @@ open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families -open import foundation-core.transport-along-identifications ``` diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index b8e589e245..333b86162f 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -8,7 +8,6 @@ module foundation.judgmentally-involutive-identity-types where ```agda open import foundation.action-on-identifications-functions -open import foundation.cartesian-product-types open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.judgmentally-right-unital-concatenation-identifications @@ -16,10 +15,10 @@ open import foundation.multivariable-homotopies open import foundation.universal-property-identity-systems open import foundation.universe-levels +open import foundation-core.cartesian-product-types open import foundation-core.contractible-types open import foundation-core.equality-dependent-pair-types open import foundation-core.equivalences -open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types open import foundation-core.identity-types open import foundation-core.retractions From 9541610e5614ffdde9e873a7a4d4666339f0c5bd Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Fri, 2 Feb 2024 17:11:57 +0100 Subject: [PATCH 20/39] part of review --- HOWTO-INSTALL.md | 2 +- .../computational-identity-types.lagda.md | 45 +++++++++---------- ...ally-compositional-identity-types.lagda.md | 36 +++++++-------- ...entally-involutive-identity-types.lagda.md | 22 ++++----- ...universal-property-identity-types.lagda.md | 4 +- 5 files changed, 54 insertions(+), 55 deletions(-) diff --git a/HOWTO-INSTALL.md b/HOWTO-INSTALL.md index 5826c33cc3..9d1e1b108a 100644 --- a/HOWTO-INSTALL.md +++ b/HOWTO-INSTALL.md @@ -259,7 +259,7 @@ To insert these symbols in the editor, follow these steps: 2. When the symbol appears as a greyed-out character in your editor, press `TAB` to insert it. -- `=`: Type `Id` or `equals` +- `=`: Type `Id` - `ょ`: Type `yoneda` - `⧄`: Type `diagonal` or `lifting` diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 5e8dd1ce97..b1f739555a 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -1,4 +1,4 @@ -# The computational identity types +# Computational identity types ```agda module foundation.computational-identity-types where @@ -31,9 +31,9 @@ open import foundation-core.torsorial-type-families ## Idea -The [standard definition of identity types](foundation-core.identity-types.md) -suffer the limitation that many of the basic operations only satisfy algebraic -laws _weakly_. In this file, we consider the +The standard definition of [identity types](foundation-core.identity-types.md) +has the limitation that many of the basic operations only satisfy algebraic laws +_weakly_. In this file, we consider the {{#concept "computational identity types" Agda=computational-Id}} ```text @@ -51,16 +51,16 @@ The computational identity types are [equivalent](foundation-core.equivalences.md) to the standard identity types, but satisfy the following algebraic laws judgmentally: -- `inv refl = refl` -- `inv (inv p) = p` -- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` or `p ∙ refl = p`. +- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` +- `refl ∙ p ≐ p` or `p ∙ refl ≐ p`. +- `inv refl ≐ refl` +- `inv (inv p) ≐ p` -**Note.** The computational identity types do not satisfy the judgmental laws +**Note.** The computational identity types do _not_ satisfy the judgmental laws -- `refl ∙ p = p` and `p ∙ refl = p` simultaneously, -- `inv p ∙ p = refl`, or -- `p ∙ inv p = refl`, +- `refl ∙ p ≐ p` and `p ∙ refl ≐ p` simultaneously, +- `inv p ∙ p ≐ refl`, or +- `p ∙ inv p ≐ refl`, and they do not have a judgmental computation property for their induction principle. @@ -88,7 +88,7 @@ module _ ### The computational identity types are equivalent to the standard identity types This equivalence preserves the groupoid structure of the computational identity -types and moreover preserves the reflexivity witnesses judgmentally. +types and moreover preserves the reflexivity elements judgmentally. ```agda module _ @@ -138,7 +138,7 @@ module _ pr2 equiv-eq-computational-eq = is-equiv-eq-computational-eq ``` -The reflexivity witnesses are preserved judgmentally. +The reflexivity elements are preserved judgmentally. ```agda module _ @@ -216,16 +216,16 @@ module _ The computational identity types form a groupoidal structure on types. This structure satisfies the following algebraic laws strictly -- `inv refl = refl` -- `inv (inv p) = p` -- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` or `p ∙ refl = p`. +- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` +- `refl ∙ p ≐ p` or `p ∙ refl ≐ p`. +- `inv (inv p) ≐ p` +- `inv refl ≐ refl` Note, however, that they do not satisfy the strict algebraic laws -- `refl ∙ p = p` and `p ∙ refl = p` simultaneously -- `inv p ∙ p = refl` -- `p ∙ inv p = refl`. +- `refl ∙ p ≐ p` and `p ∙ refl ≐ p` simultaneously +- `inv p ∙ p ≐ refl` +- `p ∙ inv p ≐ refl`. ### Inverting computational identifications @@ -504,13 +504,12 @@ module _ (p : x =ʲ y) {z : A} (q : y =ʲ z) → inv-computational-Id (p ∙ᵣʲ q) = inv-computational-Id q ∙ᵣʲ inv-computational-Id p - distributive-inv-concatr-computational-Id p q = + distributive-inv-concatr-computational-Id p = ind-computational-Id ( λ _ q → inv-computational-Id (p ∙ᵣʲ q) = inv-computational-Id q ∙ᵣʲ inv-computational-Id p) ( inv left-unit-concatr-computational-Id) - ( q) ``` ## See also diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index b907832d8f..d756ac1f78 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -1,4 +1,4 @@ -# The judgmentally compositional identity types +# Judgmentally compositional identity types ```agda module foundation.judgmentally-compositional-identity-types where @@ -28,9 +28,9 @@ open import foundation-core.torsorial-type-families ## Idea -The [standard definition of identity types](foundation-core.identity-types.md) -suffer the limitation that many of the basic operations only satisfy algebraic -laws _weakly_. In this file, we consider the +The standard definition of [identity types](foundation-core.identity-types.md) +has the limitation that many of the basic operations only satisfy algebraic laws +_weakly_. In this file, we consider the {{#concept "judgmentally compositional identity types" Agda=yoneda-Id}} ```text @@ -40,9 +40,9 @@ laws _weakly_. In this file, we consider the This type family is [equivalent](foundation-core.equivalences.md) to the standard identity types, but satisfies the laws -- `(p ∙ q) ∙ r = p ∙ (q ∙ r)` -- `refl ∙ p = p` -- `p ∙ refl = p` +- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` +- `refl ∙ p ≐ p` +- `p ∙ refl ≐ p` judgmentally. This is achieved by proxiyng to function composition and utilizing its computational properties, and relies heavily on the @@ -50,7 +50,7 @@ its computational properties, and relies heavily on the In addition, we can make the type satisfy the judgmental law -- `inv refl = refl`. +- `inv refl ≐ refl`. ## Definition @@ -127,24 +127,24 @@ module _ ### The judgmentally compositional identity types are equivalent to the standard identity types We define the equivalence `yoneda-eq-eq : x = y → x =ʸ y` using the -judgmentally right unital concatenation operation on identifications. While this -makes the proof it is a section non-judgmental, it instead gives us the -judgmental computation rules +judgmentally right unital concatenation operation on identifications. This gives +us the judgmental computation rules ```text - yoneda-eq-eq refl = refl-yoneda-Id + yoneda-eq-eq refl ≐ refl-yoneda-Id ``` and ```text - eq-yoneda-eq refl-yoneda-Id = refl. + eq-yoneda-eq refl-yoneda-Id ≐ refl. ``` The proof that it is a retraction requires the [function extensionality axiom](foundation.function-extensionality.md). However, -function extensionality will become indispensable regardless when we move to -proving miscellaneous algebraic laws of the type family. +function extensionality will become indispensable regardless when we proceed to +proving miscellaneous algebraic laws of the judgmentally compositional identity +type. ```agda module _ @@ -188,7 +188,7 @@ module _ pr2 equiv-eq-yoneda-eq = is-equiv-eq-yoneda-eq ``` -The reflexivity witnesses are mapped to reflexivity witnesses judgmentally. +The reflexivity elements are mapped to reflexivity elements judgmentally. ```agda module _ @@ -308,7 +308,7 @@ right unital concatenation operation on the underlying identity type respectively. The latter enjoys the computational property ```text - inv refl = refl, + inv refl ≐ refl, ``` hence will be preferred elsewhere. @@ -411,7 +411,7 @@ concatenation operation on identifications by convention, as it satisfies the judgmental computation law ```text - inv refl = refl. + inv refl ≐ refl. ``` ```agda diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index 333b86162f..27025694c2 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -1,4 +1,4 @@ -# The judgmentally involutive identity types +# Judgmentally involutive identity types ```agda module foundation.judgmentally-involutive-identity-types where @@ -30,9 +30,9 @@ open import foundation-core.torsorial-type-families ## Idea -The [standard definition of identity types](foundation-core.identity-types.md) -suffer the limitation that many of the basic operations only satisfy algebraic -laws _weakly_. In this file, we consider the +The standard definition of [identity types](foundation-core.identity-types.md) +has the limitation that many of the basic operations only satisfy algebraic laws +_weakly_. In this file, we consider the {{#concept "judgmentally involutive identity types" Agda=involutive-Id}} ```text @@ -42,14 +42,14 @@ laws _weakly_. In this file, we consider the This type family is [equivalent](foundation-core.equivalences.md) to the standard identity types, but satisfies the judgmental laws -- `inv (inv p) = p` -- `inv refl = refl` +- `inv (inv p) ≐ p` +- `inv refl ≐ refl` In addition, we maintain the following judgmental laws -- `inv refl = refl` -- `ind-Id f refl = f refl` -- `refl ∙ p = p` or `p ∙ refl = p` +- `inv refl ≐ refl` +- `ind-Id f refl ≐ f refl` +- `refl ∙ p ≐ p` or `p ∙ refl ≐ p` among other more technical ones considered in this file. @@ -193,8 +193,8 @@ groupoidal structure on types. We have an inversion operation on `involutive-Id` that satisfies the judgmental laws -- `inv (inv p) = p`, and -- `inv refl = refl`. +- `inv (inv p) ≐ p`, and +- `inv refl ≐ refl`. ```agda module _ diff --git a/src/foundation/universal-property-identity-types.lagda.md b/src/foundation/universal-property-identity-types.lagda.md index 04df943de4..5ce418ba7e 100644 --- a/src/foundation/universal-property-identity-types.lagda.md +++ b/src/foundation/universal-property-identity-types.lagda.md @@ -79,10 +79,10 @@ equiv-ev-refl' a {B} = ( equiv-ev-refl a) ∘e ( equiv-Π-equiv-family (λ x → equiv-precomp-Π (equiv-inv a x) (B x))) -is-equv-ev-refl' : +is-equiv-ev-refl' : {l1 l2 : Level} {A : UU l1} (a : A) {B : (x : A) → x = a → UU l2} → is-equiv (ev-refl' a {B}) -is-equv-ev-refl' a = is-equiv-map-equiv (equiv-ev-refl' a) +is-equiv-ev-refl' a = is-equiv-map-equiv (equiv-ev-refl' a) ``` ### `Id : A → (A → 𝒰)` is an embedding From 14f99fa5d6ab46b43b7f0ec00246c5747abccccf Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Fri, 2 Feb 2024 22:47:15 +0100 Subject: [PATCH 21/39] judgmental non-dependent eliminator --- .../computational-identity-types.lagda.md | 112 ++++++++++++++++-- ...ally-compositional-identity-types.lagda.md | 76 ++++++++++++ 2 files changed, 178 insertions(+), 10 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index b1f739555a..98095ef973 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -13,6 +13,7 @@ open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.judgmentally-compositional-identity-types open import foundation.judgmentally-right-unital-concatenation-identifications +open import foundation.transport-along-identifications open import foundation.universal-property-identity-systems open import foundation.universe-levels @@ -20,11 +21,15 @@ open import foundation-core.cartesian-product-types open import foundation-core.contractible-types open import foundation-core.equality-dependent-pair-types open import foundation-core.equivalences +open import foundation-core.function-extensionality +open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.homotopies open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families +open import foundation-core.univalence ``` @@ -52,9 +57,10 @@ The computational identity types are but satisfy the following algebraic laws judgmentally: - `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` -- `refl ∙ p ≐ p` or `p ∙ refl ≐ p`. -- `inv refl ≐ refl` +- `refl ∙ p ≐ p` or `p ∙ refl ≐ p` - `inv (inv p) ≐ p` +- `inv refl ≐ refl` +- `rec f refl ≐ f refl`. **Note.** The computational identity types do _not_ satisfy the judgmental laws @@ -154,6 +160,22 @@ module _ preserves-refl-eq-computational-eq = refl ``` +### The computational identity types are equivalent to the yoneda identity types + +```agda +module _ + {l : Level} {A : UU l} + where + + yoneda-eq-computational-eq : {x y : A} → x =ʲ y → x =ʸ y + yoneda-eq-computational-eq (z , p , q) = inv-yoneda-Id q ∙ʸ p + + preserves-refl-yoneda-eq-computational-eq : + {x : A} → + yoneda-eq-computational-eq (refl-computational-Id {x = x}) = refl-yoneda-Id + preserves-refl-yoneda-eq-computational-eq = refl +``` + ### The induction principle for computational identity types The judgmentally computational identity types satisfy the induction principle of @@ -209,6 +231,29 @@ module _ uniqueness-ind-computational-Id = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-computational-Id B) + +module _ + {l1 l2 : Level} {A : UU l1} {x : A} + {B : A → UU l2} + where + + rec-computational-Id : + (b : B x) {y : A} → x =ʲ y → B y + rec-computational-Id b {y} (z , p , q) = tr B (inv (q z refl) ∙ p z refl) b + + compute-rec-computational-Id : + (b : B x) → rec-computational-Id b refl-computational-Id = b + compute-rec-computational-Id b = refl + + uniqueness-rec-computational-Id : + (b : (y : A) → x =ʲ y → B y) → + (λ y → rec-computational-Id (b x refl-computational-Id) {y}) = b + uniqueness-rec-computational-Id b = + ( inv + ( uniqueness-ind-computational-Id + ( λ y _ → B y) + ( λ y → rec-computational-Id (b x refl-computational-Id)))) ∙ + ( uniqueness-ind-computational-Id (λ y _ → B y) b) ``` ## Structure @@ -217,14 +262,14 @@ The computational identity types form a groupoidal structure on types. This structure satisfies the following algebraic laws strictly - `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` -- `refl ∙ p ≐ p` or `p ∙ refl ≐ p`. +- `refl ∙ p ≐ p` or `p ∙ refl ≐ p` - `inv (inv p) ≐ p` -- `inv refl ≐ refl` +- `inv refl ≐ refl`. Note, however, that they do not satisfy the strict algebraic laws -- `refl ∙ p ≐ p` and `p ∙ refl ≐ p` simultaneously -- `inv p ∙ p ≐ refl` +- `refl ∙ p ≐ p` and `p ∙ refl ≐ p` simultaneously, +- `inv p ∙ p ≐ refl`, or - `p ∙ inv p ≐ refl`. ### Inverting computational identifications @@ -348,8 +393,7 @@ module _ infixl 15 _∙ᵣʲ_ _∙ᵣʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z - (w , p , q) ∙ᵣʲ (w' , p' , q') = - (w , p ∙ʸ invr-yoneda-Id q' ∙ʸ p' , q) + (w , p , q) ∙ᵣʲ (w' , p' , q') = (w , p ∙ʸ invr-yoneda-Id q' ∙ʸ p' , q) concatr-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z concatr-computational-Id p z q = p ∙ᵣʲ q @@ -439,13 +483,12 @@ module _ (p : x =ʲ y) {z : A} (q : y =ʲ z) → inv-computational-Id (p ∙ₗʲ q) = inv-computational-Id q ∙ₗʲ inv-computational-Id p - distributive-inv-concatl-computational-Id p q = + distributive-inv-concatl-computational-Id p = ind-computational-Id ( λ _ q → inv-computational-Id (p ∙ₗʲ q) = inv-computational-Id q ∙ₗʲ inv-computational-Id p) ( ap inv-computational-Id (right-unit-concatl-computational-Id)) - ( q) ``` #### The groupoidal laws for the judgmentally right unital concatenation operation @@ -512,6 +555,55 @@ module _ ( inv left-unit-concatr-computational-Id) ``` +### Action of functions on computational identifications + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} {x y : A} (f : A → B) + where + + ap-computational-Id : x =ʲ y → f x =ʲ f y + ap-computational-Id (z , p , q) = + (f z , ap-yoneda-Id f p , ap-yoneda-Id f q) +``` + +### Transport along computational identifications + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (B : A → UU l2) + where + + tr-computational-Id : {x y : A} → x =ʲ y → B x → B y + tr-computational-Id p = tr-yoneda-Id B (yoneda-eq-computational-eq p) + + compute-tr-computational-Id-refl : + {x : A} → tr-computational-Id (refl-computational-Id {x = x}) = id + compute-tr-computational-Id-refl = refl +``` + +### `htpy-computational-eq` + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g : (x : A) → B x} + where + + htpy-computational-eq : f =ʲ g → f ~ g + htpy-computational-eq p = htpy-yoneda-eq (yoneda-eq-computational-eq p) +``` + +### `equiv-computational-eq` + +```agda +module _ + {l1 : Level} {A B : UU l1} + where + + equiv-computational-eq : A =ʲ B → A ≃ B + equiv-computational-eq p = equiv-yoneda-eq (yoneda-eq-computational-eq p) +``` + ## See also - [The judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index d756ac1f78..f15878917c 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -11,17 +11,21 @@ open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.multivariable-homotopies +open import foundation.transport-along-identifications open import foundation.universal-property-identity-systems open import foundation.universe-levels open import foundation-core.contractible-types open import foundation-core.equivalences +open import foundation-core.function-extensionality open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types +open import foundation-core.homotopies open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families +open import foundation-core.univalence ``` @@ -295,6 +299,34 @@ module _ ( dependent-universal-property-identity-system-yoneda-Id B) ``` +While the induction principle does not have the ideal reduction behaviour, the +non-dependent eliminator does: + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {x : A} + {B : A → UU l2} + where + + rec-yoneda-Id : + (b : B x) {y : A} → x =ʸ y → B y + rec-yoneda-Id b {y} p = tr B (p x refl) b + + compute-rec-yoneda-Id : + (b : B x) → rec-yoneda-Id b refl-yoneda-Id = b + compute-rec-yoneda-Id b = refl + + uniqueness-rec-yoneda-Id : + (b : (y : A) → x =ʸ y → B y) → + (λ y → rec-yoneda-Id (b x refl-yoneda-Id) {y}) = b + uniqueness-rec-yoneda-Id b = + ( inv + ( uniqueness-ind-yoneda-Id + ( λ y _ → B y) + ( λ y → rec-yoneda-Id (b x refl-yoneda-Id)))) ∙ + ( uniqueness-ind-yoneda-Id (λ y _ → B y) b) +``` + ## Structure The judgmentally compositional identity types form a judgmentally compositional @@ -557,6 +589,50 @@ module _ ( inv (assoc p (inv (g y refl)) (inv (f x refl))))) ``` +### Action of functions on judgmentally compositional identifications + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : UU l2} {x y : A} (f : A → B) + where + + ap-yoneda-Id : x =ʸ y → f x =ʸ f y + ap-yoneda-Id p .(f x) refl = ap f (p x refl) +``` + +### Transport along judgmentally compositional identifications + +```agda +module _ + {l1 l2 : Level} {A : UU l1} (B : A → UU l2) {x y : A} + where + + tr-yoneda-Id : x =ʸ y → B x → B y + tr-yoneda-Id p = tr B (p x refl) +``` + +### `htpy-compositional-eq` + +```agda +module _ + {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g : (x : A) → B x} + where + + htpy-yoneda-eq : f =ʸ g → f ~ g + htpy-yoneda-eq p = htpy-eq (p f refl) +``` + +### `equiv-compositional-eq` + +```agda +module _ + {l1 : Level} {A B : UU l1} + where + + equiv-yoneda-eq : A =ʸ B → A ≃ B + equiv-yoneda-eq p = equiv-eq (p A refl) +``` + ## See also - [The judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) From 5503c120e0ea27ddc902209172945771312e7aa2 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Tue, 6 Feb 2024 11:13:10 +0100 Subject: [PATCH 22/39] wip compute id --- ...ally-compositional-identity-types.lagda.md | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index f15878917c..e1380b466f 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -41,20 +41,24 @@ _weakly_. In this file, we consider the (x =ʸ y) := (z : A) → (z = x) → (z = y) ``` +Through the interpretation of types as ∞-categories, we can immediately see that +this is an instance of the Yoneda-embedding. + This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the laws +standard identity types, but satisfies the judgmental laws -- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` -- `refl ∙ p ≐ p` -- `p ∙ refl ≐ p` +- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)`, +- `refl ∙ p ≐ p`, and +- `p ∙ refl ≐ p`. -judgmentally. This is achieved by proxiyng to function composition and utilizing -its computational properties, and relies heavily on the +This is achieved by proxiyng to function composition and utilizing its +computational properties, and relies heavily on the [function extensionality axiom](foundation.function-extensionality.md). In addition, we can make the type satisfy the judgmental law -- `inv refl ≐ refl`. +- `inv refl ≐ refl`, and even +- `rec f refl ≐ f refl`. ## Definition @@ -71,7 +75,7 @@ module _ (a =ʸ b) = yoneda-Id a b refl-yoneda-Id : {x : A} → x =ʸ x - refl-yoneda-Id {x} z = id + refl-yoneda-Id z = id ``` ## Properties @@ -199,6 +203,10 @@ module _ {l : Level} {A : UU l} where + is-section-eq-yoneda-eq-refl : + {x : A} → yoneda-eq-eq (eq-yoneda-eq (refl-yoneda-Id {x = x})) = refl-yoneda-Id + is-section-eq-yoneda-eq-refl = refl + preserves-refl-yoneda-eq-eq : {x : A} → yoneda-eq-eq (refl {x = x}) = refl-yoneda-Id preserves-refl-yoneda-eq-eq = refl @@ -297,6 +305,22 @@ module _ uniqueness-ind-yoneda-Id = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) + +module _ + {l1 l2 : Level} {A : UU l1} {x : A} + (B : (y : A) (f : x =ʸ y) → UU l2) + where + + ind-yoneda-Id' : + (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y (yoneda-eq-eq (f x refl)) + ind-yoneda-Id' b {y} f = ind-Id x (λ y p → B y (yoneda-eq-eq p)) b y (f x refl) + + -- compute-ind-yoneda-Id : + -- (b : B x refl-yoneda-Id) → + -- ind-yoneda-Id b refl-yoneda-Id = b + -- compute-ind-yoneda-Id = + -- is-section-map-inv-is-equiv + -- ( dependent-universal-property-identity-system-yoneda-Id B) ``` While the induction principle does not have the ideal reduction behaviour, the From 50a779c9b34d8f274bb9e95dfe9ad9f505d67fd1 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 15:24:41 +0100 Subject: [PATCH 23/39] work yoneda identity types --- .../computational-identity-types.lagda.md | 6 +- ...ally-compositional-identity-types.lagda.md | 439 +++++++++++------- 2 files changed, 264 insertions(+), 181 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 98095ef973..d70661c631 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -366,7 +366,7 @@ module _ ( f' x) ( ( ap ( inv) - ( commutative-postconcatr-Id-yoneda-Id + ( commutative-preconcatr-Id-yoneda-Id ( g) ( g' w' refl) ( inv (f w refl)))) ∙ @@ -375,7 +375,7 @@ module _ ( _∙ᵣ inv (g' w' refl)) ( inv-distributive-inv-Id-yoneda-Id f g)) ∙ ( eq-concat-concatr (f x (inv (g w refl))) (inv (g' w' refl)))))) ∙ - ( commutative-postconcat-Id-yoneda-Id f' + ( commutative-preconcat-Id-yoneda-Id f' ( f x (inv (g w refl))) ( inv (g' w' refl)))) ∙ ( ap-binary @@ -419,7 +419,7 @@ module _ eq-computational-eq p ∙ᵣ eq-computational-eq q preserves-concatr-eq-computational-eq (w , f , g) (w' , f' , g') = ( ap (λ r → f' x (f x r ∙ᵣ inv (g' w' refl))) left-unit-concatr) ∙ - ( commutative-postconcatr-Id-yoneda-Id + ( commutative-preconcatr-Id-yoneda-Id ( f') ( f x (inv (g w refl))) ( inv (g' w' refl))) ∙ diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index e1380b466f..e9ede9d557 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -25,7 +25,7 @@ open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families -open import foundation-core.univalence +open import foundation.univalence ``` @@ -41,24 +41,29 @@ _weakly_. In this file, we consider the (x =ʸ y) := (z : A) → (z = x) → (z = y) ``` -Through the interpretation of types as ∞-categories, we can immediately see that -this is an instance of the Yoneda-embedding. +Through the interpretation of types as ∞-categories, where the hom-space +`hom(x , y)` is defined to be the identity type `x = y`, we may observe that +this is an instance of the Yoneda embedding. Thus we also dub these the +{{#concept "yoneda identity types" Agda=yoneda-Id}}, and use a superscript `y` +in their notation. -This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the judgmental laws +The yoneda identity types are [equivalent](foundation-core.equivalences.md) to +the standard identity types, but satisfy judgmental laws -- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)`, -- `refl ∙ p ≐ p`, and -- `p ∙ refl ≐ p`. +- `(p ∙ʸ q) ∙ʸ r ≐ p ∙ʸ (q ∙ʸ r)`, +- `reflʸ ∙ʸ p ≐ p`, and +- `p ∙ʸ reflʸ ≐ p`. This is achieved by proxiyng to function composition and utilizing its computational properties, and relies heavily on the -[function extensionality axiom](foundation.function-extensionality.md). +[function extensionality axiom](foundation.function-extensionality.md). More +concretely, the reflexivity is given by the identity function, and path +concatenation is given by function composition. -In addition, we can make the type satisfy the judgmental law - -- `inv refl ≐ refl`, and even -- `rec f refl ≐ f refl`. +In addition to these strictness laws, we can make the type satisfy judgmental +law `invʸ reflʸ ≐ reflʸ`. Moreover, while the induction principle of the yoneda +identity types does not in general satisfy the computation rule judgmentally, we +can define its recursion principle such that does. ## Definition @@ -73,57 +78,64 @@ module _ infix 6 _=ʸ_ _=ʸ_ : A → A → UU l (a =ʸ b) = yoneda-Id a b +``` +We define the reflexivity to be the identity function: + +```agda refl-yoneda-Id : {x : A} → x =ʸ x refl-yoneda-Id z = id ``` ## Properties -### Elements of the judgmentally compositional identity type act like postconcatenation operations +### Elements of the yoneda identity type act like postconcatenation operations + +The following is a collection of properties of yoneda identifications similar to +properties of the postconcatenation operation of identifications. ```agda module _ {l : Level} {A : UU l} where - commutative-postconcat-Id-yoneda-Id : + commutative-preconcat-Id-yoneda-Id : {x y z w : A} (f : x =ʸ y) (p : w = z) (q : z = x) → f w (p ∙ q) = p ∙ f z q - commutative-postconcat-Id-yoneda-Id f refl q = refl + commutative-preconcat-Id-yoneda-Id f refl q = refl - commutative-postconcat-refl-Id-yoneda-Id : + commutative-preconcat-refl-Id-yoneda-Id : {x y z : A} (f : x =ʸ y) (q : z = x) → f z q = q ∙ f x refl - commutative-postconcat-refl-Id-yoneda-Id {z = z} f q = - ap (f z) (inv right-unit) ∙ commutative-postconcat-Id-yoneda-Id f q refl + commutative-preconcat-refl-Id-yoneda-Id {z = z} f q = + ap (f z) (inv right-unit) ∙ commutative-preconcat-Id-yoneda-Id f q refl - commutative-postconcatr-Id-yoneda-Id : + commutative-preconcatr-Id-yoneda-Id : {x y z w : A} (f : x =ʸ y) (p : w = z) (q : z = x) → f w (p ∙ᵣ q) = p ∙ᵣ f z q - commutative-postconcatr-Id-yoneda-Id {x} {y} {z} {w} f p q = + commutative-preconcatr-Id-yoneda-Id {x} {y} {z} {w} f p q = ( ap (f w) (eq-concat-concatr p q)) ∙ - ( commutative-postconcat-Id-yoneda-Id f p q) ∙ + ( commutative-preconcat-Id-yoneda-Id f p q) ∙ ( eq-concatr-concat p (f z q)) - commutative-postconcatr-refl-Id-yoneda-Id : + commutative-preconcatr-refl-Id-yoneda-Id : {x y z : A} (f : x =ʸ y) (q : z = x) → f z q = q ∙ᵣ f x refl - commutative-postconcatr-refl-Id-yoneda-Id f q = - commutative-postconcatr-Id-yoneda-Id f q refl + commutative-preconcatr-refl-Id-yoneda-Id f q = + commutative-preconcatr-Id-yoneda-Id f q refl compute-inv-Id-yoneda-Id : {x y : A} (f : x =ʸ y) → f y (inv (f x refl)) = refl compute-inv-Id-yoneda-Id {x} f = - ( commutative-postconcat-refl-Id-yoneda-Id f (inv (f x refl))) ∙ + ( commutative-preconcat-refl-Id-yoneda-Id f (inv (f x refl))) ∙ ( left-inv (f x refl)) inv-distributive-inv-Id-yoneda-Id : {x y z : A} (f : x =ʸ y) (g : x =ʸ z) → inv (g y (inv (f x refl))) = f z (inv (g x refl)) - inv-distributive-inv-Id-yoneda-Id {x} {y} f g = - ( ap inv (commutative-postconcat-refl-Id-yoneda-Id g (inv (f x refl)))) ∙ + inv-distributive-inv-Id-yoneda-Id {x} f g = + ( ap inv (commutative-preconcat-refl-Id-yoneda-Id g (inv (f x refl)))) ∙ ( distributive-inv-concat (inv (f x refl)) (g x refl)) ∙ ( ap (inv (g x refl) ∙_) (inv-inv (f x refl))) ∙ - ( inv (commutative-postconcat-refl-Id-yoneda-Id f (inv (g x refl)))) + ( inv (commutative-preconcat-refl-Id-yoneda-Id f (inv (g x refl)))) distributive-inv-Id-yoneda-Id : {x y z : A} (f : x =ʸ y) (g : x =ʸ z) → @@ -132,27 +144,48 @@ module _ inv (inv-distributive-inv-Id-yoneda-Id f g) ``` -### The judgmentally compositional identity types are equivalent to the standard identity types +### The yoneda identity types are equivalent to the standard identity types -We define the equivalence `yoneda-eq-eq : x = y → x =ʸ y` using the -judgmentally right unital concatenation operation on identifications. This gives -us the judgmental computation rules +The equivalence `(x = y) ≃ (x =ʸ y)` is defined from left to right by the +postconcatenation operation ```text - yoneda-eq-eq refl ≐ refl-yoneda-Id + yoneda-eq-eq := p ↦ (q ↦ q ∙ p) : x = y → x =ʸ y, ``` -and +and from right to left by evaluation at the reflexivity ```text - eq-yoneda-eq refl-yoneda-Id ≐ refl. + eq-yoneda-eq := f ↦ f refl : x =ʸ y → x = y. ``` -The proof that it is a retraction requires the -[function extensionality axiom](foundation.function-extensionality.md). However, -function extensionality will become indispensable regardless when we proceed to -proving miscellaneous algebraic laws of the judgmentally compositional identity -type. +It should be noted that we define the map `x = y → x =ʸ y` using the +[judgmentally right unital concatenation operation](foundation.judgmentally-right-unital-concatenation-identifications.md). +While this obstructs us from showing that the homotopy +`eq-yoneda-eq ∘ yoneda-eq-eq ~ id` holds by reflexivity, as demonstrated by the +computation + +```text + eq-yoneda-eq ∘ yoneda-eq-eq + ≐ p ↦ (f ↦ f refl) (q ↦ q ∙ p) + ≐ p ↦ ((q ↦ q ∙ p) refl) + ≐ p ↦ refl ∙ p +``` + +it allows us to show that reflexivities are preserved strictly in both +directions, and not just from `x =ʸ y` to `x = y`. + +From left to right: + +```text + yoneda-eq-eq refl ≐ (p ↦ (q ↦ q ∙ p)) refl ≐ (q ↦ q ∙ refl) ≐ (q ↦ q) ≐ reflʸ +``` + +and from right to left: + +```text + eq-yoneda-eq reflʸ ≐ (f ↦ f refl) reflʸ ≐ (q ↦ q) refl ≐ refl. +``` ```agda module _ @@ -164,12 +197,21 @@ module _ eq-yoneda-eq : x =ʸ y → x = y eq-yoneda-eq f = f x refl +``` + +The construction of the homotopy `yoneda-eq-eq ∘ eq-yoneda-eq ~ id` requires the +[function extensionality axiom](foundation.function-extensionality.md). And +while we could show an analogous induction principle of the yoneda identity +types without the use of this axiom, function extensionality will become +indispensable regardless when we proceed to proving miscellaneous algebraic laws +of the yoneda identity type. +```agda is-section-eq-yoneda-eq : is-section yoneda-eq-eq eq-yoneda-eq is-section-eq-yoneda-eq f = eq-multivariable-htpy 2 - ( λ _ p → inv (commutative-postconcatr-refl-Id-yoneda-Id f p)) + ( λ _ p → inv (commutative-preconcatr-refl-Id-yoneda-Id f p)) is-retraction-eq-yoneda-eq : is-retraction yoneda-eq-eq eq-yoneda-eq @@ -196,7 +238,7 @@ module _ pr2 equiv-eq-yoneda-eq = is-equiv-eq-yoneda-eq ``` -The reflexivity elements are mapped to reflexivity elements judgmentally. +The reflexivity elements are preserved strictly. ```agda module _ @@ -216,8 +258,10 @@ module _ preserves-refl-eq-yoneda-eq = refl ``` -An alternative definition of `yoneda-eq-eq'` using the judgmentally left unital -concatenation operation on standard identity types. +Below, we consider the alternative definition of `yoneda-eq-eq` using the +judgmentally left unital concatenation operation on standard identity types. As +we can see, the retracting homotopy holds judgmentally, but now +`yoneda-eq-eq refl` does not compute definitionally to `reflʸ`. ```agda module _ @@ -231,7 +275,7 @@ module _ is-section yoneda-eq-eq' eq-yoneda-eq is-section-eq-yoneda-eq' f = eq-multivariable-htpy 2 - ( λ _ p → inv (commutative-postconcat-refl-Id-yoneda-Id f p)) + ( λ _ p → inv (commutative-preconcat-refl-Id-yoneda-Id f p)) is-retraction-eq-yoneda-eq' : is-retraction yoneda-eq-eq' eq-yoneda-eq @@ -247,16 +291,16 @@ module _ eq-multivariable-htpy 2 (λ _ p → right-unit) ``` -### The induction principle for judgmentally compositional identity types +### The induction principle for the yoneda identity types -The judgmentally compositional identity types satisfy the induction principle of -the identity types. This states that given a base point `x : A` and a family of -types over the identity types based at `x`, `B : (y : A) (f : x =ʸ y) → UU l2`, -then to construct a dependent function `f : (y : A) (f : x =ʸ y) → B y p` it -suffices to define it at `f x refl-yoneda-Id`. +The yoneda identity types satisfy the induction principle of the identity types. +This states that given a base point `x : A` and a family of types over the +identity types based at `x`, `B : (y : A) (f : x =ʸ y) → UU l2`, then to +construct a dependent function `g : (y : A) (f : x =ʸ y) → B y p` it suffices +to define it at `g x reflʸ`. -**Note.** A drawback of the judgmentally compositional identity types is that -they do not satisfy a judgmental computation rule for this induction principle. +**Note.** As stated before, a drawback of the yoneda identity types is that they +do not satisfy a judgmental computation rule for this induction principle. ```agda module _ @@ -284,47 +328,52 @@ module _ (B : (y : A) (f : x =ʸ y) → UU l2) where - ind-yoneda-Id : + ind-yoneda-Id' : (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y f - ind-yoneda-Id b {y} = + ind-yoneda-Id' b {y} = map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) ( b) ( y) - compute-ind-yoneda-Id : + compute-ind-yoneda-Id' : (b : B x refl-yoneda-Id) → - ind-yoneda-Id b refl-yoneda-Id = b - compute-ind-yoneda-Id = + ind-yoneda-Id' b refl-yoneda-Id = b + compute-ind-yoneda-Id' = is-section-map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) - uniqueness-ind-yoneda-Id : + uniqueness-ind-yoneda-Id' : (b : (y : A) (f : x =ʸ y) → B y f) → - (λ y → ind-yoneda-Id (b x refl-yoneda-Id) {y}) = b - uniqueness-ind-yoneda-Id = + (λ y → ind-yoneda-Id' (b x refl-yoneda-Id) {y}) = b + uniqueness-ind-yoneda-Id' = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) +``` +The following is a more concrete construction of the induction principle. We +observe that while `eq-yoneda-eq` and `yoneda-eq-eq` preserve reflexivities +strictly as required, the reduction is obstructed because the proof of +`is-section-eq-yoneda-eq` does not reduce to `refl` when `f ≐ reflʸ`. + +```agda module _ {l1 l2 : Level} {A : UU l1} {x : A} (B : (y : A) (f : x =ʸ y) → UU l2) where - ind-yoneda-Id' : - (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y (yoneda-eq-eq (f x refl)) - ind-yoneda-Id' b {y} f = ind-Id x (λ y p → B y (yoneda-eq-eq p)) b y (f x refl) - - -- compute-ind-yoneda-Id : - -- (b : B x refl-yoneda-Id) → - -- ind-yoneda-Id b refl-yoneda-Id = b - -- compute-ind-yoneda-Id = - -- is-section-map-inv-is-equiv - -- ( dependent-universal-property-identity-system-yoneda-Id B) + ind-yoneda-Id : + (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y f + ind-yoneda-Id b {y} f = + tr + ( B y) + ( is-section-eq-yoneda-eq f) + ( ind-Id x (λ y p → B y (yoneda-eq-eq p)) b y (eq-yoneda-eq f)) ``` -While the induction principle does not have the ideal reduction behaviour, the -non-dependent eliminator does: +While the induction principle does not have the wanted reduction behaviour, the +non-dependent eliminator does. This is simply because we no longer need to +transport along `is-section-eq-yoneda-eq`. ```agda module _ @@ -334,7 +383,7 @@ module _ rec-yoneda-Id : (b : B x) {y : A} → x =ʸ y → B y - rec-yoneda-Id b {y} p = tr B (p x refl) b + rec-yoneda-Id b f = tr B (eq-yoneda-eq f) b compute-rec-yoneda-Id : (b : B x) → rec-yoneda-Id b refl-yoneda-Id = b @@ -345,149 +394,125 @@ module _ (λ y → rec-yoneda-Id (b x refl-yoneda-Id) {y}) = b uniqueness-rec-yoneda-Id b = ( inv - ( uniqueness-ind-yoneda-Id + ( uniqueness-ind-yoneda-Id' ( λ y _ → B y) ( λ y → rec-yoneda-Id (b x refl-yoneda-Id)))) ∙ - ( uniqueness-ind-yoneda-Id (λ y _ → B y) b) + ( uniqueness-ind-yoneda-Id' (λ y _ → B y) b) ``` ## Structure -The judgmentally compositional identity types form a judgmentally compositional -weak groupoidal structure on types. +The yoneda identity types form a judgmentally compositional weak groupoidal +structure on types. -### Inverting judgmentally compositional identifications +### Inverting yoneda identifications We consider two ways of defining the inversion operation on judgmentally -compositional identifications: by the judgmentally left unital, and judgmentally -right unital concatenation operation on the underlying identity type -respectively. The latter enjoys the computational property +compositional identifications: by the judgmentally right unital, and +judgmentally left unital concatenation operation on the underlying identity type +respectively. The former enjoys the computational property ```text - inv refl ≐ refl, + inv reflʸ ≐ reflʸ, ``` -hence will be preferred elsewhere. +hence will be preferred going. -#### The inversion operation defined by the judgmentally left unital concatenation operation on identifications +#### The inversion operation defined by the judgmentally right unital concatenation operation on identifications ```agda module _ {l : Level} {A : UU l} where - invl-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x - invl-yoneda-Id {x} f z p = p ∙ inv (f x refl) + inv-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x + inv-yoneda-Id {x} f z p = p ∙ᵣ inv (f x refl) - compute-invl-yoneda-Id-refl : + compute-inv-yoneda-Id-refl : {x : A} → - invl-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id - compute-invl-yoneda-Id-refl = eq-multivariable-htpy 2 (λ _ p → right-unit) + inv-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + compute-inv-yoneda-Id-refl = refl - invl-invl-yoneda-Id : - {x y : A} (f : x =ʸ y) → invl-yoneda-Id (invl-yoneda-Id f) = f - invl-invl-yoneda-Id {x} f = + inv-inv-yoneda-Id : + {x y : A} (f : x =ʸ y) → + inv-yoneda-Id (inv-yoneda-Id f) = f + inv-inv-yoneda-Id {x} f = eq-multivariable-htpy 2 ( λ _ p → - ap (p ∙_) (inv-inv (f x refl)) ∙ - inv (commutative-postconcat-refl-Id-yoneda-Id f p)) + ( ap (p ∙ᵣ_) (ap inv left-unit-concatr ∙ inv-inv (f x refl))) ∙ + ( inv (commutative-preconcatr-refl-Id-yoneda-Id f p))) ``` -The inversion operation corresponds to the standard inversion operation on -identifications: - ```agda module _ {l : Level} {A : UU l} where - preserves-invl-yoneda-eq-eq : + preserves-inv-yoneda-eq-eq' : {x y : A} (p : x = y) → - yoneda-eq-eq (inv p) = invl-yoneda-Id (yoneda-eq-eq p) - preserves-invl-yoneda-eq-eq p = + yoneda-eq-eq (inv p) = inv-yoneda-Id (yoneda-eq-eq' p) + preserves-inv-yoneda-eq-eq' p = refl + + preserves-inv-yoneda-eq-eq : + {x y : A} (p : x = y) → + yoneda-eq-eq (inv p) = inv-yoneda-Id (yoneda-eq-eq p) + preserves-inv-yoneda-eq-eq p = eq-multivariable-htpy 2 - ( λ _ q → - ( eq-concat-concatr q (inv p)) ∙ - ( ap (λ r → q ∙ inv r) (inv left-unit-concatr))) + ( λ _ q → ap (λ r → q ∙ᵣ inv r) (inv left-unit-concatr)) - preserves-invl-eq-yoneda-eq : + preserves-inv-eq-yoneda-eq : {x y : A} (f : x =ʸ y) → - eq-yoneda-eq (invl-yoneda-Id f) = inv (eq-yoneda-eq f) - preserves-invl-eq-yoneda-eq f = refl + eq-yoneda-eq (inv-yoneda-Id f) = inv (eq-yoneda-eq f) + preserves-inv-eq-yoneda-eq f = left-unit-concatr ``` -#### The inversion operation defined by the judgmentally right unital concatenation operation on identifications +#### The inversion operation defined by the judgmentally left unital concatenation operation on identifications ```agda module _ {l : Level} {A : UU l} where - invr-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x - invr-yoneda-Id {x} f z p = p ∙ᵣ inv (f x refl) + invl-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x + invl-yoneda-Id {x} f z p = p ∙ inv (f x refl) - compute-invr-yoneda-Id-refl : - {x : A} → - invr-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id - compute-invr-yoneda-Id-refl = refl + compute-invl-yoneda-Id-refl : + {x : A} → invl-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + compute-invl-yoneda-Id-refl = eq-multivariable-htpy 2 (λ _ p → right-unit) - invr-invr-yoneda-Id : - {x y : A} (f : x =ʸ y) → - invr-yoneda-Id (invr-yoneda-Id f) = f - invr-invr-yoneda-Id {x} f = + invl-invl-yoneda-Id : + {x y : A} (f : x =ʸ y) → invl-yoneda-Id (invl-yoneda-Id f) = f + invl-invl-yoneda-Id {x} f = eq-multivariable-htpy 2 ( λ _ p → - ( ap (p ∙ᵣ_) (ap inv left-unit-concatr ∙ inv-inv (f x refl))) ∙ - ( inv (commutative-postconcatr-refl-Id-yoneda-Id f p))) + ( ap (p ∙_) (inv-inv (f x refl))) ∙ + ( inv (commutative-preconcat-refl-Id-yoneda-Id f p))) ``` +The inversion operation corresponds to the standard inversion operation on +identifications: + ```agda module _ {l : Level} {A : UU l} where - preserves-invr-yoneda-eq-eq' : - {x y : A} (p : x = y) → - yoneda-eq-eq (inv p) = invr-yoneda-Id (yoneda-eq-eq' p) - preserves-invr-yoneda-eq-eq' p = refl - - preserves-invr-yoneda-eq-eq : + preserves-invl-yoneda-eq-eq : {x y : A} (p : x = y) → - yoneda-eq-eq (inv p) = invr-yoneda-Id (yoneda-eq-eq p) - preserves-invr-yoneda-eq-eq refl = refl + yoneda-eq-eq (inv p) = invl-yoneda-Id (yoneda-eq-eq p) + preserves-invl-yoneda-eq-eq p = + eq-multivariable-htpy 2 + ( λ _ q → + ( eq-concat-concatr q (inv p)) ∙ + ( ap (λ r → q ∙ inv r) (inv left-unit-concatr))) - preserves-invr-eq-yoneda-eq : + preserves-invl-eq-yoneda-eq : {x y : A} (f : x =ʸ y) → - eq-yoneda-eq (invr-yoneda-Id f) = inv (eq-yoneda-eq f) - preserves-invr-eq-yoneda-eq {x} {y} f = left-unit-concatr -``` - -We will prefer the inversion operation defined by the judgmentally right unital -concatenation operation on identifications by convention, as it satisfies the -judgmental computation law - -```text - inv refl ≐ refl. -``` - -```agda -module _ - {l : Level} {A : UU l} - where - - inv-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x - inv-yoneda-Id = invr-yoneda-Id - - compute-inv-yoneda-Id-refl : - {x : A} → inv-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id - compute-inv-yoneda-Id-refl = compute-invr-yoneda-Id-refl - - inv-inv-yoneda-Id : - {x y : A} (f : x =ʸ y) → inv-yoneda-Id (inv-yoneda-Id f) = f - inv-inv-yoneda-Id = invr-invr-yoneda-Id + eq-yoneda-eq (invl-yoneda-Id f) = inv (eq-yoneda-eq f) + preserves-invl-eq-yoneda-eq f = refl ``` -### Concatenation of judgmentally compositional identifications +### Concatenation of yoneda identifications ```agda module _ @@ -522,10 +547,10 @@ module _ {x y z : A} (f : x =ʸ y) (g : y =ʸ z) → eq-yoneda-eq (f ∙ʸ g) = eq-yoneda-eq f ∙ eq-yoneda-eq g preserves-concat-eq-yoneda-eq {x} f g = - commutative-postconcat-refl-Id-yoneda-Id g (f x refl) + commutative-preconcat-refl-Id-yoneda-Id g (f x refl) ``` -### The groupoidal laws for the judgmentally compositional identity types +### The groupoidal laws for the yoneda identity types ```agda module _ @@ -550,7 +575,7 @@ module _ left-inv-yoneda-Id f = eq-multivariable-htpy 2 ( λ _ p → - ( commutative-postconcatr-Id-yoneda-Id f p (inv (f x refl))) ∙ + ( commutative-preconcatr-Id-yoneda-Id f p (inv (f x refl))) ∙ ( ap (p ∙ᵣ_) (compute-inv-Id-yoneda-Id f))) left-invl-yoneda-Id : @@ -558,7 +583,7 @@ module _ left-invl-yoneda-Id f = eq-multivariable-htpy 2 ( λ _ p → - ( commutative-postconcat-Id-yoneda-Id f p (inv (f x refl))) ∙ + ( commutative-preconcat-Id-yoneda-Id f p (inv (f x refl))) ∙ ( ap (p ∙_) (compute-inv-Id-yoneda-Id f) ∙ right-unit)) right-inv-yoneda-Id : @@ -568,7 +593,7 @@ module _ ( λ _ p → ( ap ( _∙ᵣ inv (f x refl)) - ( commutative-postconcatr-refl-Id-yoneda-Id f p)) ∙ + ( commutative-preconcatr-refl-Id-yoneda-Id f p)) ∙ ( assoc-concatr p (f x refl) (inv (f x refl))) ∙ ( ap (p ∙ᵣ_) (right-inv-concatr (f x refl)))) @@ -579,7 +604,7 @@ module _ ( λ _ p → ( ap ( _∙ inv (f x refl)) - ( commutative-postconcat-refl-Id-yoneda-Id f p)) ∙ + ( commutative-preconcat-refl-Id-yoneda-Id f p)) ∙ ( assoc p (f x refl) (inv (f x refl))) ∙ ( ap (p ∙_) (right-inv (f x refl))) ∙ ( right-unit)) @@ -594,7 +619,7 @@ module _ ( p ∙ᵣ_) ( ( ap ( inv) - ( commutative-postconcatr-refl-Id-yoneda-Id g (f x refl))) ∙ + ( commutative-preconcatr-refl-Id-yoneda-Id g (f x refl))) ∙ ( distributive-inv-concatr (f x refl) (g y refl)))) ∙ ( inv (assoc-concatr p (inv (g y refl)) (inv (f x refl))))) @@ -608,34 +633,62 @@ module _ ( p ∙_) ( ( ap ( inv) - ( commutative-postconcat-refl-Id-yoneda-Id g (f x refl))) ∙ + ( commutative-preconcat-refl-Id-yoneda-Id g (f x refl))) ∙ ( distributive-inv-concat (f x refl) (g y refl)))) ∙ ( inv (assoc p (inv (g y refl)) (inv (f x refl))))) ``` -### Action of functions on judgmentally compositional identifications +## Operations + +We can define basic operations on compositional identifications. They all enjoy +strict computational properties. + +### Action of functions on yoneda identifications ```agda module _ - {l1 l2 : Level} {A : UU l1} {B : UU l2} {x y : A} (f : A → B) + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) + where + + eq-ap-yoneda-Id : {x y : A} → x =ʸ y → f x = f y + eq-ap-yoneda-Id = ap f ∘ eq-yoneda-eq + + ap-yoneda-Id : {x y : A} → x =ʸ y → f x =ʸ f y + ap-yoneda-Id = yoneda-eq-eq ∘ eq-ap-yoneda-Id + + compute-ap-refl-yoneda-Id : + {x : A} → ap-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + compute-ap-refl-yoneda-Id = refl + +module _ + {l1 : Level} {A : UU l1} where - ap-yoneda-Id : x =ʸ y → f x =ʸ f y - ap-yoneda-Id p .(f x) refl = ap f (p x refl) + compute-ap-id-yoneda-Id : + {x y : A} (p : x =ʸ y) → ap-yoneda-Id id p = p + compute-ap-id-yoneda-Id {x} p = + eq-multivariable-htpy 2 + ( λ _ q → + ( ap (q ∙ᵣ_) (ap-id (p x refl))) ∙ + ( inv (commutative-preconcatr-refl-Id-yoneda-Id p q))) ``` -### Transport along judgmentally compositional identifications +### Transport along yoneda identifications ```agda module _ - {l1 l2 : Level} {A : UU l1} (B : A → UU l2) {x y : A} + {l1 l2 : Level} {A : UU l1} (B : A → UU l2) where - tr-yoneda-Id : x =ʸ y → B x → B y - tr-yoneda-Id p = tr B (p x refl) + tr-yoneda-Id : {x y : A} → x =ʸ y → B x → B y + tr-yoneda-Id = tr B ∘ eq-yoneda-eq + + compute-tr-refl-yoneda-Id : + {x : A} → tr-yoneda-Id (refl-yoneda-Id {x = x}) = id + compute-tr-refl-yoneda-Id = refl ``` -### `htpy-compositional-eq` +### Function extensionality with respect to compositional identifications ```agda module _ @@ -643,18 +696,48 @@ module _ where htpy-yoneda-eq : f =ʸ g → f ~ g - htpy-yoneda-eq p = htpy-eq (p f refl) + htpy-yoneda-eq = htpy-eq ∘ eq-yoneda-eq + + yoneda-eq-htpy : f ~ g → f =ʸ g + yoneda-eq-htpy = yoneda-eq-eq ∘ eq-htpy + + equiv-htpy-yoneda-eq : (f =ʸ g) ≃ (f ~ g) + equiv-htpy-yoneda-eq = equiv-funext ∘e equiv-eq-yoneda-eq + + equiv-yoneda-eq-htpy : (f ~ g) ≃ (f =ʸ g) + equiv-yoneda-eq-htpy = equiv-yoneda-eq-eq ∘e equiv-eq-htpy + + funext-yoneda-Id : is-equiv htpy-yoneda-eq + funext-yoneda-Id = is-equiv-map-equiv equiv-htpy-yoneda-eq ``` -### `equiv-compositional-eq` +### Univalence with respect to compositional identifications ```agda module _ {l1 : Level} {A B : UU l1} where + map-yoneda-eq : A =ʸ B → A → B + map-yoneda-eq = map-eq ∘ eq-yoneda-eq + equiv-yoneda-eq : A =ʸ B → A ≃ B - equiv-yoneda-eq p = equiv-eq (p A refl) + equiv-yoneda-eq = equiv-eq ∘ eq-yoneda-eq + + yoneda-eq-equiv : A ≃ B → A =ʸ B + yoneda-eq-equiv = yoneda-eq-eq ∘ eq-equiv + + equiv-equiv-yoneda-eq : (A =ʸ B) ≃ (A ≃ B) + equiv-equiv-yoneda-eq = equiv-univalence ∘e equiv-eq-yoneda-eq + + is-equiv-equiv-yoneda-eq : is-equiv equiv-yoneda-eq + is-equiv-equiv-yoneda-eq = is-equiv-map-equiv equiv-equiv-yoneda-eq + + equiv-yoneda-eq-equiv : (A ≃ B) ≃ (A =ʸ B) + equiv-yoneda-eq-equiv = equiv-yoneda-eq-eq ∘e equiv-eq-equiv A B + + is-equiv-yoneda-eq-equiv : is-equiv yoneda-eq-equiv + is-equiv-yoneda-eq-equiv = is-equiv-map-equiv equiv-yoneda-eq-equiv ``` ## See also From ab3ab47ef3e9113dd64ceebf214040a01ac13285 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 15:53:21 +0100 Subject: [PATCH 24/39] explanations for judgmentally involutive identity types --- src/foundation/contractible-types.lagda.md | 4 +- ...entally-involutive-identity-types.lagda.md | 123 +++++++++++++----- 2 files changed, 95 insertions(+), 32 deletions(-) diff --git a/src/foundation/contractible-types.lagda.md b/src/foundation/contractible-types.lagda.md index f23a6df409..689f82ac31 100644 --- a/src/foundation/contractible-types.lagda.md +++ b/src/foundation/contractible-types.lagda.md @@ -59,7 +59,7 @@ equiv-Contr : equiv-Contr X Y = type-Contr X ≃ type-Contr Y equiv-eq-Contr : - {l1 : Level} (X Y : Contr l1) → (X = Y) → equiv-Contr X Y + {l1 : Level} (X Y : Contr l1) → X = Y → equiv-Contr X Y equiv-eq-Contr X Y = equiv-eq-subuniverse is-contr-Prop X Y abstract @@ -69,7 +69,7 @@ abstract is-equiv-equiv-eq-subuniverse is-contr-Prop X Y eq-equiv-Contr : - {l1 : Level} {X Y : Contr l1} → equiv-Contr X Y → (X = Y) + {l1 : Level} {X Y : Contr l1} → equiv-Contr X Y → X = Y eq-equiv-Contr = eq-equiv-subuniverse is-contr-Prop abstract diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index 27025694c2..79f6b17767 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -43,15 +43,18 @@ This type family is [equivalent](foundation-core.equivalences.md) to the standard identity types, but satisfies the judgmental laws - `inv (inv p) ≐ p` -- `inv refl ≐ refl` +- `inv reflⁱ ≐ reflⁱ` + +where we use a superscript `i` to distinguish the judgmentally involutive +identity type from the standard identity type. In addition, we maintain the following judgmental laws -- `inv refl ≐ refl` -- `ind-Id f refl ≐ f refl` -- `refl ∙ p ≐ p` or `p ∙ refl ≐ p` +- `inv reflⁱ ≐ reflⁱ` +- `ind-Id f reflⁱ ≐ f reflⁱ` +- `reflⁱ ∙ p ≐ p` or `p ∙ reflⁱ ≐ p` -among other more technical ones considered in this file. +among other more specific ones considered in this file. ## Definition @@ -75,9 +78,42 @@ module _ ### The judgmentally involutive identity types are equivalent to the standard identity types -In fact, the [retraction](foundation-core.retractions.md) is judgmental, the -equivalence preserves the groupoid structure, and moreover preserves the -reflexivities judgmentally. +The equivalence `(x = y) ≃ (x =ⁱ y)` is defined from left to right by +inclusion at the second component + +```text + involutive-eq-eq := p ↦ (x , p , refl) : x = y → x =ⁱ y, +``` + +and from right to left by the concatenation + +```text + eq-involutive-eq := (z , p , q) ↦ inv q ∙ p : x =ⁱ y → x = y. +``` + +This equivalence preserves the groupoid structure on the judgmentally involutive +identity types as we will see later. Moreover, the composition +`eq-involutive-eq ∘ involutive-eq-eq` computes judgmentally to the identity: + +```text + eq-involutive-eq ∘ involutive-eq-eq + ≐ p ↦ (((z , p , q) ↦ inv q ∙ p) (r ↦ (w , r , refl))) + ≐ p ↦ inv refl ∙ p + ≐ p ↦ refl ∙ p + ≐ p ↦ p +``` + +and the reflexivities are preserved strictly: + +```text + eq-involutive-eq reflⁱ ≐ inv refl ∙ refl ≐ refl ∙ refl ≐ refl +``` + +and + +```text + involutive-eq-eq refl ≐ (x , refl , refl) ≐ reflⁱ. +``` ```agda module _ @@ -136,11 +172,8 @@ The judgmentally involutive identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it -suffices to define it at `f x refl-involutive-Id`. - -**Note.** The only reason we must apply -[function extensionality](foundation.function-extensionality.md) is to show -uniqueness of the induction principle up to _equality_. +suffices to define it at `f x reflⁱ`. The judgmentally involutive identity types +also satisfy the corresponding computation rule judgmentally. ```agda module _ @@ -183,6 +216,10 @@ module _ eq-multivariable-htpy 2 (λ where .x (.x , refl , refl) → refl) ``` +**Note.** The only reason we must apply +[function extensionality](foundation.function-extensionality.md) is to show +uniqueness of the induction principle up to _equality_. + ## Structure The judgmentally involutive identity types form a judgmentally involutive weak @@ -190,11 +227,11 @@ groupoidal structure on types. ### Inverting judgmentally involutive identifications -We have an inversion operation on `involutive-Id` that satisfies the judgmental -laws +We have an inversion operation on `involutive-Id` defined by swapping the +position of the identifications. This operation satisfies the judgmental laws - `inv (inv p) ≐ p`, and -- `inv refl ≐ refl`. +- `inv reflⁱ ≐ reflⁱ`. ```agda module _ @@ -215,7 +252,7 @@ module _ ``` The inversion operation corresponds to the standard inversion operation on -identifications: +identifications. ```agda module _ @@ -236,13 +273,41 @@ module _ ### Concatenation of judgmentally involutive identifications -We define the concatenation operation on the judgmentally involutive -identifications using the -[judgmentally right unital concatenation operation on identifications](foundation.judgmentally-right-unital-concatenation-identifications.md), -to obtain a one-sided judgmental unit law. There is both a judgmentally left -unital definition and a judgmentally right unital definition. To be consistent -with the convention for the standard identity types, we take the judgmentally -left unital concatenation operation to be the default. +We have practically speaking two definitions of the concatenation operation on +judgmentally involutive identity types. One satisfies a judgmental left unit law +and the other satisfies a judgmental right unit law. In both cases, we must use +the +[judgmentally right unital concatenation operation on standard identifications](foundation.judgmentally-right-unital-concatenation-identifications.md) +`_∙ᵣ_`, to obtain this one-sided judgmental unit law. + +The judgmentally left unital concatenation operation is defined by + +```text + (w , p , q) ∙ⁱ (w' , p' , q') := (w' , p' , (q' ∙ᵣ inv p) ∙ᵣ q), +``` + +and the right unital concatenation operation is defined by + +```text + (w , p , q) ∙ᵣⁱ (w' , p' , q') = (w , (p ∙ᵣ inv q') ∙ᵣ p' , q). +``` + +The following computation verifies that the judgmentally left unital +concatenation operation is indeed judgmentally left unital: + +```text + reflⁱ ∙ⁱ r + ≐ (x , refl , refl) ∙ⁱ (w , p , q) + ≐ (w , p , (q ∙ᵣ inv refl) ∙ᵣ refl) + ≐ (w , p , (q ∙ᵣ inv refl)) + ≐ (w , p , (q ∙ᵣ refl)) + ≐ (w , p , q) + ≐ r. +``` + +To be consistent with the convention for the standard identity types, we take +the judgmentally left unital concatenation operation to be the default +concatenation operation on judgmentally involutive identity types. #### The judgmentally left unital concatenation operation @@ -322,8 +387,8 @@ module _ ### The groupoidal laws for the judgmentally involutive identity types -The general proof-strategy is to induct on the necessary paths to make the left -endpoints judgmentally equal, and then proceed by reasoning with the +The general proof-strategy is to induct on the necessary identifications to make +the left endpoints judgmentally equal, and then proceed by reasoning with the groupoid-laws of the underlying identity types. #### The groupoidal laws for the judgmentally left unital concatenation operation @@ -423,12 +488,10 @@ module _ ## See also - [The judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) - for an identity relation that is strictly associative and unital, but does not - have a judgmentally computational induction principle. + for an identity relation that is strictly associative and two-sided unital. - [The computational identity types](foundation.computational-identity-types.md) for an identity relation that is judgmentally involutive, associative, and - one-sided unital, but does not have a judgmentally computational induction - principle. + one-sided unital. ## References From a93cc829fbd65fd441aa9c6c2ae2489b822ddcd4 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 16:00:28 +0100 Subject: [PATCH 25/39] Headers are nice --- .../computational-identity-types.lagda.md | 30 +++++++++++------ ...ally-compositional-identity-types.lagda.md | 32 +++++++++++++------ ...entally-involutive-identity-types.lagda.md | 28 +++++++++++----- 3 files changed, 63 insertions(+), 27 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index d70661c631..fb4198ef04 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -176,13 +176,7 @@ module _ preserves-refl-yoneda-eq-computational-eq = refl ``` -### The induction principle for computational identity types - -The judgmentally computational identity types satisfy the induction principle of -the identity types. This states that given a base point `x : A` and a family of -types over the identity types based at `x`, `B : (y : A) (p : x =ʲ y) → UU l2`, -then to construct a dependent function `f : (y : A) (p : x =ʲ y) → B y p` it -suffices to define it at `f x refl-computational-Id`. +### Torsoriality of the computational identity types ```agda module _ @@ -195,6 +189,14 @@ module _ ( Σ A (x =_)) ( equiv-tot (λ y → equiv-eq-computational-eq {x = x} {y})) ( is-torsorial-Id x) +``` + +### The dependent universal property of the computational identity types + +```agda +module _ + {l : Level} {A : UU l} {x : A} + where dependent-universal-property-identity-system-computational-Id : dependent-universal-property-identity-system @@ -204,7 +206,17 @@ module _ dependent-universal-property-identity-system-is-torsorial ( refl-computational-Id) ( is-torsorial-computational-Id) +``` + +### The induction principle for computational identity types + +The judgmentally computational identity types satisfy the induction principle of +the identity types. This states that given a base point `x : A` and a family of +types over the identity types based at `x`, `B : (y : A) (p : x =ʲ y) → UU l2`, +then to construct a dependent function `f : (y : A) (p : x =ʲ y) → B y p` it +suffices to define it at `f x refl-computational-Id`. +```agda module _ {l1 l2 : Level} {A : UU l1} {x : A} (B : (y : A) (p : x =ʲ y) → UU l2) @@ -336,7 +348,7 @@ module _ infixl 15 _∙ₗʲ_ _∙ₗʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z - (z , p , q) ∙ₗʲ (z' , p' , q') = (z' , p' , q' ∙ʸ invr-yoneda-Id p ∙ʸ q) + (z , p , q) ∙ₗʲ (z' , p' , q') = (z' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) concatl-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z concatl-computational-Id p z q = p ∙ₗʲ q @@ -393,7 +405,7 @@ module _ infixl 15 _∙ᵣʲ_ _∙ᵣʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z - (w , p , q) ∙ᵣʲ (w' , p' , q') = (w , p ∙ʸ invr-yoneda-Id q' ∙ʸ p' , q) + (w , p , q) ∙ᵣʲ (w' , p' , q') = (w , p ∙ʸ inv-yoneda-Id q' ∙ʸ p' , q) concatr-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z concatr-computational-Id p z q = p ∙ᵣʲ q diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index e9ede9d557..3bac5ceb0f 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -291,16 +291,7 @@ module _ eq-multivariable-htpy 2 (λ _ p → right-unit) ``` -### The induction principle for the yoneda identity types - -The yoneda identity types satisfy the induction principle of the identity types. -This states that given a base point `x : A` and a family of types over the -identity types based at `x`, `B : (y : A) (f : x =ʸ y) → UU l2`, then to -construct a dependent function `g : (y : A) (f : x =ʸ y) → B y p` it suffices -to define it at `g x reflʸ`. - -**Note.** As stated before, a drawback of the yoneda identity types is that they -do not satisfy a judgmental computation rule for this induction principle. +### Torsoriality of the yoneda identity types ```agda module _ @@ -313,6 +304,14 @@ module _ ( Σ A (x =_)) ( equiv-tot (λ y → equiv-eq-yoneda-eq {x = x} {y})) ( is-torsorial-Id x) +``` + +### The dependent universal property of the yoneda identity types + +```agda +module _ + {l : Level} {A : UU l} {x : A} + where dependent-universal-property-identity-system-yoneda-Id : dependent-universal-property-identity-system @@ -322,7 +321,20 @@ module _ dependent-universal-property-identity-system-is-torsorial ( refl-yoneda-Id) ( is-torsorial-yoneda-Id) +``` + +### The induction principle for the yoneda identity types +The yoneda identity types satisfy the induction principle of the identity types. +This states that given a base point `x : A` and a family of types over the +identity types based at `x`, `B : (y : A) (f : x =ʸ y) → UU l2`, then to +construct a dependent function `g : (y : A) (f : x =ʸ y) → B y p` it suffices +to define it at `g x reflʸ`. + +**Note.** As stated before, a drawback of the yoneda identity types is that they +do not satisfy a judgmental computation rule for this induction principle. + +```agda module _ {l1 l2 : Level} {A : UU l1} {x : A} (B : (y : A) (f : x =ʸ y) → UU l2) diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index 79f6b17767..c292205240 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -166,14 +166,7 @@ module _ preserves-refl-eq-involutive-eq = refl ``` -### The induction principle for judgmentally involutive identity types - -The judgmentally involutive identity types satisfy the induction principle of -the identity types. This states that given a base point `x : A` and a family of -types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, -then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it -suffices to define it at `f x reflⁱ`. The judgmentally involutive identity types -also satisfy the corresponding computation rule judgmentally. +### Torsoriality of the judgmentally involutive identity types ```agda module _ @@ -186,6 +179,14 @@ module _ ( Σ A (x =_)) ( equiv-tot (λ y → equiv-eq-involutive-eq {x = x} {y})) ( is-torsorial-Id x) +``` + +### The dependent universal property of the judgmentally involutive identity types + +```agda +module _ + {l : Level} {A : UU l} {x : A} + where dependent-universal-property-identity-system-involutive-Id : dependent-universal-property-identity-system @@ -195,7 +196,18 @@ module _ dependent-universal-property-identity-system-is-torsorial ( refl-involutive-Id) ( is-torsorial-involutive-Id) +``` +### The induction principle for judgmentally involutive identity types + +The judgmentally involutive identity types satisfy the induction principle of +the identity types. This states that given a base point `x : A` and a family of +types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, +then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it +suffices to define it at `f x reflⁱ`. The judgmentally involutive identity types +also satisfy the corresponding computation rule judgmentally. + +```agda module _ {l1 l2 : Level} {A : UU l1} (x : A) (B : (y : A) (p : x =ⁱ y) → UU l2) From 019b5bdd2f9284a6ad5256ece806468587526c64 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 17:45:41 +0100 Subject: [PATCH 26/39] explanations computational identity types --- .../computational-identity-types.lagda.md | 272 +++++++++++++----- 1 file changed, 194 insertions(+), 78 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index fb4198ef04..a017270ce8 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -39,28 +39,47 @@ open import foundation-core.univalence The standard definition of [identity types](foundation-core.identity-types.md) has the limitation that many of the basic operations only satisfy algebraic laws _weakly_. In this file, we consider the -{{#concept "computational identity types" Agda=computational-Id}} +{{#concept "computational identity types" Agda=computational-Id}} `x =ʲ y`. +These are defined using the construction of the +[judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md): + +```text + (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) +``` + +but using the +[yoneda identity types](foundation.judgmentally-compositional-identity-types.md) +(`_=ʸ_`) as the underlying identity types: ```text (x =ʲ y) := Σ (z : A) ((z =ʸ y) × (z =ʸ x)) ``` -where `x =ʸ y` is the -[judgmentally compositional identity type](foundation.judgmentally-compositional-identity-types.md) +The yoneda identity types are defined as ```text (x =ʸ y) := (z : A) → (z = x) → (z = y). ``` -The computational identity types are -[equivalent](foundation-core.equivalences.md) to the standard identity types, -but satisfy the following algebraic laws judgmentally: +The yoneda identity types are equivalent to the standard identity types, but +have a strictly associative and unital concatenation operation. We can leverage +this and the judgmental properties of the construction of the judgmentally +involutive identity types to construct operations on the computational identity +types that satisfy the strict algebraic laws -- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` -- `refl ∙ p ≐ p` or `p ∙ refl ≐ p` +- `(p ∙ʲ q) ∙ʲ r ≐ p ∙ʲ (q ∙ʲ r)` +- `reflʲ ∙ʲ p ≐ p` or `p ∙ʲ reflʲ ≐ p` - `inv (inv p) ≐ p` -- `inv refl ≐ refl` -- `rec f refl ≐ f refl`. +- `inv reflʲ ≐ reflʲ`. + +While the last three equalities hold by the same computations as for the +judgmentally involutive identity types using the fact that `inv reflʸ ≐ reflʸ`, +strict associativity relies on the strict associativity of the underlying yoneda +identity types. See the file about judgmentally involutive identity types for +further details on these computations. + +In addition to these strict algebraic laws, we can also define a recursion +principle for the computational identity types so that it computes judgmentally. **Note.** The computational identity types do _not_ satisfy the judgmental laws @@ -69,7 +88,9 @@ but satisfy the following algebraic laws judgmentally: - `p ∙ inv p ≐ refl`, and they do not have a judgmental computation property for their induction -principle. +principle. This boils down to the fact that the yoneda identity types do not +have a judgmental computation property for their induction principle, as +explained further there. ## Definition @@ -91,10 +112,88 @@ module _ ## Properties +### The computational identity types are equivalent to the yoneda identity types + +Similarly to the judgmentally involutive identity types, this equivalence is a +strict retraction and preserves the reflexivities strictly. + +```agda +module _ + {l : Level} {A : UU l} + where + + computational-eq-yoneda-eq : {x y : A} → x =ʸ y → x =ʲ y + computational-eq-yoneda-eq {x} f = (x , f , refl-yoneda-Id) + + yoneda-eq-computational-eq : {x y : A} → x =ʲ y → x =ʸ y + yoneda-eq-computational-eq (z , p , q) = inv-yoneda-Id q ∙ʸ p + + is-retraction-yoneda-eq-computational-eq : + {x y : A} → + is-retraction + ( computational-eq-yoneda-eq) + ( yoneda-eq-computational-eq {x} {y}) + is-retraction-yoneda-eq-computational-eq f = refl + + is-section-yoneda-eq-computational-eq : + {x y : A} → + is-section + ( computational-eq-yoneda-eq) + ( yoneda-eq-computational-eq {x} {y}) + is-section-yoneda-eq-computational-eq (z , p , q) = + ind-yoneda-Id + ( λ _ q → + computational-eq-yoneda-eq (yoneda-eq-computational-eq (z , p , q)) = + (z , p , q)) + ( refl) + ( q) + + is-equiv-computational-eq-yoneda-eq : + {x y : A} → is-equiv (computational-eq-yoneda-eq {x} {y}) + is-equiv-computational-eq-yoneda-eq = + is-equiv-is-invertible + ( yoneda-eq-computational-eq) + ( is-section-yoneda-eq-computational-eq) + ( is-retraction-yoneda-eq-computational-eq) + + is-equiv-yoneda-eq-computational-eq : + {x y : A} → is-equiv (yoneda-eq-computational-eq {x} {y}) + is-equiv-yoneda-eq-computational-eq = + is-equiv-is-invertible + ( computational-eq-yoneda-eq) + ( is-retraction-yoneda-eq-computational-eq) + ( is-section-yoneda-eq-computational-eq) + + equiv-computational-eq-yoneda-eq : {x y : A} → (x =ʸ y) ≃ (x =ʲ y) + pr1 equiv-computational-eq-yoneda-eq = computational-eq-yoneda-eq + pr2 equiv-computational-eq-yoneda-eq = is-equiv-computational-eq-yoneda-eq + + equiv-yoneda-eq-computational-eq : {x y : A} → (x =ʲ y) ≃ (x =ʸ y) + pr1 equiv-yoneda-eq-computational-eq = yoneda-eq-computational-eq + pr2 equiv-yoneda-eq-computational-eq = is-equiv-yoneda-eq-computational-eq +``` + +```agda +module _ + {l : Level} {A : UU l} + where + + preserves-refl-yoneda-eq-computational-eq : + {x : A} → + yoneda-eq-computational-eq (refl-computational-Id {x = x}) = refl-yoneda-Id + preserves-refl-yoneda-eq-computational-eq = refl + + preserves-refl-computational-eq-yoneda-eq : + {x : A} → + computational-eq-yoneda-eq (refl-yoneda-Id {x = x}) = refl-computational-Id + preserves-refl-computational-eq-yoneda-eq = refl +``` + ### The computational identity types are equivalent to the standard identity types -This equivalence preserves the groupoid structure of the computational identity -types and moreover preserves the reflexivity elements judgmentally. +We define the equivalence as the composite `(x = y) ≃ (x =ʸ y) ≃ (x =ʲ y)`. +Since each of these equivalences preserves the groupoid structure so does the +composite. For the same reason, it preserves the reflexivities strictly. ```agda module _ @@ -102,10 +201,19 @@ module _ where computational-eq-eq : {x y : A} → x = y → x =ʲ y - computational-eq-eq {x} p = (x , yoneda-eq-eq p , refl-yoneda-Id) + computational-eq-eq = computational-eq-yoneda-eq ∘ yoneda-eq-eq eq-computational-eq : {x y : A} → x =ʲ y → x = y - eq-computational-eq (z , p , q) = eq-yoneda-eq (inv-yoneda-Id q ∙ʸ p) + eq-computational-eq = eq-yoneda-eq ∘ yoneda-eq-computational-eq + + + equiv-computational-eq-eq : {x y : A} → (x = y) ≃ (x =ʲ y) + equiv-computational-eq-eq = + equiv-computational-eq-yoneda-eq ∘e equiv-yoneda-eq-eq + + equiv-eq-computational-eq : {x y : A} → (x =ʲ y) ≃ (x = y) + equiv-eq-computational-eq = + equiv-eq-yoneda-eq ∘e equiv-yoneda-eq-computational-eq is-retraction-eq-computational-eq : {x y : A} → is-retraction computational-eq-eq (eq-computational-eq {x} {y}) @@ -123,25 +231,11 @@ module _ is-equiv-computational-eq-eq : {x y : A} → is-equiv (computational-eq-eq {x} {y}) - pr1 (pr1 is-equiv-computational-eq-eq) = eq-computational-eq - pr2 (pr1 is-equiv-computational-eq-eq) = is-section-eq-computational-eq - pr1 (pr2 is-equiv-computational-eq-eq) = eq-computational-eq - pr2 (pr2 is-equiv-computational-eq-eq) = is-retraction-eq-computational-eq + is-equiv-computational-eq-eq = is-equiv-map-equiv equiv-computational-eq-eq is-equiv-eq-computational-eq : {x y : A} → is-equiv (eq-computational-eq {x} {y}) - pr1 (pr1 is-equiv-eq-computational-eq) = computational-eq-eq - pr2 (pr1 is-equiv-eq-computational-eq) = is-retraction-eq-computational-eq - pr1 (pr2 is-equiv-eq-computational-eq) = computational-eq-eq - pr2 (pr2 is-equiv-eq-computational-eq) = is-section-eq-computational-eq - - equiv-computational-eq-eq : {x y : A} → (x = y) ≃ (x =ʲ y) - pr1 equiv-computational-eq-eq = computational-eq-eq - pr2 equiv-computational-eq-eq = is-equiv-computational-eq-eq - - equiv-eq-computational-eq : {x y : A} → (x =ʲ y) ≃ (x = y) - pr1 equiv-eq-computational-eq = eq-computational-eq - pr2 equiv-eq-computational-eq = is-equiv-eq-computational-eq + is-equiv-eq-computational-eq = is-equiv-map-equiv equiv-eq-computational-eq ``` The reflexivity elements are preserved judgmentally. @@ -160,22 +254,6 @@ module _ preserves-refl-eq-computational-eq = refl ``` -### The computational identity types are equivalent to the yoneda identity types - -```agda -module _ - {l : Level} {A : UU l} - where - - yoneda-eq-computational-eq : {x y : A} → x =ʲ y → x =ʸ y - yoneda-eq-computational-eq (z , p , q) = inv-yoneda-Id q ∙ʸ p - - preserves-refl-yoneda-eq-computational-eq : - {x : A} → - yoneda-eq-computational-eq (refl-computational-Id {x = x}) = refl-yoneda-Id - preserves-refl-yoneda-eq-computational-eq = refl -``` - ### Torsoriality of the computational identity types ```agda @@ -243,7 +321,14 @@ module _ uniqueness-ind-computational-Id = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-computational-Id B) +``` +Using the fact that the recusion principles of both the yoneda identity types +and the judgmentally involutive identity types can be defined to compute +judgmentally, we obtain a judgmentally computing recursion principle for the +computational identity types as well. + +```agda module _ {l1 l2 : Level} {A : UU l1} {x : A} {B : A → UU l2} @@ -251,7 +336,7 @@ module _ rec-computational-Id : (b : B x) {y : A} → x =ʲ y → B y - rec-computational-Id b {y} (z , p , q) = tr B (inv (q z refl) ∙ p z refl) b + rec-computational-Id b p = rec-yoneda-Id b (yoneda-eq-computational-eq p) compute-rec-computational-Id : (b : B x) → rec-computational-Id b refl-computational-Id = b @@ -273,19 +358,15 @@ module _ The computational identity types form a groupoidal structure on types. This structure satisfies the following algebraic laws strictly -- `(p ∙ q) ∙ r ≐ p ∙ (q ∙ r)` -- `refl ∙ p ≐ p` or `p ∙ refl ≐ p` +- `(p ∙ʲ q) ∙ʲ r ≐ p ∙ʲ (q ∙ʲ r)` +- `reflʲ ∙ʲ p ≐ p` or `p ∙ʲ reflʲ ≐ p` - `inv (inv p) ≐ p` -- `inv refl ≐ refl`. - -Note, however, that they do not satisfy the strict algebraic laws - -- `refl ∙ p ≐ p` and `p ∙ refl ≐ p` simultaneously, -- `inv p ∙ p ≐ refl`, or -- `p ∙ inv p ≐ refl`. +- `inv reflʲ ≐ reflʲ`. ### Inverting computational identifications +The construction is the same as for the judgmentally involutive identity types. + ```agda module _ {l : Level} {A : UU l} @@ -334,6 +415,14 @@ There is both a judgmentally left unital concatenation operation and a judgmentally right unital concatenation operation, while both are judgmentally associative. +The judgmental one-sided unitality follows in both cases from the judgmental +right unitality of the concatenation operation on the yoneda identifications +following the same computation as for the judgmentally involutive identity +types. + +For associativity on the other hand, we must use the judgmental associativity of +the yoneda identity types. We will write out the explicit computation later. + **Observation.** Since they are judgmentally associative, the only instances where they will not reduce is thus when the reflexivity appears all the way to the right, or all the way to the left in a string of concatenations @@ -341,6 +430,14 @@ respectively. #### The judgmentally left unital concatenation operation +The judgmentally left unital concatenation operation is constructed the same way +as the judgmentally left unital concatenation operation for the judgmentally +involutive identity types + +```text + (z , p , q) ∙ₗʲ (z' , p' , q') := (z' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) +``` + ```agda module _ {l : Level} {A : UU l} @@ -350,11 +447,11 @@ module _ _∙ₗʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z (z , p , q) ∙ₗʲ (z' , p' , q') = (z' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) - concatl-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z - concatl-computational-Id p z q = p ∙ₗʲ q + concat-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z + concat-computational-Id p z q = p ∙ₗʲ q - concatl-computational-Id' : (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z - concatl-computational-Id' x q p = p ∙ₗʲ q + concat-computational-Id' : (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z + concat-computational-Id' x q p = p ∙ₗʲ q ``` ```agda @@ -362,17 +459,17 @@ module _ {l : Level} {A : UU l} {x y z : A} where - preserves-concatl-computational-eq-eq : + preserves-concat-computational-eq-eq : (p : x = y) (q : y = z) → computational-eq-eq (p ∙ q) = computational-eq-eq p ∙ₗʲ computational-eq-eq q - preserves-concatl-computational-eq-eq refl q = refl + preserves-concat-computational-eq-eq refl q = refl - preserves-concatl-eq-computational-eq : + preserves-concat-eq-computational-eq : (p : x =ʲ y) (q : y =ʲ z) → eq-computational-eq (p ∙ₗʲ q) = eq-computational-eq p ∙ eq-computational-eq q - preserves-concatl-eq-computational-eq (w , f , g) (w' , f' , g') = + preserves-concat-eq-computational-eq (w , f , g) (w' , f' , g') = ( ap (f' x) left-unit-concatr) ∙ ( ap ( f' x) @@ -445,35 +542,51 @@ module _ #### The groupoidal laws for the judgmentally left unital concatenation operation +To see that `_∙ₗʲ_` is judgmentally associative, we unfold both +`(P ∙ₗʲ Q) ∙ₗʲ R` and `P ∙ₗʲ (Q ∙ₗʲ R)` and observe that it follows from the +judgmental associativity of `_∙ʸ_`: + +```text + (P ∙ₗʲ Q) ∙ₗʲ R + ≐ ((u , p , p') ∙ₗʲ (v , q , q')) ∙ₗʲ (w , r , r') + ≐ ((v , q , (q' ∙ʸ invʸ p) ∙ʸ p')) ∙ₗʲ (w , r , r') + ≐ (w , r , (r' ∙ʸ invʸ q) ∙ʸ ((q' ∙ʸ invʸ p) ∙ʸ p')) + + ≐ (w , r , (((r' ∙ʸ invʸ q) ∙ʸ q') ∙ʸ invʸ p) ∙ʸ p') + ≐ (u , p , p') ∙ₗʲ ((w , r , (r' ∙ʸ invʸ q) ∙ʸ q')) + ≐ (u , p , p') ∙ₗʲ ((v , q , q') ∙ₗʲ (w , r , r')) + ≐ P ∙ₗʲ (Q ∙ₗʲ R). +``` + ```agda module _ {l : Level} {A : UU l} {x y z w : A} where - assoc-concatl-computational-Id : + assoc-concat-computational-Id : (p : x =ʲ y) (q : y =ʲ z) (r : z =ʲ w) → (p ∙ₗʲ q) ∙ₗʲ r = p ∙ₗʲ (q ∙ₗʲ r) - assoc-concatl-computational-Id p q r = refl + assoc-concat-computational-Id p q r = refl module _ {l : Level} {A : UU l} {x y : A} where - left-unit-concatl-computational-Id : + left-unit-concat-computational-Id : {p : x =ʲ y} → refl-computational-Id ∙ₗʲ p = p - left-unit-concatl-computational-Id = refl + left-unit-concat-computational-Id = refl - right-unit-concatl-computational-Id : + right-unit-concat-computational-Id : {p : x =ʲ y} → p ∙ₗʲ refl-computational-Id = p - right-unit-concatl-computational-Id {z , p , q} = + right-unit-concat-computational-Id {z , p , q} = ind-yoneda-Id ( λ _ p → (z , p , q) ∙ₗʲ refl-computational-Id = (z , p , q)) ( refl) ( p) - left-inv-concatl-computational-Id : + left-inv-concat-computational-Id : (p : x =ʲ y) → inv-computational-Id p ∙ₗʲ p = refl-computational-Id - left-inv-concatl-computational-Id (z , p , q) = + left-inv-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ p → ( inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q)) = @@ -481,9 +594,9 @@ module _ ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-yoneda-Id q))) ( p) - right-inv-concatl-computational-Id : + right-inv-concat-computational-Id : (p : x =ʲ y) → p ∙ₗʲ inv-computational-Id p = refl-computational-Id - right-inv-concatl-computational-Id (z , p , q) = + right-inv-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ q → ( (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q)) = @@ -491,20 +604,23 @@ module _ ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-yoneda-Id p))) ( q) - distributive-inv-concatl-computational-Id : + distributive-inv-concat-computational-Id : (p : x =ʲ y) {z : A} (q : y =ʲ z) → inv-computational-Id (p ∙ₗʲ q) = inv-computational-Id q ∙ₗʲ inv-computational-Id p - distributive-inv-concatl-computational-Id p = + distributive-inv-concat-computational-Id p = ind-computational-Id ( λ _ q → inv-computational-Id (p ∙ₗʲ q) = inv-computational-Id q ∙ₗʲ inv-computational-Id p) - ( ap inv-computational-Id (right-unit-concatl-computational-Id)) + ( ap inv-computational-Id (right-unit-concat-computational-Id)) ``` #### The groupoidal laws for the judgmentally right unital concatenation operation +Associativity follows from a similar computation as for the judgmentally left +unital concatenation operation. + ```agda module _ {l : Level} {A : UU l} From 051e804184e6e8f691232fdd22b0b21468437f1a Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 17:49:05 +0100 Subject: [PATCH 27/39] fix merge conflicts --- src/foundation-core.lagda.md | 1 - .../function-extensionality.lagda.md | 25 ------------------- .../computational-identity-types.lagda.md | 13 +++++----- ...ally-compositional-identity-types.lagda.md | 7 +++--- ...entally-involutive-identity-types.lagda.md | 24 +++++++++--------- 5 files changed, 22 insertions(+), 48 deletions(-) delete mode 100644 src/foundation-core/function-extensionality.lagda.md diff --git a/src/foundation-core.lagda.md b/src/foundation-core.lagda.md index 54910aea26..5244d7271e 100644 --- a/src/foundation-core.lagda.md +++ b/src/foundation-core.lagda.md @@ -28,7 +28,6 @@ open import foundation-core.equivalence-relations public open import foundation-core.equivalences public open import foundation-core.families-of-equivalences public open import foundation-core.fibers-of-maps public -open import foundation-core.function-extensionality public open import foundation-core.function-types public open import foundation-core.functoriality-dependent-function-types public open import foundation-core.functoriality-dependent-pair-types public diff --git a/src/foundation-core/function-extensionality.lagda.md b/src/foundation-core/function-extensionality.lagda.md deleted file mode 100644 index 8577884923..0000000000 --- a/src/foundation-core/function-extensionality.lagda.md +++ /dev/null @@ -1,25 +0,0 @@ -# Function extensionality - -```agda -module foundation-core.function-extensionality where -``` - -
Imports - -```agda -open import foundation.action-on-identifications-binary-functions -open import foundation.action-on-identifications-functions -open import foundation.dependent-pair-types -open import foundation.implicit-function-types -open import foundation.universe-levels -open import foundation.whiskering-homotopies-composition - -open import foundation-core.equivalences -open import foundation-core.function-types -open import foundation-core.homotopies -open import foundation-core.identity-types -open import foundation-core.precomposition-dependent-functions -open import foundation-core.precomposition-functions -``` - -
diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index a017270ce8..28f9b4c4a2 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -11,6 +11,7 @@ open import foundation.action-on-identifications-binary-functions open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types +open import foundation.function-extensionality open import foundation.judgmentally-compositional-identity-types open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.transport-along-identifications @@ -21,7 +22,6 @@ open import foundation-core.cartesian-product-types open import foundation-core.contractible-types open import foundation-core.equality-dependent-pair-types open import foundation-core.equivalences -open import foundation-core.function-extensionality open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types open import foundation-core.homotopies @@ -206,7 +206,6 @@ module _ eq-computational-eq : {x y : A} → x =ʲ y → x = y eq-computational-eq = eq-yoneda-eq ∘ yoneda-eq-computational-eq - equiv-computational-eq-eq : {x y : A} → (x = y) ≃ (x =ʲ y) equiv-computational-eq-eq = equiv-computational-eq-yoneda-eq ∘e equiv-yoneda-eq-eq @@ -226,7 +225,7 @@ module _ ind-yoneda-Id ( λ _ q → computational-eq-eq (eq-computational-eq (z , p , q)) = (z , p , q)) - ( eq-pair-eq-pr2 (eq-pair (is-section-eq-yoneda-eq p) refl)) + ( eq-pair-eq-fiber (eq-pair (is-section-eq-yoneda-eq p) refl)) ( q) is-equiv-computational-eq-eq : @@ -591,7 +590,7 @@ module _ ( λ _ p → ( inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q)) = ( refl-computational-Id)) - ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-yoneda-Id q))) + ( eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-yoneda-Id q))) ( p) right-inv-concat-computational-Id : @@ -601,7 +600,7 @@ module _ ( λ _ q → ( (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q)) = ( refl-computational-Id)) - ( eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-yoneda-Id p))) + ( eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-yoneda-Id p))) ( q) distributive-inv-concat-computational-Id : @@ -654,7 +653,7 @@ module _ ( λ _ p → ( inv-computational-Id (z , p , q) ∙ᵣʲ (z , p , q)) = ( refl-computational-Id)) - ( eq-pair-eq-pr2 (eq-pair (right-inv-yoneda-Id q) refl)) + ( eq-pair-eq-fiber (eq-pair (right-inv-yoneda-Id q) refl)) ( p) right-inv-concatr-computational-Id : @@ -664,7 +663,7 @@ module _ ( λ _ q → ( (z , p , q) ∙ᵣʲ inv-computational-Id (z , p , q)) = ( refl-computational-Id)) - ( eq-pair-eq-pr2 (eq-pair (right-inv-yoneda-Id p) refl)) + ( eq-pair-eq-fiber (eq-pair (right-inv-yoneda-Id p) refl)) ( q) module _ diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/judgmentally-compositional-identity-types.lagda.md index 3bac5ceb0f..50553cb47d 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/judgmentally-compositional-identity-types.lagda.md @@ -9,15 +9,16 @@ module foundation.judgmentally-compositional-identity-types where ```agda open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types +open import foundation.function-extensionality open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.multivariable-homotopies open import foundation.transport-along-identifications +open import foundation.univalence open import foundation.universal-property-identity-systems open import foundation.universe-levels open import foundation-core.contractible-types open import foundation-core.equivalences -open import foundation-core.function-extensionality open import foundation-core.function-types open import foundation-core.functoriality-dependent-pair-types open import foundation-core.homotopies @@ -25,7 +26,6 @@ open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families -open import foundation.univalence ``` @@ -246,7 +246,8 @@ module _ where is-section-eq-yoneda-eq-refl : - {x : A} → yoneda-eq-eq (eq-yoneda-eq (refl-yoneda-Id {x = x})) = refl-yoneda-Id + {x : A} → + yoneda-eq-eq (eq-yoneda-eq (refl-yoneda-Id {x = x})) = refl-yoneda-Id is-section-eq-yoneda-eq-refl = refl preserves-refl-yoneda-eq-eq : diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index c292205240..ed986e8c2e 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -379,7 +379,7 @@ module _ eq-concat-concatr-involutive-Id : {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → p ∙ᵣⁱ q = p ∙ⁱ q eq-concat-concatr-involutive-Id (w , refl , q) (w' , p' , refl) = - eq-pair-eq-pr2 (eq-pair (left-unit-concatr) (inv left-unit-concatr)) + eq-pair-eq-fiber (eq-pair (left-unit-concatr) (inv left-unit-concatr)) preserves-concatr-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → @@ -414,8 +414,8 @@ module _ (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → ((p ∙ⁱ q) ∙ⁱ r) = (p ∙ⁱ (q ∙ⁱ r)) assoc-involutive-Id (_ , p , q) (_ , p' , q') (_ , p'' , q'') = - eq-pair-eq-pr2 - ( eq-pair-eq-pr2 + eq-pair-eq-fiber + ( eq-pair-eq-fiber ( ( inv (assoc-concatr (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ ( ap (_∙ᵣ q) (inv (assoc-concatr (q'' ∙ᵣ inv p') q' (inv p)))))) @@ -430,23 +430,23 @@ module _ right-unit-involutive-Id : {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p right-unit-involutive-Id {p = .y , refl , q} = - eq-pair-eq-pr2 (eq-pair-eq-pr2 left-unit-concatr) + eq-pair-eq-fiber (eq-pair-eq-fiber left-unit-concatr) left-inv-involutive-Id : (p : x =ⁱ y) → inv-involutive-Id p ∙ⁱ p = refl-involutive-Id left-inv-involutive-Id (.y , refl , q) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-concatr q)) + eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-concatr q)) right-inv-involutive-Id : (p : x =ⁱ y) → p ∙ⁱ inv-involutive-Id p = refl-involutive-Id right-inv-involutive-Id (.x , p , refl) = - eq-pair-eq-pr2 (eq-pair-eq-pr2 (right-inv-concatr p)) + eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-concatr p)) distributive-inv-concat-involutive-Id : (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → inv-involutive-Id (p ∙ⁱ q) = inv-involutive-Id q ∙ⁱ inv-involutive-Id p distributive-inv-concat-involutive-Id (.y , refl , q') (.y , p' , refl) = - eq-pair-eq-pr2 (eq-pair (left-unit-concatr) (inv left-unit-concatr)) + eq-pair-eq-fiber (eq-pair (left-unit-concatr) (inv left-unit-concatr)) ``` #### The groupoidal laws for the judgmentally right unital concatenation operation @@ -460,7 +460,7 @@ module _ (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → ((p ∙ᵣⁱ q) ∙ᵣⁱ r) = (p ∙ᵣⁱ (q ∙ᵣⁱ r)) assoc-concatr-involutive-Id (_ , p , q) (_ , p' , q') (_ , p'' , q'') = - eq-pair-eq-pr2 + eq-pair-eq-fiber ( eq-pair ( ( assoc-concatr (p ∙ᵣ inv q' ∙ᵣ p') (inv q'') p'') ∙ ( assoc-concatr (p ∙ᵣ inv q') p' (inv q'' ∙ᵣ p'')) ∙ @@ -474,7 +474,7 @@ module _ left-unit-concatr-involutive-Id : {p : x =ⁱ y} → refl-involutive-Id ∙ᵣⁱ p = p left-unit-concatr-involutive-Id {p = .x , p , refl} = - eq-pair-eq-pr2 (eq-pair left-unit-concatr refl) + eq-pair-eq-fiber (eq-pair left-unit-concatr refl) right-unit-concatr-involutive-Id : {p : x =ⁱ y} → p ∙ᵣⁱ refl-involutive-Id = p @@ -483,18 +483,18 @@ module _ left-inv-concatr-involutive-Id : (p : x =ⁱ y) → inv-involutive-Id p ∙ᵣⁱ p = refl-involutive-Id left-inv-concatr-involutive-Id (.y , refl , q) = - eq-pair-eq-pr2 (eq-pair (right-inv-concatr q) refl) + eq-pair-eq-fiber (eq-pair (right-inv-concatr q) refl) right-inv-concatr-involutive-Id : (p : x =ⁱ y) → p ∙ᵣⁱ inv-involutive-Id p = refl-involutive-Id right-inv-concatr-involutive-Id (.x , p , refl) = - eq-pair-eq-pr2 (eq-pair (right-inv-concatr p) refl) + eq-pair-eq-fiber (eq-pair (right-inv-concatr p) refl) distributive-inv-concatr-involutive-Id : (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → inv-involutive-Id (p ∙ᵣⁱ q) = inv-involutive-Id q ∙ᵣⁱ inv-involutive-Id p distributive-inv-concatr-involutive-Id (.y , refl , q) (.y , p' , refl) = - eq-pair-eq-pr2 (eq-pair (inv left-unit-concatr) (left-unit-concatr)) + eq-pair-eq-fiber (eq-pair (inv left-unit-concatr) (left-unit-concatr)) ``` ## See also From 502a40f0fbf480a798f6d78e3cf034aed9e7e0ef Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 17:58:10 +0100 Subject: [PATCH 28/39] rename judgmentally compositional ids to yoneda ids --- src/foundation-core/identity-types.lagda.md | 2 +- src/foundation.lagda.md | 2 +- .../computational-identity-types.lagda.md | 5 ++-- ...entally-involutive-identity-types.lagda.md | 4 +-- ...tal-concatenation-identifications.lagda.md | 2 +- ...agda.md => yoneda-identity-types.lagda.md} | 25 +++++++++---------- 6 files changed, 19 insertions(+), 21 deletions(-) rename src/foundation/{judgmentally-compositional-identity-types.lagda.md => yoneda-identity-types.lagda.md} (96%) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index 75fdc831b2..e0206e2aaf 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -164,7 +164,7 @@ reasons, we use the first alternative by convention. See also - [judgmentally right unital concatenation operation on indentifications](foundation.judgmentally-right-unital-concatenation-identifications.md) -- [judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) +- [yoneda identity types](foundation.yoneda-identity-types.md) ```agda module _ diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 7fca75add9..76a24fe791 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -211,7 +211,6 @@ open import foundation.iterated-dependent-product-types public open import foundation.iterating-automorphisms public open import foundation.iterating-functions public open import foundation.iterating-involutions public -open import foundation.judgmentally-compositional-identity-types public open import foundation.judgmentally-involutive-identity-types public open import foundation.judgmentally-right-unital-concatenation-identifications public open import foundation.kernel-span-diagrams-of-maps public @@ -432,4 +431,5 @@ open import foundation.whiskering-homotopies-composition public open import foundation.whiskering-homotopies-concatenation public open import foundation.whiskering-identifications-concatenation public open import foundation.whiskering-operations public +open import foundation.yoneda-identity-types public ``` diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 28f9b4c4a2..bf269017f1 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -12,11 +12,11 @@ open import foundation.action-on-identifications-functions open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.function-extensionality -open import foundation.judgmentally-compositional-identity-types open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.transport-along-identifications open import foundation.universal-property-identity-systems open import foundation.universe-levels +open import foundation.yoneda-identity-types open import foundation-core.cartesian-product-types open import foundation-core.contractible-types @@ -47,8 +47,7 @@ These are defined using the construction of the (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) ``` -but using the -[yoneda identity types](foundation.judgmentally-compositional-identity-types.md) +but using the [yoneda identity types](foundation.yoneda-identity-types.md) (`_=ʸ_`) as the underlying identity types: ```text diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/judgmentally-involutive-identity-types.lagda.md index ed986e8c2e..add44395a2 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/judgmentally-involutive-identity-types.lagda.md @@ -499,8 +499,8 @@ module _ ## See also -- [The judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) - for an identity relation that is strictly associative and two-sided unital. +- [The yoneda identity types](foundation.yoneda-identity-types.md) for an + identity relation that is strictly associative and two-sided unital. - [The computational identity types](foundation.computational-identity-types.md) for an identity relation that is judgmentally involutive, associative, and one-sided unital. diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md index fbcb7857b5..444379d08a 100644 --- a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md @@ -177,4 +177,4 @@ module _ ## See also -- [judgmentally compositional identity types](foundation.judgmentally-compositional-identity-types.md) +- [Yoneda identity types](foundation.yoneda-identity-types.md) diff --git a/src/foundation/judgmentally-compositional-identity-types.lagda.md b/src/foundation/yoneda-identity-types.lagda.md similarity index 96% rename from src/foundation/judgmentally-compositional-identity-types.lagda.md rename to src/foundation/yoneda-identity-types.lagda.md index 50553cb47d..97d4418355 100644 --- a/src/foundation/judgmentally-compositional-identity-types.lagda.md +++ b/src/foundation/yoneda-identity-types.lagda.md @@ -1,7 +1,7 @@ -# Judgmentally compositional identity types +# Yoneda identity types ```agda -module foundation.judgmentally-compositional-identity-types where +module foundation.yoneda-identity-types where ```
Imports @@ -35,7 +35,7 @@ open import foundation-core.torsorial-type-families The standard definition of [identity types](foundation-core.identity-types.md) has the limitation that many of the basic operations only satisfy algebraic laws _weakly_. In this file, we consider the -{{#concept "judgmentally compositional identity types" Agda=yoneda-Id}} +{{#concept "yoneda identity types" Agda=yoneda-Id}} ```text (x =ʸ y) := (z : A) → (z = x) → (z = y) @@ -43,9 +43,8 @@ _weakly_. In this file, we consider the Through the interpretation of types as ∞-categories, where the hom-space `hom(x , y)` is defined to be the identity type `x = y`, we may observe that -this is an instance of the Yoneda embedding. Thus we also dub these the -{{#concept "yoneda identity types" Agda=yoneda-Id}}, and use a superscript `y` -in their notation. +this is an instance of the Yoneda embedding. We use a superscript `y` in the +notation of the yoneda identity types. The yoneda identity types are [equivalent](foundation-core.equivalences.md) to the standard identity types, but satisfy judgmental laws @@ -420,10 +419,10 @@ structure on types. ### Inverting yoneda identifications -We consider two ways of defining the inversion operation on judgmentally -compositional identifications: by the judgmentally right unital, and -judgmentally left unital concatenation operation on the underlying identity type -respectively. The former enjoys the computational property +We consider two ways of defining the inversion operation on yoneda +identifications: by the judgmentally right unital, and judgmentally left unital +concatenation operation on the underlying identity type respectively. The former +enjoys the computational property ```text inv reflʸ ≐ reflʸ, @@ -653,7 +652,7 @@ module _ ## Operations -We can define basic operations on compositional identifications. They all enjoy +We can define basic operations on the yoneda identifications. They all enjoy strict computational properties. ### Action of functions on yoneda identifications @@ -701,7 +700,7 @@ module _ compute-tr-refl-yoneda-Id = refl ``` -### Function extensionality with respect to compositional identifications +### Function extensionality with respect to yoneda identifications ```agda module _ @@ -724,7 +723,7 @@ module _ funext-yoneda-Id = is-equiv-map-equiv equiv-htpy-yoneda-eq ``` -### Univalence with respect to compositional identifications +### Univalence with respect to yoneda identifications ```agda module _ From aac9d2ca1f874347de6e019336fd9cc22c91a28d Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 18:20:04 +0100 Subject: [PATCH 29/39] change judgmental to something else in many places --- src/foundation-core/identity-types.lagda.md | 4 +- src/foundation.lagda.md | 4 +- .../computational-identity-types.lagda.md | 77 +++++++++---------- ...al-concatenation-identifications.lagda.md} | 16 ++-- ...rictly-involutive-identity-types.lagda.md} | 67 ++++++++-------- src/foundation/yoneda-identity-types.lagda.md | 28 ++++--- 6 files changed, 94 insertions(+), 102 deletions(-) rename src/foundation/{judgmentally-right-unital-concatenation-identifications.lagda.md => definitionally-right-unital-concatenation-identifications.lagda.md} (91%) rename src/foundation/{judgmentally-involutive-identity-types.lagda.md => strictly-involutive-identity-types.lagda.md} (86%) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index e0206e2aaf..5cd573e4ec 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -163,8 +163,8 @@ reasons, we use the first alternative by convention. See also -- [judgmentally right unital concatenation operation on indentifications](foundation.judgmentally-right-unital-concatenation-identifications.md) -- [yoneda identity types](foundation.yoneda-identity-types.md) +- [The definitionally right unital concatenation operation on indentifications](foundation.definitionally-right-unital-concatenation-identifications.md) +- [The yoneda identity types](foundation.yoneda-identity-types.md) ```agda module _ diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index 76a24fe791..db7b67805c 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -93,6 +93,7 @@ open import foundation.decidable-propositions public open import foundation.decidable-relations public open import foundation.decidable-subtypes public open import foundation.decidable-types public +open import foundation.definitionally-right-unital-concatenation-identifications public open import foundation.dependent-binary-homotopies public open import foundation.dependent-binomial-theorem public open import foundation.dependent-epimorphisms public @@ -211,8 +212,6 @@ open import foundation.iterated-dependent-product-types public open import foundation.iterating-automorphisms public open import foundation.iterating-functions public open import foundation.iterating-involutions public -open import foundation.judgmentally-involutive-identity-types public -open import foundation.judgmentally-right-unital-concatenation-identifications public open import foundation.kernel-span-diagrams-of-maps public open import foundation.large-binary-relations public open import foundation.large-dependent-pair-types public @@ -334,6 +333,7 @@ open import foundation.spans public open import foundation.spans-families-of-types public open import foundation.split-surjective-maps public open import foundation.standard-apartness-relations public +open import foundation.strictly-involutive-identity-types public open import foundation.strongly-extensional-maps public open import foundation.structure public open import foundation.structure-identity-principle public diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index bf269017f1..a4ad7715b3 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -9,10 +9,10 @@ module foundation.computational-identity-types where ```agda open import foundation.action-on-identifications-binary-functions open import foundation.action-on-identifications-functions +open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.function-extensionality -open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.transport-along-identifications open import foundation.universal-property-identity-systems open import foundation.universe-levels @@ -41,7 +41,7 @@ has the limitation that many of the basic operations only satisfy algebraic laws _weakly_. In this file, we consider the {{#concept "computational identity types" Agda=computational-Id}} `x =ʲ y`. These are defined using the construction of the -[judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md): +[strictly involutive identity types](foundation.strictly-involutive-identity-types.md): ```text (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) @@ -62,7 +62,7 @@ The yoneda identity types are defined as The yoneda identity types are equivalent to the standard identity types, but have a strictly associative and unital concatenation operation. We can leverage -this and the judgmental properties of the construction of the judgmentally +this and the judgmental properties of the construction of the strictly involutive identity types to construct operations on the computational identity types that satisfy the strict algebraic laws @@ -72,9 +72,9 @@ types that satisfy the strict algebraic laws - `inv reflʲ ≐ reflʲ`. While the last three equalities hold by the same computations as for the -judgmentally involutive identity types using the fact that `inv reflʸ ≐ reflʸ`, +strictly involutive identity types using the fact that `inv reflʸ ≐ reflʸ`, strict associativity relies on the strict associativity of the underlying yoneda -identity types. See the file about judgmentally involutive identity types for +identity types. See the file about strictly involutive identity types for further details on these computations. In addition to these strict algebraic laws, we can also define a recursion @@ -88,7 +88,7 @@ principle for the computational identity types so that it computes judgmentally. and they do not have a judgmental computation property for their induction principle. This boils down to the fact that the yoneda identity types do not -have a judgmental computation property for their induction principle, as +have a judgmental computation property for their induction principle, which is explained further there. ## Definition @@ -113,7 +113,7 @@ module _ ### The computational identity types are equivalent to the yoneda identity types -Similarly to the judgmentally involutive identity types, this equivalence is a +Similarly to the strictly involutive identity types, this equivalence is a strict retraction and preserves the reflexivities strictly. ```agda @@ -286,11 +286,11 @@ module _ ### The induction principle for computational identity types -The judgmentally computational identity types satisfy the induction principle of -the identity types. This states that given a base point `x : A` and a family of -types over the identity types based at `x`, `B : (y : A) (p : x =ʲ y) → UU l2`, -then to construct a dependent function `f : (y : A) (p : x =ʲ y) → B y p` it -suffices to define it at `f x refl-computational-Id`. +The computational identity types satisfy the induction principle of the identity +types. This states that given a base point `x : A` and a family of types over +the identity types based at `x`, `B : (y : A) (p : x =ʲ y) → UU l2`, then to +construct a dependent function `f : (y : A) (p : x =ʲ y) → B y p` it suffices +to define it at `f x refl-computational-Id`. ```agda module _ @@ -322,7 +322,7 @@ module _ ``` Using the fact that the recusion principles of both the yoneda identity types -and the judgmentally involutive identity types can be defined to compute +and the strictly involutive identity types can be defined to compute judgmentally, we obtain a judgmentally computing recursion principle for the computational identity types as well. @@ -363,7 +363,7 @@ structure satisfies the following algebraic laws strictly ### Inverting computational identifications -The construction is the same as for the judgmentally involutive identity types. +The construction is the same as for the strictly involutive identity types. ```agda module _ @@ -409,28 +409,25 @@ module _ ### The concatenation operations on computational identifications -There is both a judgmentally left unital concatenation operation and a -judgmentally right unital concatenation operation, while both are judgmentally -associative. +There is both a strictly left unital concatenation operation and a strictly +right unital concatenation operation, while both are strictly associative. -The judgmental one-sided unitality follows in both cases from the judgmental -right unitality of the concatenation operation on the yoneda identifications -following the same computation as for the judgmentally involutive identity -types. +The strict one-sided unitality follows in both cases from the strict right +unitality of the concatenation operation on the yoneda identifications following +the same computation as for the strictly involutive identity types. -For associativity on the other hand, we must use the judgmental associativity of -the yoneda identity types. We will write out the explicit computation later. +For associativity on the other hand, we must use the strict associativity of the +yoneda identity types. We will write out the explicit computation later. -**Observation.** Since they are judgmentally associative, the only instances -where they will not reduce is thus when the reflexivity appears all the way to -the right, or all the way to the left in a string of concatenations -respectively. +**Observation.** Since they are strictly associative, the only instances where +they will not reduce is thus when the reflexivity appears all the way to the +right, or all the way to the left in a string of concatenations respectively. -#### The judgmentally left unital concatenation operation +#### The strictly left unital concatenation operation -The judgmentally left unital concatenation operation is constructed the same way -as the judgmentally left unital concatenation operation for the judgmentally -involutive identity types +The strictly left unital concatenation operation is constructed the same way as +the strictly left unital concatenation operation for the strictly involutive +identity types ```text (z , p , q) ∙ₗʲ (z' , p' , q') := (z' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) @@ -491,7 +488,7 @@ module _ ( ap (f' y) (inv left-unit-concatr))) ``` -#### The judgmentally right unital concatenation operation +#### The strictly right unital concatenation operation ```agda module _ @@ -538,11 +535,11 @@ module _ ### The groupoidal laws for the computational identity types -#### The groupoidal laws for the judgmentally left unital concatenation operation +#### The groupoidal laws for the strictly left unital concatenation operation -To see that `_∙ₗʲ_` is judgmentally associative, we unfold both -`(P ∙ₗʲ Q) ∙ₗʲ R` and `P ∙ₗʲ (Q ∙ₗʲ R)` and observe that it follows from the -judgmental associativity of `_∙ʸ_`: +To see that `_∙ₗʲ_` is strictly associative, we unfold both `(P ∙ₗʲ Q) ∙ₗʲ R` +and `P ∙ₗʲ (Q ∙ₗʲ R)` and observe that it follows from the strict associativity +of `_∙ʸ_`: ```text (P ∙ₗʲ Q) ∙ₗʲ R @@ -614,10 +611,10 @@ module _ ( ap inv-computational-Id (right-unit-concat-computational-Id)) ``` -#### The groupoidal laws for the judgmentally right unital concatenation operation +#### The groupoidal laws for the strictly right unital concatenation operation -Associativity follows from a similar computation as for the judgmentally left -unital concatenation operation. +Associativity follows from a similar computation as for the strictly left unital +concatenation operation. ```agda module _ @@ -732,4 +729,4 @@ module _ ## See also -- [The judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) +- [The strictly involutive identity types](foundation.strictly-involutive-identity-types.md) diff --git a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md b/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md similarity index 91% rename from src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md rename to src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md index 444379d08a..f9eec801b1 100644 --- a/src/foundation/judgmentally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md @@ -1,7 +1,7 @@ -# The judgmentally right unital concatenation operation on identifications +# The definitionally right unital concatenation operation on identifications ```agda -module foundation.judgmentally-right-unital-concatenation-identifications where +module foundation.definitionally-right-unital-concatenation-identifications where ```
Imports @@ -27,7 +27,7 @@ is a map for all `x y z : A`. However, there are essentially three different ways we can define concatenation of identifications, all with different computational -behaviours. +behaviours: 1. We can define concatenation by induction on the equality `x = y`. This gives us the computation rule `refl ∙ q = q`. @@ -37,15 +37,13 @@ behaviours. gives us the computation rule `refl ∙ refl = refl`. While the third option may be preferred by some for its symmetry, for practical -reasons, we use the first alternative by convention. - -However, there are cases where the second case may be preferred. Hence, in this -file we consider the +reasons, we use the first alternative by convention. However, there are cases +where the second case may be preferred. Hence why we in this file consider the {{#concept "definitionally right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=concatr Agda=concatr'}}. This definition is for instance used with the -[judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) -to construct a judgmentally left unital concatenation operation. +[strictly involutive identity types](foundation.strictly-involutive-identity-types.md) +to construct a strictly left unital concatenation operation. ## Definition diff --git a/src/foundation/judgmentally-involutive-identity-types.lagda.md b/src/foundation/strictly-involutive-identity-types.lagda.md similarity index 86% rename from src/foundation/judgmentally-involutive-identity-types.lagda.md rename to src/foundation/strictly-involutive-identity-types.lagda.md index add44395a2..83be5f6a80 100644 --- a/src/foundation/judgmentally-involutive-identity-types.lagda.md +++ b/src/foundation/strictly-involutive-identity-types.lagda.md @@ -1,16 +1,16 @@ -# Judgmentally involutive identity types +# Strictly involutive identity types ```agda -module foundation.judgmentally-involutive-identity-types where +module foundation.strictly-involutive-identity-types where ```
Imports ```agda open import foundation.action-on-identifications-functions +open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types -open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.multivariable-homotopies open import foundation.universal-property-identity-systems open import foundation.universe-levels @@ -33,7 +33,7 @@ open import foundation-core.torsorial-type-families The standard definition of [identity types](foundation-core.identity-types.md) has the limitation that many of the basic operations only satisfy algebraic laws _weakly_. In this file, we consider the -{{#concept "judgmentally involutive identity types" Agda=involutive-Id}} +{{#concept "strictly involutive identity types" Agda=involutive-Id}} ```text (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) @@ -45,8 +45,8 @@ standard identity types, but satisfies the judgmental laws - `inv (inv p) ≐ p` - `inv reflⁱ ≐ reflⁱ` -where we use a superscript `i` to distinguish the judgmentally involutive -identity type from the standard identity type. +where we use a superscript `i` to distinguish the strictly involutive identity +type from the standard identity type. In addition, we maintain the following judgmental laws @@ -76,7 +76,7 @@ module _ ## Properties -### The judgmentally involutive identity types are equivalent to the standard identity types +### The strictly involutive identity types are equivalent to the standard identity types The equivalence `(x = y) ≃ (x =ⁱ y)` is defined from left to right by inclusion at the second component @@ -91,7 +91,7 @@ and from right to left by the concatenation eq-involutive-eq := (z , p , q) ↦ inv q ∙ p : x =ⁱ y → x = y. ``` -This equivalence preserves the groupoid structure on the judgmentally involutive +This equivalence preserves the groupoid structure on the strictly involutive identity types as we will see later. Moreover, the composition `eq-involutive-eq ∘ involutive-eq-eq` computes judgmentally to the identity: @@ -166,7 +166,7 @@ module _ preserves-refl-eq-involutive-eq = refl ``` -### Torsoriality of the judgmentally involutive identity types +### Torsoriality of the strictly involutive identity types ```agda module _ @@ -181,7 +181,7 @@ module _ ( is-torsorial-Id x) ``` -### The dependent universal property of the judgmentally involutive identity types +### The dependent universal property of the strictly involutive identity types ```agda module _ @@ -198,13 +198,13 @@ module _ ( is-torsorial-involutive-Id) ``` -### The induction principle for judgmentally involutive identity types +### The induction principle for strictly involutive identity types -The judgmentally involutive identity types satisfy the induction principle of -the identity types. This states that given a base point `x : A` and a family of +The strictly involutive identity types satisfy the induction principle of the +identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it -suffices to define it at `f x reflⁱ`. The judgmentally involutive identity types +suffices to define it at `f x reflⁱ`. The strictly involutive identity types also satisfy the corresponding computation rule judgmentally. ```agda @@ -234,10 +234,10 @@ uniqueness of the induction principle up to _equality_. ## Structure -The judgmentally involutive identity types form a judgmentally involutive weak +The strictly involutive identity types form a judgmentally involutive weak groupoidal structure on types. -### Inverting judgmentally involutive identifications +### Inverting strictly involutive identifications We have an inversion operation on `involutive-Id` defined by swapping the position of the identifications. This operation satisfies the judgmental laws @@ -283,16 +283,15 @@ module _ ap (inv p ∙_) (inv (inv-inv q)) ∙ inv (distributive-inv-concat (inv q) p) ``` -### Concatenation of judgmentally involutive identifications +### Concatenation of strictly involutive identifications -We have practically speaking two definitions of the concatenation operation on -judgmentally involutive identity types. One satisfies a judgmental left unit law -and the other satisfies a judgmental right unit law. In both cases, we must use -the -[judgmentally right unital concatenation operation on standard identifications](foundation.judgmentally-right-unital-concatenation-identifications.md) -`_∙ᵣ_`, to obtain this one-sided judgmental unit law. +We have, practically speaking, two definitions of the concatenation operation on +strictly involutive identity types. One satisfies a strict left unit law and the +other satisfies a strict right unit law. In both cases, we must use the +[definitionally right unital concatenation operation on standard identifications](foundation.definitionally-right-unital-concatenation-identifications.md) +`_∙ᵣ_`, to obtain this strict one-sided unit law. -The judgmentally left unital concatenation operation is defined by +The strictly left unital concatenation operation is defined by ```text (w , p , q) ∙ⁱ (w' , p' , q') := (w' , p' , (q' ∙ᵣ inv p) ∙ᵣ q), @@ -304,8 +303,8 @@ and the right unital concatenation operation is defined by (w , p , q) ∙ᵣⁱ (w' , p' , q') = (w , (p ∙ᵣ inv q') ∙ᵣ p' , q). ``` -The following computation verifies that the judgmentally left unital -concatenation operation is indeed judgmentally left unital: +The following computation verifies that the strictly left unital concatenation +operation is indeed strictly left unital: ```text reflⁱ ∙ⁱ r @@ -318,10 +317,10 @@ concatenation operation is indeed judgmentally left unital: ``` To be consistent with the convention for the standard identity types, we take -the judgmentally left unital concatenation operation to be the default -concatenation operation on judgmentally involutive identity types. +the strictly left unital concatenation operation to be the default concatenation +operation on strictly involutive identity types. -#### The judgmentally left unital concatenation operation +#### The strictly left unital concatenation operation ```agda module _ @@ -359,7 +358,7 @@ module _ ( assoc (inv q ∙ p) (inv q') p') ``` -#### The judgmentally right unital concatenation operation +#### The strictly right unital concatenation operation ```agda module _ @@ -397,13 +396,13 @@ module _ ( inv (assoc (inv q) p (inv q' ∙ p'))) ``` -### The groupoidal laws for the judgmentally involutive identity types +### The groupoidal laws for the strictly involutive identity types The general proof-strategy is to induct on the necessary identifications to make the left endpoints judgmentally equal, and then proceed by reasoning with the groupoid-laws of the underlying identity types. -#### The groupoidal laws for the judgmentally left unital concatenation operation +#### The groupoidal laws for the strictly left unital concatenation operation ```agda module _ @@ -449,7 +448,7 @@ module _ eq-pair-eq-fiber (eq-pair (left-unit-concatr) (inv left-unit-concatr)) ``` -#### The groupoidal laws for the judgmentally right unital concatenation operation +#### The groupoidal laws for the strictly right unital concatenation operation ```agda module _ @@ -502,7 +501,7 @@ module _ - [The yoneda identity types](foundation.yoneda-identity-types.md) for an identity relation that is strictly associative and two-sided unital. - [The computational identity types](foundation.computational-identity-types.md) - for an identity relation that is judgmentally involutive, associative, and + for an identity relation that is strictly involutive, associative, and one-sided unital. ## References diff --git a/src/foundation/yoneda-identity-types.lagda.md b/src/foundation/yoneda-identity-types.lagda.md index 97d4418355..b6cdfa382a 100644 --- a/src/foundation/yoneda-identity-types.lagda.md +++ b/src/foundation/yoneda-identity-types.lagda.md @@ -8,9 +8,9 @@ module foundation.yoneda-identity-types where ```agda open import foundation.action-on-identifications-functions +open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.function-extensionality -open import foundation.judgmentally-right-unital-concatenation-identifications open import foundation.multivariable-homotopies open import foundation.transport-along-identifications open import foundation.univalence @@ -159,7 +159,7 @@ and from right to left by evaluation at the reflexivity ``` It should be noted that we define the map `x = y → x =ʸ y` using the -[judgmentally right unital concatenation operation](foundation.judgmentally-right-unital-concatenation-identifications.md). +[definitionally right unital concatenation operation](foundation.definitionally-right-unital-concatenation-identifications.md). While this obstructs us from showing that the homotopy `eq-yoneda-eq ∘ yoneda-eq-eq ~ id` holds by reflexivity, as demonstrated by the computation @@ -259,8 +259,8 @@ module _ ``` Below, we consider the alternative definition of `yoneda-eq-eq` using the -judgmentally left unital concatenation operation on standard identity types. As -we can see, the retracting homotopy holds judgmentally, but now +definitionally left unital concatenation operation on standard identity types. +As we can see, the retracting homotopy holds judgmentally, but now `yoneda-eq-eq refl` does not compute definitionally to `reflʸ`. ```agda @@ -420,9 +420,9 @@ structure on types. ### Inverting yoneda identifications We consider two ways of defining the inversion operation on yoneda -identifications: by the judgmentally right unital, and judgmentally left unital -concatenation operation on the underlying identity type respectively. The former -enjoys the computational property +identifications: by the definitionally right unital, and definitionally left +unital concatenation operation on the underlying identity type respectively. The +former enjoys the computational property ```text inv reflʸ ≐ reflʸ, @@ -430,7 +430,7 @@ enjoys the computational property hence will be preferred going. -#### The inversion operation defined by the judgmentally right unital concatenation operation on identifications +#### The inversion operation defined by the definitionally right unital concatenation operation on identifications ```agda module _ @@ -478,7 +478,7 @@ module _ preserves-inv-eq-yoneda-eq f = left-unit-concatr ``` -#### The inversion operation defined by the judgmentally left unital concatenation operation on identifications +#### The inversion operation defined by the definitionally left unital concatenation operation on identifications ```agda module _ @@ -754,13 +754,11 @@ module _ ## See also -- [The judgmentally involutive identity types](foundation.judgmentally-involutive-identity-types.md) - for an identity relation that is strictly involutive, one-sided unital, and - has a judgmentally computational induction principle. +- [The strictly involutive identity types](foundation.strictly-involutive-identity-types.md) + for an identity relation that is strictly involutive, and one-sided unital. - [The computational identity types](foundation.computational-identity-types.md) - for an identity relation that is judgmentally involutive, associative, and - one-sided unital, but does not have a judgmentally computational induction - principle. + for an identity relation that is strictly involutive, associative, and + one-sided unital. ## References From 27234ae59271e651c38e192ebd4909b6f2f766ec Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 18:28:51 +0100 Subject: [PATCH 30/39] update `identity-types` table --- tables/identity-types.md | 64 ++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/tables/identity-types.md b/tables/identity-types.md index 9ed6a3dc86..0e3fabac21 100644 --- a/tables/identity-types.md +++ b/tables/identity-types.md @@ -1,29 +1,35 @@ -| Concept | File | -| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| Action on higher identifications of functions | [`foundation.action-on-higher-identifications-functions`](foundation.action-on-higher-identifications-functions.md) | -| Action on identifications of binary functions | [`foundation.action-on-identifications-binary-functions`](foundation.action-on-identifications-binary-functions.md) | -| Action on identifications of dependent functions | [`foundation.action-on-identifications-dependent-functions`](foundation.action-on-identifications-dependent-functions.md) | -| Action on identifications of functions | [`foundation.action-on-identifications-functions`](foundation.action-on-identifications-functions.md) | -| Binary transport | [`foundation.binary-transport`](foundation.binary-transport.md) | -| Commuting hexagons of identifications | [`foundation.commuting-hexagons-of-identifications`](foundation.commuting-hexagons-of-identifications.md) | -| Commuting squares of identifications | [`foundation.commuting-squares-of-identifications`](foundation.commuting-squares-of-identifications.md) | -| Dependent identifications (foundation) | [`foundation.dependent-identifications`](foundation.dependent-identifications.md) | -| Dependent identifications (foundation-core) | [`foundation-core.dependent-identifications`](foundation-core.dependent-identifications.md) | -| The fundamental theorem of identity types | [`foundation.fundamental-theorem-of-identity-types`](foundation.fundamental-theorem-of-identity-types.md) | -| Identity systems | [`foundation.identity-systems`](foundation.identity-systems.md) | -| The identity type (foundation) | [`foundation.identity-types`](foundation.identity-types.md) | -| The identity type (foundation-core) | [`foundation-core.identity-types`](foundation-core.identity-types.md) | -| Large identity types | [`foundation.large-identity-types`](foundation.large-identity-types.md) | -| Negated equality | [`foundation.negated-equality`](foundation.negated-equality.md) | -| Path algebra | [`foundation.path-algebra`](foundation.path-algebra.md) | -| The Regensburg extension of the fundamental theorem of identity types | [`foundation.regensburg-extension-fundamental-theorem-of-identity-types`](foundation.regensburg-extension-fundamental-theorem-of-identity-types.md) | -| Symmetric identity types | [`foundation.symmetric-identity-types`](foundation.symmetric-identity-types.md) | -| Torsorial type families (foundation) | [`foundation.torsorial-type-families`](foundation.torsorial-type-families.md) | -| Torsorial type familes (foundation-core) | [`foundation-core.torsorial-type-families`](foundation-core.torsorial-type-families.md) | -| Transport along higher identifications | [`foundation.transport-along-higher-identifications`](foundation.transport-along-higher-identifications.md) | -| Transport along identifications (foundation) | [`foundation.transport-along-identifications`](foundation.transport-along-identifications.md) | -| Transport along identifications (foundation-core) | [`foundation-core.transport-along-identifications`](foundation-core.transport-along-identifications.md) | -| Transposition of identifications along equivalences | [`foundation.transposition-identifications-along-equivalences`](foundation.transposition-identifications-along-equivalences.md) | -| The universal property of identity systems | [`foundation.universal-property-identity-systems`](foundation.universal-property-identity-systems.md) | -| The universal property of identity types | [`foundation.universal-property-identity-types`](foundation.universal-property-identity-types.md) | -| Whiskering identifications | [`foundation.whiskering-identifications-concatenation`](foundation.whiskering-identifications-concatenation.md) | +| Concept | File | +| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| Action on higher identifications of functions | [`foundation.action-on-higher-identifications-functions`](foundation.action-on-higher-identifications-functions.md) | +| Action on identifications of binary functions | [`foundation.action-on-identifications-binary-functions`](foundation.action-on-identifications-binary-functions.md) | +| Action on identifications of dependent functions | [`foundation.action-on-identifications-dependent-functions`](foundation.action-on-identifications-dependent-functions.md) | +| Action on identifications of functions | [`foundation.action-on-identifications-functions`](foundation.action-on-identifications-functions.md) | +| Binary transport | [`foundation.binary-transport`](foundation.binary-transport.md) | +| Commuting hexagons of identifications | [`foundation.commuting-hexagons-of-identifications`](foundation.commuting-hexagons-of-identifications.md) | +| Commuting pentagons of identifications | [`foundation.commuting-pentagons-of-identifications`](foundation.commuting-pentagons-of-identifications.md) | +| Commuting squares of identifications | [`foundation.commuting-squares-of-identifications`](foundation.commuting-squares-of-identifications.md) | +| Commuting triangles of identifications | [`foundation.commuting-triangles-of-identifications`](foundation.commuting-triangles-of-identifications.md) | +| The computational identity type | [`foundation.computational-identity-types`](foundation.computational-identity-types.md) | +| The strictly involutive identity type | [`foundation.strictly-involutive-identity-types`](foundation.strictly-identity-types.md) | +| The definitionally right unital concatenation operation on identifications | [`foundation.definitionally-right-unital-concatenation-identifications`](foundation.definitionally-right-unital-concatenation-identifications.md) | +| Dependent identifications (foundation) | [`foundation.dependent-identifications`](foundation.dependent-identifications.md) | +| Dependent identifications (foundation-core) | [`foundation-core.dependent-identifications`](foundation-core.dependent-identifications.md) | +| The fundamental theorem of identity types | [`foundation.fundamental-theorem-of-identity-types`](foundation.fundamental-theorem-of-identity-types.md) | +| Identity systems | [`foundation.identity-systems`](foundation.identity-systems.md) | +| The identity type (foundation) | [`foundation.identity-types`](foundation.identity-types.md) | +| The identity type (foundation-core) | [`foundation-core.identity-types`](foundation-core.identity-types.md) | +| Large identity types | [`foundation.large-identity-types`](foundation.large-identity-types.md) | +| Negated equality | [`foundation.negated-equality`](foundation.negated-equality.md) | +| Path algebra | [`foundation.path-algebra`](foundation.path-algebra.md) | +| The Regensburg extension of the fundamental theorem of identity types | [`foundation.regensburg-extension-fundamental-theorem-of-identity-types`](foundation.regensburg-extension-fundamental-theorem-of-identity-types.md) | +| Symmetric identity types | [`foundation.symmetric-identity-types`](foundation.symmetric-identity-types.md) | +| Torsorial type families (foundation) | [`foundation.torsorial-type-families`](foundation.torsorial-type-families.md) | +| Torsorial type familes (foundation-core) | [`foundation-core.torsorial-type-families`](foundation-core.torsorial-type-families.md) | +| Transport along higher identifications | [`foundation.transport-along-higher-identifications`](foundation.transport-along-higher-identifications.md) | +| Transport along identifications (foundation) | [`foundation.transport-along-identifications`](foundation.transport-along-identifications.md) | +| Transport along identifications (foundation-core) | [`foundation-core.transport-along-identifications`](foundation-core.transport-along-identifications.md) | +| Transposition of identifications along equivalences | [`foundation.transposition-identifications-along-equivalences`](foundation.transposition-identifications-along-equivalences.md) | +| The universal property of identity systems | [`foundation.universal-property-identity-systems`](foundation.universal-property-identity-systems.md) | +| The universal property of identity types | [`foundation.universal-property-identity-types`](foundation.universal-property-identity-types.md) | +| Whiskering identifications | [`foundation.whiskering-identifications-concatenation`](foundation.whiskering-identifications-concatenation.md) | +| The yoneda identity type | [`foundation.yoneda-identity-types`](foundation.yoneda-identity-types.md) | From b9dfac00e241c4c7737642dc98eca420d12bea95 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 18:36:46 +0100 Subject: [PATCH 31/39] common operations on computational identifications --- .../computational-identity-types.lagda.md | 80 ++++++++++++++++--- 1 file changed, 68 insertions(+), 12 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index a4ad7715b3..76fbf918ed 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -13,7 +13,9 @@ open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.function-extensionality +open import foundation.multivariable-homotopies open import foundation.transport-along-identifications +open import foundation.univalence open import foundation.universal-property-identity-systems open import foundation.universe-levels open import foundation.yoneda-identity-types @@ -29,7 +31,6 @@ open import foundation-core.identity-types open import foundation-core.retractions open import foundation-core.sections open import foundation-core.torsorial-type-families -open import foundation-core.univalence ```
@@ -678,16 +679,38 @@ module _ ( inv left-unit-concatr-computational-Id) ``` +## Operations + ### Action of functions on computational identifications ```agda module _ - {l1 l2 : Level} {A : UU l1} {B : UU l2} {x y : A} (f : A → B) + {l1 l2 : Level} {A : UU l1} {B : UU l2} (f : A → B) + where + + eq-ap-computational-Id : {x y : A} → x =ʲ y → f x = f y + eq-ap-computational-Id = ap f ∘ eq-computational-eq + + ap-computational-Id : {x y : A} → x =ʲ y → f x =ʲ f y + ap-computational-Id = + computational-eq-yoneda-eq ∘ ap-yoneda-Id f ∘ yoneda-eq-computational-eq + + compute-ap-refl-computational-Id : + {x : A} → + ap-computational-Id (refl-computational-Id {x = x}) = refl-computational-Id + compute-ap-refl-computational-Id = refl + +module _ + {l1 : Level} {A : UU l1} where - ap-computational-Id : x =ʲ y → f x =ʲ f y - ap-computational-Id (z , p , q) = - (f z , ap-yoneda-Id f p , ap-yoneda-Id f q) + compute-ap-id-computational-Id : + {x y : A} (p : x =ʲ y) → ap-computational-Id id p = p + compute-ap-id-computational-Id p = + ( ap + ( computational-eq-yoneda-eq) + ( compute-ap-id-yoneda-Id (yoneda-eq-computational-eq p))) ∙ + ( is-section-yoneda-eq-computational-eq p) ``` ### Transport along computational identifications @@ -698,14 +721,14 @@ module _ where tr-computational-Id : {x y : A} → x =ʲ y → B x → B y - tr-computational-Id p = tr-yoneda-Id B (yoneda-eq-computational-eq p) + tr-computational-Id = tr B ∘ eq-computational-eq - compute-tr-computational-Id-refl : + compute-tr-refl-computational-Id : {x : A} → tr-computational-Id (refl-computational-Id {x = x}) = id - compute-tr-computational-Id-refl = refl + compute-tr-refl-computational-Id = refl ``` -### `htpy-computational-eq` +### Function extensionality with respect to computational identifications ```agda module _ @@ -713,20 +736,53 @@ module _ where htpy-computational-eq : f =ʲ g → f ~ g - htpy-computational-eq p = htpy-yoneda-eq (yoneda-eq-computational-eq p) + htpy-computational-eq = htpy-eq ∘ eq-computational-eq + + computational-eq-htpy : f ~ g → f =ʲ g + computational-eq-htpy = computational-eq-eq ∘ eq-htpy + + equiv-htpy-computational-eq : (f =ʲ g) ≃ (f ~ g) + equiv-htpy-computational-eq = equiv-funext ∘e equiv-eq-computational-eq + + equiv-computational-eq-htpy : (f ~ g) ≃ (f =ʲ g) + equiv-computational-eq-htpy = equiv-computational-eq-eq ∘e equiv-eq-htpy + + funext-computational-Id : is-equiv htpy-computational-eq + funext-computational-Id = is-equiv-map-equiv equiv-htpy-computational-eq ``` -### `equiv-computational-eq` +### Univalence with respect to computational identifications ```agda module _ {l1 : Level} {A B : UU l1} where + map-computational-eq : A =ʲ B → A → B + map-computational-eq = map-eq ∘ eq-computational-eq + equiv-computational-eq : A =ʲ B → A ≃ B - equiv-computational-eq p = equiv-yoneda-eq (yoneda-eq-computational-eq p) + equiv-computational-eq = equiv-eq ∘ eq-computational-eq + + computational-eq-equiv : A ≃ B → A =ʲ B + computational-eq-equiv = computational-eq-eq ∘ eq-equiv + + equiv-equiv-computational-eq : (A =ʲ B) ≃ (A ≃ B) + equiv-equiv-computational-eq = equiv-univalence ∘e equiv-eq-computational-eq + + is-equiv-equiv-computational-eq : is-equiv equiv-computational-eq + is-equiv-equiv-computational-eq = + is-equiv-map-equiv equiv-equiv-computational-eq + + equiv-computational-eq-equiv : (A ≃ B) ≃ (A =ʲ B) + equiv-computational-eq-equiv = equiv-computational-eq-eq ∘e equiv-eq-equiv A B + + is-equiv-computational-eq-equiv : is-equiv computational-eq-equiv + is-equiv-computational-eq-equiv = + is-equiv-map-equiv equiv-computational-eq-equiv ``` ## See also - [The strictly involutive identity types](foundation.strictly-involutive-identity-types.md) +- [The yoneda identity types](foundation.yoneda-identity-types.md) From 2eda7ffde5e91c154263b54975fef79ac349c2a3 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 18:45:03 +0100 Subject: [PATCH 32/39] an unused import --- src/foundation/computational-identity-types.lagda.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 76fbf918ed..20fda184a9 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -13,7 +13,6 @@ open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.function-extensionality -open import foundation.multivariable-homotopies open import foundation.transport-along-identifications open import foundation.univalence open import foundation.universal-property-identity-systems From 1d295b5fbc7f4431bc450adff67cdbd97d1f6652 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 19:12:18 +0100 Subject: [PATCH 33/39] self-review --- .../computational-identity-types.lagda.md | 121 ++++++++++-------- ...tal-concatenation-identifications.lagda.md | 2 +- ...trictly-involutive-identity-types.lagda.md | 20 +-- src/foundation/yoneda-identity-types.lagda.md | 10 ++ 4 files changed, 88 insertions(+), 65 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 20fda184a9..c9ec07a9b5 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -78,13 +78,13 @@ identity types. See the file about strictly involutive identity types for further details on these computations. In addition to these strict algebraic laws, we can also define a recursion -principle for the computational identity types so that it computes judgmentally. +principle for the computational identity types that computes judgmentally. **Note.** The computational identity types do _not_ satisfy the judgmental laws -- `refl ∙ p ≐ p` and `p ∙ refl ≐ p` simultaneously, -- `inv p ∙ p ≐ refl`, or -- `p ∙ inv p ≐ refl`, +- `reflʲ ∙ʲ p ≐ p` and `p ∙ʲ reflʲ ≐ p` simultaneously, +- `inv p ∙ʲ p ≐ reflʲ`, or +- `p ∙ʲ inv p ≐ reflʲ`, and they do not have a judgmental computation property for their induction principle. This boils down to the fact that the yoneda identity types do not @@ -284,13 +284,13 @@ module _ ( is-torsorial-computational-Id) ``` -### The induction principle for computational identity types +### The induction principle for the computational identity types The computational identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, `B : (y : A) (p : x =ʲ y) → UU l2`, then to construct a dependent function `f : (y : A) (p : x =ʲ y) → B y p` it suffices -to define it at `f x refl-computational-Id`. +to define it at `f x reflʲ`. ```agda module _ @@ -363,7 +363,13 @@ structure satisfies the following algebraic laws strictly ### Inverting computational identifications -The construction is the same as for the strictly involutive identity types. +The construction and computations are the same as for the strictly involutive +identity types. The inversion operation is defined by swapping the positions of +the two yoneda identifications + +```text + invʲ := (z , p , q) ↦ (z , q , p). +``` ```agda module _ @@ -409,28 +415,29 @@ module _ ### The concatenation operations on computational identifications -There is both a strictly left unital concatenation operation and a strictly -right unital concatenation operation, while both are strictly associative. +There is both a judgmentally left unital and a judgmentally right unital +concatenation operation, while both are strictly associative. -The strict one-sided unitality follows in both cases from the strict right -unitality of the concatenation operation on the yoneda identifications following -the same computation as for the strictly involutive identity types. +The judgmental one-sided unitality follows in both cases from the strict right +unitality of the concatenation operation on the yoneda identifications, +following the same computation as for the strictly involutive identity types. For associativity on the other hand, we must use the strict associativity of the yoneda identity types. We will write out the explicit computation later. -**Observation.** Since they are strictly associative, the only instances where -they will not reduce is thus when the reflexivity appears all the way to the -right, or all the way to the left in a string of concatenations respectively. +**Observation.** Since the concatenation operations are strictly associative, +every string of concatenations containing reflexivities will reduce aside from +possibly when the reflexivity appears all the way to the right or left in the +string. -#### The strictly left unital concatenation operation +#### The judgmentally left unital concatenation operation -The strictly left unital concatenation operation is constructed the same way as -the strictly left unital concatenation operation for the strictly involutive -identity types +The judgmentally left unital concatenation operation is constructed the same way +as the judgmentally left unital concatenation operation for the strictly +involutive identity types ```text - (z , p , q) ∙ₗʲ (z' , p' , q') := (z' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) + (w , p , q) ∙ʲ (w' , p' , q') := (w' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) ``` ```agda @@ -438,17 +445,20 @@ module _ {l : Level} {A : UU l} where - infixl 15 _∙ₗʲ_ - _∙ₗʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z - (z , p , q) ∙ₗʲ (z' , p' , q') = (z' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) + infixl 15 _∙ʲ_ + _∙ʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z + (w , p , q) ∙ʲ (w' , p' , q') = (w' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) concat-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z - concat-computational-Id p z q = p ∙ₗʲ q + concat-computational-Id p z q = p ∙ʲ q concat-computational-Id' : (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z - concat-computational-Id' x q p = p ∙ₗʲ q + concat-computational-Id' x q p = p ∙ʲ q ``` +The judgmentally left unital concatenation operation corresponds to the standard +judgmentally left unital concatenation operation on identifications. + ```agda module _ {l : Level} {A : UU l} {x y z : A} @@ -457,12 +467,12 @@ module _ preserves-concat-computational-eq-eq : (p : x = y) (q : y = z) → computational-eq-eq (p ∙ q) = - computational-eq-eq p ∙ₗʲ computational-eq-eq q + computational-eq-eq p ∙ʲ computational-eq-eq q preserves-concat-computational-eq-eq refl q = refl preserves-concat-eq-computational-eq : (p : x =ʲ y) (q : y =ʲ z) → - eq-computational-eq (p ∙ₗʲ q) = + eq-computational-eq (p ∙ʲ q) = eq-computational-eq p ∙ eq-computational-eq q preserves-concat-eq-computational-eq (w , f , g) (w' , f' , g') = ( ap (f' x) left-unit-concatr) ∙ @@ -488,7 +498,7 @@ module _ ( ap (f' y) (inv left-unit-concatr))) ``` -#### The strictly right unital concatenation operation +#### The judgmentally right unital concatenation operation ```agda module _ @@ -506,6 +516,9 @@ module _ concatr-computational-Id' x q p = p ∙ᵣʲ q ``` +The judgmentally right unital concatenation operation corresponds to the +standard judgmentally right unital concatenation operation on identifications. + ```agda module _ {l : Level} {A : UU l} {x y z : A} @@ -535,22 +548,22 @@ module _ ### The groupoidal laws for the computational identity types -#### The groupoidal laws for the strictly left unital concatenation operation +#### The groupoidal laws for the judgmentally left unital concatenation operation -To see that `_∙ₗʲ_` is strictly associative, we unfold both `(P ∙ₗʲ Q) ∙ₗʲ R` -and `P ∙ₗʲ (Q ∙ₗʲ R)` and observe that it follows from the strict associativity -of `_∙ʸ_`: +To see that `_∙ʲ_` is strictly associative, we unfold both `(P ∙ʲ Q) ∙ʲ R` and +`P ∙ʲ (Q ∙ʲ R)` and observe that it follows from the strict associativity of +`_∙ʸ_`: ```text - (P ∙ₗʲ Q) ∙ₗʲ R - ≐ ((u , p , p') ∙ₗʲ (v , q , q')) ∙ₗʲ (w , r , r') - ≐ ((v , q , (q' ∙ʸ invʸ p) ∙ʸ p')) ∙ₗʲ (w , r , r') + (P ∙ʲ Q) ∙ʲ R + ≐ ((u , p , p') ∙ʲ (v , q , q')) ∙ʲ (w , r , r') + ≐ ((v , q , (q' ∙ʸ invʸ p) ∙ʸ p')) ∙ʲ (w , r , r') ≐ (w , r , (r' ∙ʸ invʸ q) ∙ʸ ((q' ∙ʸ invʸ p) ∙ʸ p')) ≐ (w , r , (((r' ∙ʸ invʸ q) ∙ʸ q') ∙ʸ invʸ p) ∙ʸ p') - ≐ (u , p , p') ∙ₗʲ ((w , r , (r' ∙ʸ invʸ q) ∙ʸ q')) - ≐ (u , p , p') ∙ₗʲ ((v , q , q') ∙ₗʲ (w , r , r')) - ≐ P ∙ₗʲ (Q ∙ₗʲ R). + ≐ (u , p , p') ∙ʲ ((w , r , (r' ∙ʸ invʸ q) ∙ʸ q')) + ≐ (u , p , p') ∙ʲ ((v , q , q') ∙ʲ (w , r , r')) + ≐ P ∙ʲ (Q ∙ʲ R). ``` ```agda @@ -560,7 +573,7 @@ module _ assoc-concat-computational-Id : (p : x =ʲ y) (q : y =ʲ z) (r : z =ʲ w) → - (p ∙ₗʲ q) ∙ₗʲ r = p ∙ₗʲ (q ∙ₗʲ r) + (p ∙ʲ q) ∙ʲ r = p ∙ʲ (q ∙ʲ r) assoc-concat-computational-Id p q r = refl module _ @@ -568,53 +581,53 @@ module _ where left-unit-concat-computational-Id : - {p : x =ʲ y} → refl-computational-Id ∙ₗʲ p = p + {p : x =ʲ y} → refl-computational-Id ∙ʲ p = p left-unit-concat-computational-Id = refl right-unit-concat-computational-Id : - {p : x =ʲ y} → p ∙ₗʲ refl-computational-Id = p + {p : x =ʲ y} → p ∙ʲ refl-computational-Id = p right-unit-concat-computational-Id {z , p , q} = ind-yoneda-Id - ( λ _ p → (z , p , q) ∙ₗʲ refl-computational-Id = (z , p , q)) + ( λ _ p → (z , p , q) ∙ʲ refl-computational-Id = (z , p , q)) ( refl) ( p) left-inv-concat-computational-Id : - (p : x =ʲ y) → inv-computational-Id p ∙ₗʲ p = refl-computational-Id + (p : x =ʲ y) → inv-computational-Id p ∙ʲ p = refl-computational-Id left-inv-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ p → - ( inv-computational-Id (z , p , q) ∙ₗʲ (z , p , q)) = + ( inv-computational-Id (z , p , q) ∙ʲ (z , p , q)) = ( refl-computational-Id)) ( eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-yoneda-Id q))) ( p) right-inv-concat-computational-Id : - (p : x =ʲ y) → p ∙ₗʲ inv-computational-Id p = refl-computational-Id + (p : x =ʲ y) → p ∙ʲ inv-computational-Id p = refl-computational-Id right-inv-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ q → - ( (z , p , q) ∙ₗʲ inv-computational-Id (z , p , q)) = + ( (z , p , q) ∙ʲ inv-computational-Id (z , p , q)) = ( refl-computational-Id)) ( eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-yoneda-Id p))) ( q) distributive-inv-concat-computational-Id : (p : x =ʲ y) {z : A} (q : y =ʲ z) → - inv-computational-Id (p ∙ₗʲ q) = - inv-computational-Id q ∙ₗʲ inv-computational-Id p + inv-computational-Id (p ∙ʲ q) = + inv-computational-Id q ∙ʲ inv-computational-Id p distributive-inv-concat-computational-Id p = ind-computational-Id ( λ _ q → - inv-computational-Id (p ∙ₗʲ q) = - inv-computational-Id q ∙ₗʲ inv-computational-Id p) + inv-computational-Id (p ∙ʲ q) = + inv-computational-Id q ∙ʲ inv-computational-Id p) ( ap inv-computational-Id (right-unit-concat-computational-Id)) ``` -#### The groupoidal laws for the strictly right unital concatenation operation +#### The groupoidal laws for the judgmentally right unital concatenation operation -Associativity follows from a similar computation as for the strictly left unital -concatenation operation. +Associativity follows from a similar computation as for the judgmentally left +unital concatenation operation. ```agda module _ @@ -638,7 +651,7 @@ module _ {p : x =ʲ y} → refl-computational-Id ∙ᵣʲ p = p left-unit-concatr-computational-Id {z , p , q} = ind-yoneda-Id - ( λ w q → refl-computational-Id ∙ᵣʲ (z , p , q) = (z , p , q)) + ( λ _ q → refl-computational-Id ∙ᵣʲ (z , p , q) = (z , p , q)) ( refl) ( q) diff --git a/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md b/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md index f9eec801b1..8c56fedb91 100644 --- a/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md @@ -43,7 +43,7 @@ where the second case may be preferred. Hence why we in this file consider the This definition is for instance used with the [strictly involutive identity types](foundation.strictly-involutive-identity-types.md) -to construct a strictly left unital concatenation operation. +to construct a judgmentally left unital concatenation operation. ## Definition diff --git a/src/foundation/strictly-involutive-identity-types.lagda.md b/src/foundation/strictly-involutive-identity-types.lagda.md index 83be5f6a80..935ddceeb7 100644 --- a/src/foundation/strictly-involutive-identity-types.lagda.md +++ b/src/foundation/strictly-involutive-identity-types.lagda.md @@ -291,20 +291,20 @@ other satisfies a strict right unit law. In both cases, we must use the [definitionally right unital concatenation operation on standard identifications](foundation.definitionally-right-unital-concatenation-identifications.md) `_∙ᵣ_`, to obtain this strict one-sided unit law. -The strictly left unital concatenation operation is defined by +The judgmentally left unital concatenation operation is defined by ```text (w , p , q) ∙ⁱ (w' , p' , q') := (w' , p' , (q' ∙ᵣ inv p) ∙ᵣ q), ``` -and the right unital concatenation operation is defined by +and the judgmentally right unital concatenation operation is defined by ```text (w , p , q) ∙ᵣⁱ (w' , p' , q') = (w , (p ∙ᵣ inv q') ∙ᵣ p' , q). ``` -The following computation verifies that the strictly left unital concatenation -operation is indeed strictly left unital: +The following computation verifies that the judgmentally left unital +concatenation operation is indeed judgmentally left unital: ```text reflⁱ ∙ⁱ r @@ -317,10 +317,10 @@ operation is indeed strictly left unital: ``` To be consistent with the convention for the standard identity types, we take -the strictly left unital concatenation operation to be the default concatenation -operation on strictly involutive identity types. +the judgmentally left unital concatenation operation to be the default +concatenation operation on strictly involutive identity types. -#### The strictly left unital concatenation operation +#### The judgmentally left unital concatenation operation ```agda module _ @@ -358,7 +358,7 @@ module _ ( assoc (inv q ∙ p) (inv q') p') ``` -#### The strictly right unital concatenation operation +#### The judgmentally right unital concatenation operation ```agda module _ @@ -402,7 +402,7 @@ The general proof-strategy is to induct on the necessary identifications to make the left endpoints judgmentally equal, and then proceed by reasoning with the groupoid-laws of the underlying identity types. -#### The groupoidal laws for the strictly left unital concatenation operation +#### The groupoidal laws for the judgmentally left unital concatenation operation ```agda module _ @@ -448,7 +448,7 @@ module _ eq-pair-eq-fiber (eq-pair (left-unit-concatr) (inv left-unit-concatr)) ``` -#### The groupoidal laws for the strictly right unital concatenation operation +#### The groupoidal laws for the judgmentally right unital concatenation operation ```agda module _ diff --git a/src/foundation/yoneda-identity-types.lagda.md b/src/foundation/yoneda-identity-types.lagda.md index b6cdfa382a..f11efe642d 100644 --- a/src/foundation/yoneda-identity-types.lagda.md +++ b/src/foundation/yoneda-identity-types.lagda.md @@ -526,6 +526,16 @@ module _ ### Concatenation of yoneda identifications +The concatenation operation on yoneda identifications is defined by function +composition + +```text + f ∙ʸ g := z p ↦ g z (f z p) +``` + +and is thus strictly associative and two-sided unital (since the reflexivities +are given by the identity functions). + ```agda module _ {l : Level} {A : UU l} From 92e35b5b31b12644f55550fc6ce5e1707254203d Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 19:16:23 +0100 Subject: [PATCH 34/39] fix link --- tables/identity-types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/identity-types.md b/tables/identity-types.md index 0e3fabac21..ae986240d9 100644 --- a/tables/identity-types.md +++ b/tables/identity-types.md @@ -10,7 +10,7 @@ | Commuting squares of identifications | [`foundation.commuting-squares-of-identifications`](foundation.commuting-squares-of-identifications.md) | | Commuting triangles of identifications | [`foundation.commuting-triangles-of-identifications`](foundation.commuting-triangles-of-identifications.md) | | The computational identity type | [`foundation.computational-identity-types`](foundation.computational-identity-types.md) | -| The strictly involutive identity type | [`foundation.strictly-involutive-identity-types`](foundation.strictly-identity-types.md) | +| The strictly involutive identity type | [`foundation.strictly-involutive-identity-types`](foundation.strictly-involutive-identity-types.md) | | The definitionally right unital concatenation operation on identifications | [`foundation.definitionally-right-unital-concatenation-identifications`](foundation.definitionally-right-unital-concatenation-identifications.md) | | Dependent identifications (foundation) | [`foundation.dependent-identifications`](foundation.dependent-identifications.md) | | Dependent identifications (foundation-core) | [`foundation-core.dependent-identifications`](foundation-core.dependent-identifications.md) | From f39c8a5cf634ec8626f75ee30d3d3062d60eb2e0 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 21:50:03 +0100 Subject: [PATCH 35/39] review --- MIXFIX-OPERATORS.md | 2 +- .../yoneda-lemma-categories.lagda.md | 2 +- .../yoneda-lemma-precategories.lagda.md | 2 +- src/foundation-core/identity-types.lagda.md | 22 +- src/foundation.lagda.md | 1 - .../computational-identity-types.lagda.md | 250 +++++++++--------- ...tal-concatenation-identifications.lagda.md | 178 ------------- ...trictly-involutive-identity-types.lagda.md | 196 ++++++++------ ...tal-concatenation-identifications.lagda.md | 178 +++++++++++++ .../transport-along-identifications.lagda.md | 2 +- src/foundation/yoneda-identity-types.lagda.md | 220 +++++++-------- .../cd-structures.lagda.md | 2 +- ...cocones-under-sequential-diagrams.lagda.md | 6 +- ...functoriality-sequential-colimits.lagda.md | 4 +- .../algebraic-theory-of-groups.lagda.md | 8 +- tables/identity-types.md | 70 ++--- 16 files changed, 598 insertions(+), 545 deletions(-) delete mode 100644 src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md create mode 100644 src/foundation/strictly-right-unital-concatenation-identifications.lagda.md diff --git a/MIXFIX-OPERATORS.md b/MIXFIX-OPERATORS.md index 799b3c1866..a953310e23 100644 --- a/MIXFIX-OPERATORS.md +++ b/MIXFIX-OPERATORS.md @@ -121,7 +121,7 @@ operators, so that expressions like `a - b + c` are parsed as `(a - b) + c`. Below, we outline a list of general rules when assigning associativities. -- **Definitionally associative operators**, e.g. +- **Strictly associative operators**, e.g. [function composition `_∘_`](foundation-core.function-types.md), can be assigned _any associativity_. diff --git a/src/category-theory/yoneda-lemma-categories.lagda.md b/src/category-theory/yoneda-lemma-categories.lagda.md index 5e3370d944..ed7f13492d 100644 --- a/src/category-theory/yoneda-lemma-categories.lagda.md +++ b/src/category-theory/yoneda-lemma-categories.lagda.md @@ -47,7 +47,7 @@ equivalence. ## Theorem -### The yoneda lemma into the large category of sets +### The Yoneda lemma into the large category of sets ```agda module _ diff --git a/src/category-theory/yoneda-lemma-precategories.lagda.md b/src/category-theory/yoneda-lemma-precategories.lagda.md index 9aca2e1347..92ca406c91 100644 --- a/src/category-theory/yoneda-lemma-precategories.lagda.md +++ b/src/category-theory/yoneda-lemma-precategories.lagda.md @@ -54,7 +54,7 @@ equivalence. ## Theorem -### The yoneda lemma into the large category of sets +### The Yoneda lemma into the large category of sets ```agda module _ diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index 5cd573e4ec..3e4962fd84 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -141,31 +141,26 @@ table given above. The {{#concept "concatenation operation on identifications" Agda=_∙_ Agda=_∙'_ Agda=concat}} -is a map +is a family of binary operations ```text _∙_ : x = y → y = z → x = z ``` -for all `x y z : A`. However, there are essentially three different ways we can -define concatenation of identifications, all with different computational +indexed by `x y z : A`. However, there are essentially three different ways we +can define concatenation of identifications, all with different computational behaviours. 1. We can define concatenation by induction on the equality `x = y`. This gives - us the computation rule `refl ∙ q = q`. + us the computation rule `refl ∙ q ≐ q`. 2. We can define concatenation by induction on the equality `y = z`. This gives - us the computation rule `p ∙ refl = p`. + us the computation rule `p ∙ refl ≐ p`. 3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only - gives us the computation rule `refl ∙ refl = refl`. + gives us the computation rule `refl ∙ refl ≐ refl`. While the third option may be preferred by some for its symmetry, for practical reasons, we use the first alternative by convention. -See also - -- [The definitionally right unital concatenation operation on indentifications](foundation.definitionally-right-unital-concatenation-identifications.md) -- [The yoneda identity types](foundation.yoneda-identity-types.md) - ```agda module _ {l : Level} {A : UU l} @@ -182,6 +177,11 @@ module _ concat' x q p = p ∙ q ``` +#### See also + +- [The strictly right unital concatenation operation on indentifications](foundation.strictly-right-unital-concatenation-identifications.md) +- [The Yoneda identity types](foundation.yoneda-identity-types.md) + ### Inverting identifications ```agda diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index db7b67805c..f662c26b5b 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -93,7 +93,6 @@ open import foundation.decidable-propositions public open import foundation.decidable-relations public open import foundation.decidable-subtypes public open import foundation.decidable-types public -open import foundation.definitionally-right-unital-concatenation-identifications public open import foundation.dependent-binary-homotopies public open import foundation.dependent-binomial-theorem public open import foundation.dependent-epimorphisms public diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index c9ec07a9b5..4d5bd4b851 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -9,10 +9,10 @@ module foundation.computational-identity-types where ```agda open import foundation.action-on-identifications-binary-functions open import foundation.action-on-identifications-functions -open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.function-extensionality +open import foundation.strictly-right-unital-concatenation-identifications open import foundation.transport-along-identifications open import foundation.univalence open import foundation.universal-property-identity-systems @@ -38,33 +38,36 @@ open import foundation-core.torsorial-type-families The standard definition of [identity types](foundation-core.identity-types.md) has the limitation that many of the basic operations only satisfy algebraic laws -_weakly_. In this file, we consider the -{{#concept "computational identity types" Agda=computational-Id}} `x =ʲ y`. -These are defined using the construction of the +_weakly_. On this page, we consider the +{{#concept "computational identity types" Agda=computational-Id}} `x =ʲ y`, +whose elements we call +{{#concept "computational identifications" Agda=computational-Id}}. These are +defined using the construction of the [strictly involutive identity types](foundation.strictly-involutive-identity-types.md): ```text (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) ``` -but using the [yoneda identity types](foundation.yoneda-identity-types.md) +but using the [Yoneda identity types](foundation.yoneda-identity-types.md) (`_=ʸ_`) as the underlying identity types: ```text (x =ʲ y) := Σ (z : A) ((z =ʸ y) × (z =ʸ x)) ``` -The yoneda identity types are defined as +The Yoneda identity types are defined as ```text (x =ʸ y) := (z : A) → (z = x) → (z = y). ``` -The yoneda identity types are equivalent to the standard identity types, but -have a strictly associative and unital concatenation operation. We can leverage -this and the judgmental properties of the construction of the strictly -involutive identity types to construct operations on the computational identity -types that satisfy the strict algebraic laws +The Yoneda identity types are [equivalent](foundation-core.equivalences.md) to +the standard identity types, but have a strictly associative and unital +concatenation operation. We can leverage this and the strictness properties of +the construction of the strictly involutive identity types to construct +operations on the computational identity types that satisfy the strict algebraic +laws - `(p ∙ʲ q) ∙ʲ r ≐ p ∙ʲ (q ∙ʲ r)` - `reflʲ ∙ʲ p ≐ p` or `p ∙ʲ reflʲ ≐ p` @@ -73,22 +76,22 @@ types that satisfy the strict algebraic laws While the last three equalities hold by the same computations as for the strictly involutive identity types using the fact that `inv reflʸ ≐ reflʸ`, -strict associativity relies on the strict associativity of the underlying yoneda +strict associativity relies on the strict associativity of the underlying Yoneda identity types. See the file about strictly involutive identity types for further details on these computations. -In addition to these strict algebraic laws, we can also define a recursion -principle for the computational identity types that computes judgmentally. +In addition to these strict algebraic laws, we also define a recursion principle +for the computational identity types that computes strictly. -**Note.** The computational identity types do _not_ satisfy the judgmental laws +**Note.** The computational identity types do _not_ satisfy the strict laws - `reflʲ ∙ʲ p ≐ p` and `p ∙ʲ reflʲ ≐ p` simultaneously, - `inv p ∙ʲ p ≐ reflʲ`, or - `p ∙ʲ inv p ≐ reflʲ`, -and they do not have a judgmental computation property for their induction -principle. This boils down to the fact that the yoneda identity types do not -have a judgmental computation property for their induction principle, which is +and they do not have a strict computation property for their induction +principle. This boils down to the fact that the Yoneda identity types do not +have a strict computation property for their induction principle, which is explained further there. ## Definition @@ -105,16 +108,17 @@ module _ _=ʲ_ : A → A → UU l (a =ʲ b) = computational-Id a b - refl-computational-Id : {x : A} → x =ʲ x - refl-computational-Id {x} = (x , refl-yoneda-Id , refl-yoneda-Id) + reflʲ : {x : A} → x =ʲ x + reflʲ {x} = (x , reflʸ , reflʸ) ``` ## Properties -### The computational identity types are equivalent to the yoneda identity types +### The computational identity types are equivalent to the Yoneda identity types Similarly to the strictly involutive identity types, this equivalence is a -strict retraction and preserves the reflexivities strictly. +strict [retraction](foundation-core.retractions.md) and preserves the +reflexivities strictly. ```agda module _ @@ -122,7 +126,7 @@ module _ where computational-eq-yoneda-eq : {x y : A} → x =ʸ y → x =ʲ y - computational-eq-yoneda-eq {x} f = (x , f , refl-yoneda-Id) + computational-eq-yoneda-eq {x} f = (x , f , reflʸ) yoneda-eq-computational-eq : {x y : A} → x =ʲ y → x =ʸ y yoneda-eq-computational-eq (z , p , q) = inv-yoneda-Id q ∙ʸ p @@ -172,6 +176,8 @@ module _ pr2 equiv-yoneda-eq-computational-eq = is-equiv-yoneda-eq-computational-eq ``` +This equivalence preserves the reflexivity elements strictly in both directions. + ```agda module _ {l : Level} {A : UU l} @@ -179,20 +185,20 @@ module _ preserves-refl-yoneda-eq-computational-eq : {x : A} → - yoneda-eq-computational-eq (refl-computational-Id {x = x}) = refl-yoneda-Id + yoneda-eq-computational-eq (reflʲ {x = x}) = reflʸ preserves-refl-yoneda-eq-computational-eq = refl preserves-refl-computational-eq-yoneda-eq : {x : A} → - computational-eq-yoneda-eq (refl-yoneda-Id {x = x}) = refl-computational-Id + computational-eq-yoneda-eq (reflʸ {x = x}) = reflʲ preserves-refl-computational-eq-yoneda-eq = refl ``` ### The computational identity types are equivalent to the standard identity types We define the equivalence as the composite `(x = y) ≃ (x =ʸ y) ≃ (x =ʲ y)`. -Since each of these equivalences preserves the groupoid structure so does the -composite. For the same reason, it preserves the reflexivities strictly. +Since each of these equivalences preserves the groupoid structure weakly so does +the composite. For the same reason, it preserves the reflexivities strictly. ```agda module _ @@ -215,7 +221,7 @@ module _ is-retraction-eq-computational-eq : {x y : A} → is-retraction computational-eq-eq (eq-computational-eq {x} {y}) - is-retraction-eq-computational-eq p = left-unit-concatr + is-retraction-eq-computational-eq p = left-unit-right-strict-concat is-section-eq-computational-eq : {x y : A} → @@ -236,7 +242,7 @@ module _ is-equiv-eq-computational-eq = is-equiv-map-equiv equiv-eq-computational-eq ``` -The reflexivity elements are preserved judgmentally. +This equivalence preserves the reflexivity elements strictly in both directions. ```agda module _ @@ -244,11 +250,11 @@ module _ where preserves-refl-computational-eq-eq : - {x : A} → computational-eq-eq (refl {x = x}) = refl-computational-Id + {x : A} → computational-eq-eq (refl {x = x}) = reflʲ preserves-refl-computational-eq-eq = refl preserves-refl-eq-computational-eq : - {x : A} → eq-computational-eq (refl-computational-Id {x = x}) = refl + {x : A} → eq-computational-eq (reflʲ {x = x}) = refl preserves-refl-eq-computational-eq = refl ``` @@ -277,10 +283,10 @@ module _ dependent-universal-property-identity-system-computational-Id : dependent-universal-property-identity-system ( computational-Id x) - ( refl-computational-Id) + ( reflʲ) dependent-universal-property-identity-system-computational-Id = dependent-universal-property-identity-system-is-torsorial - ( refl-computational-Id) + ( reflʲ) ( is-torsorial-computational-Id) ``` @@ -299,7 +305,7 @@ module _ where ind-computational-Id : - (b : B x refl-computational-Id) {y : A} (p : x =ʲ y) → B y p + (b : B x reflʲ) {y : A} (p : x =ʲ y) → B y p ind-computational-Id b {y} = map-inv-is-equiv ( dependent-universal-property-identity-system-computational-Id B) @@ -307,24 +313,23 @@ module _ ( y) compute-ind-computational-Id : - (b : B x refl-computational-Id) → - ind-computational-Id b refl-computational-Id = b + (b : B x reflʲ) → ind-computational-Id b reflʲ = b compute-ind-computational-Id = is-section-map-inv-is-equiv ( dependent-universal-property-identity-system-computational-Id B) uniqueness-ind-computational-Id : (b : (y : A) (p : x =ʲ y) → B y p) → - (λ y → ind-computational-Id (b x refl-computational-Id) {y}) = b + (λ y → ind-computational-Id (b x reflʲ) {y}) = b uniqueness-ind-computational-Id = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-computational-Id B) ``` -Using the fact that the recusion principles of both the yoneda identity types -and the strictly involutive identity types can be defined to compute -judgmentally, we obtain a judgmentally computing recursion principle for the -computational identity types as well. +Using the fact that the recusion principles of both the Yoneda identity types +and the strictly involutive identity types can be defined to compute strictly, +we obtain a strictly computing recursion principle for the computational +identity types as well. ```agda module _ @@ -337,17 +342,17 @@ module _ rec-computational-Id b p = rec-yoneda-Id b (yoneda-eq-computational-eq p) compute-rec-computational-Id : - (b : B x) → rec-computational-Id b refl-computational-Id = b + (b : B x) → rec-computational-Id b reflʲ = b compute-rec-computational-Id b = refl uniqueness-rec-computational-Id : (b : (y : A) → x =ʲ y → B y) → - (λ y → rec-computational-Id (b x refl-computational-Id) {y}) = b + (λ y → rec-computational-Id (b x reflʲ) {y}) = b uniqueness-rec-computational-Id b = ( inv ( uniqueness-ind-computational-Id ( λ y _ → B y) - ( λ y → rec-computational-Id (b x refl-computational-Id)))) ∙ + ( λ y → rec-computational-Id (b x reflʲ)))) ∙ ( uniqueness-ind-computational-Id (λ y _ → B y) b) ``` @@ -364,8 +369,8 @@ structure satisfies the following algebraic laws strictly ### Inverting computational identifications The construction and computations are the same as for the strictly involutive -identity types. The inversion operation is defined by swapping the positions of -the two yoneda identifications +identity types. Thus, the inversion operation is defined by swapping the +positions of the two Yoneda identifications ```text invʲ := (z , p , q) ↦ (z , q , p). @@ -381,8 +386,8 @@ module _ compute-inv-computational-Id-refl : {x : A} → - inv-computational-Id (refl-computational-Id {x = x}) = - refl-computational-Id + inv-computational-Id (reflʲ {x = x}) = + reflʲ compute-inv-computational-Id-refl = refl inv-inv-computational-Id : @@ -408,33 +413,33 @@ module _ (p : x =ʲ y) → eq-computational-eq (inv-computational-Id p) = inv (eq-computational-eq p) preserves-inv-eq-computational-eq (z , f , g) = - ( ap (g y) (left-unit-concatr)) ∙ + ( ap (g y) (left-unit-right-strict-concat)) ∙ ( distributive-inv-Id-yoneda-Id g f) ∙ - ( ap (λ r → inv (f x r)) (inv left-unit-concatr)) + ( ap (λ r → inv (f x r)) (inv left-unit-right-strict-concat)) ``` ### The concatenation operations on computational identifications -There is both a judgmentally left unital and a judgmentally right unital -concatenation operation, while both are strictly associative. +There is both a strictly left unital and a strictly right unital concatenation +operation, while both are strictly associative. -The judgmental one-sided unitality follows in both cases from the strict right -unitality of the concatenation operation on the yoneda identifications, +The strict one-sided unitality follows in both cases from the strict right +unitality of the concatenation operation on the Yoneda identifications, following the same computation as for the strictly involutive identity types. For associativity on the other hand, we must use the strict associativity of the -yoneda identity types. We will write out the explicit computation later. +Yoneda identity types. We will write out the explicit computation later. **Observation.** Since the concatenation operations are strictly associative, every string of concatenations containing reflexivities will reduce aside from possibly when the reflexivity appears all the way to the right or left in the string. -#### The judgmentally left unital concatenation operation +#### The strictly left unital concatenation operation -The judgmentally left unital concatenation operation is constructed the same way -as the judgmentally left unital concatenation operation for the strictly -involutive identity types +The strictly left unital concatenation operation is constructed the same way as +the strictly left unital concatenation operation for the strictly involutive +identity types ```text (w , p , q) ∙ʲ (w' , p' , q') := (w' , p' , q' ∙ʸ inv-yoneda-Id p ∙ʸ q) @@ -456,8 +461,8 @@ module _ concat-computational-Id' x q p = p ∙ʲ q ``` -The judgmentally left unital concatenation operation corresponds to the standard -judgmentally left unital concatenation operation on identifications. +The strictly left unital concatenation operation corresponds to the standard +strictly left unital concatenation operation on identifications. ```agda module _ @@ -475,7 +480,7 @@ module _ eq-computational-eq (p ∙ʲ q) = eq-computational-eq p ∙ eq-computational-eq q preserves-concat-eq-computational-eq (w , f , g) (w' , f' , g') = - ( ap (f' x) left-unit-concatr) ∙ + ( ap (f' x) left-unit-right-strict-concat) ∙ ( ap ( f' x) ( ( ap @@ -484,21 +489,25 @@ module _ ( g) ( g' w' refl) ( inv (f w refl)))) ∙ - ( ( distributive-inv-concatr (g' w' refl) (g y (inv (f w refl)))) ∙ + ( ( distributive-inv-right-strict-concat + ( g' w' refl) + ( g y (inv (f w refl)))) ∙ ( ( ap ( _∙ᵣ inv (g' w' refl)) ( inv-distributive-inv-Id-yoneda-Id f g)) ∙ - ( eq-concat-concatr (f x (inv (g w refl))) (inv (g' w' refl)))))) ∙ + ( eq-concat-right-strict-concat + ( f x (inv (g w refl))) + ( inv (g' w' refl)))))) ∙ ( commutative-preconcat-Id-yoneda-Id f' ( f x (inv (g w refl))) ( inv (g' w' refl)))) ∙ ( ap-binary ( _∙_) - ( ap (f x) (inv left-unit-concatr)) - ( ap (f' y) (inv left-unit-concatr))) + ( ap (f x) (inv left-unit-right-strict-concat)) + ( ap (f' y) (inv left-unit-right-strict-concat))) ``` -#### The judgmentally right unital concatenation operation +#### The strictly right unital concatenation operation ```agda module _ @@ -509,46 +518,50 @@ module _ _∙ᵣʲ_ : {x y z : A} → x =ʲ y → y =ʲ z → x =ʲ z (w , p , q) ∙ᵣʲ (w' , p' , q') = (w , p ∙ʸ inv-yoneda-Id q' ∙ʸ p' , q) - concatr-computational-Id : {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z - concatr-computational-Id p z q = p ∙ᵣʲ q + right-strict-concat-computational-Id : + {x y : A} → x =ʲ y → (z : A) → y =ʲ z → x =ʲ z + right-strict-concat-computational-Id p z q = p ∙ᵣʲ q - concatr-computational-Id' : (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z - concatr-computational-Id' x q p = p ∙ᵣʲ q + right-strict-concat-computational-Id' : + (x : A) {y z : A} → y =ʲ z → x =ʲ y → x =ʲ z + right-strict-concat-computational-Id' x q p = p ∙ᵣʲ q ``` -The judgmentally right unital concatenation operation corresponds to the -standard judgmentally right unital concatenation operation on identifications. +The strictly right unital concatenation operation corresponds to the standard +strictly right unital concatenation operation on identifications. ```agda module _ {l : Level} {A : UU l} {x y z : A} where - preserves-concatr-computational-eq-eq : + preserves-right-strict-concat-computational-eq-eq : (p : x = y) (q : y = z) → computational-eq-eq (p ∙ᵣ q) = computational-eq-eq p ∙ᵣʲ computational-eq-eq q - preserves-concatr-computational-eq-eq p refl = refl + preserves-right-strict-concat-computational-eq-eq p refl = refl - preserves-concatr-eq-computational-eq : + preserves-right-strict-concat-eq-computational-eq : (p : x =ʲ y) (q : y =ʲ z) → eq-computational-eq (p ∙ᵣʲ q) = eq-computational-eq p ∙ᵣ eq-computational-eq q - preserves-concatr-eq-computational-eq (w , f , g) (w' , f' , g') = - ( ap (λ r → f' x (f x r ∙ᵣ inv (g' w' refl))) left-unit-concatr) ∙ + preserves-right-strict-concat-eq-computational-eq (w , f , g) (w' , f' , g') = + ( ap + ( λ r → f' x (f x r ∙ᵣ inv (g' w' refl))) + ( left-unit-right-strict-concat)) ∙ ( commutative-preconcatr-Id-yoneda-Id ( f') ( f x (inv (g w refl))) ( inv (g' w' refl))) ∙ ( ap-binary ( _∙ᵣ_) - ( ap (f x) (inv left-unit-concatr)) - ( ap (f' y) (inv left-unit-concatr))) + ( ap (f x) (inv left-unit-right-strict-concat)) + ( ap (f' y) (inv left-unit-right-strict-concat))) ``` ### The groupoidal laws for the computational identity types -#### The groupoidal laws for the judgmentally left unital concatenation operation +#### The groupoidal laws for the strictly left unital concatenation operation To see that `_∙ʲ_` is strictly associative, we unfold both `(P ∙ʲ Q) ∙ʲ R` and `P ∙ʲ (Q ∙ʲ R)` and observe that it follows from the strict associativity of @@ -581,34 +594,34 @@ module _ where left-unit-concat-computational-Id : - {p : x =ʲ y} → refl-computational-Id ∙ʲ p = p + {p : x =ʲ y} → reflʲ ∙ʲ p = p left-unit-concat-computational-Id = refl right-unit-concat-computational-Id : - {p : x =ʲ y} → p ∙ʲ refl-computational-Id = p + {p : x =ʲ y} → p ∙ʲ reflʲ = p right-unit-concat-computational-Id {z , p , q} = ind-yoneda-Id - ( λ _ p → (z , p , q) ∙ʲ refl-computational-Id = (z , p , q)) + ( λ _ p → (z , p , q) ∙ʲ reflʲ = (z , p , q)) ( refl) ( p) left-inv-concat-computational-Id : - (p : x =ʲ y) → inv-computational-Id p ∙ʲ p = refl-computational-Id + (p : x =ʲ y) → inv-computational-Id p ∙ʲ p = reflʲ left-inv-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ p → ( inv-computational-Id (z , p , q) ∙ʲ (z , p , q)) = - ( refl-computational-Id)) + ( reflʲ)) ( eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-yoneda-Id q))) ( p) right-inv-concat-computational-Id : - (p : x =ʲ y) → p ∙ʲ inv-computational-Id p = refl-computational-Id + (p : x =ʲ y) → p ∙ʲ inv-computational-Id p = reflʲ right-inv-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ q → ( (z , p , q) ∙ʲ inv-computational-Id (z , p , q)) = - ( refl-computational-Id)) + ( reflʲ)) ( eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-yoneda-Id p))) ( q) @@ -624,54 +637,55 @@ module _ ( ap inv-computational-Id (right-unit-concat-computational-Id)) ``` -#### The groupoidal laws for the judgmentally right unital concatenation operation +#### The groupoidal laws for the strictly right unital concatenation operation -Associativity follows from a similar computation as for the judgmentally left -unital concatenation operation. +Associativity for the strictly right unital concatenation operation follows from +a similar computation to the one for the strictly left unital concatenation +operation. ```agda module _ {l : Level} {A : UU l} where - assoc-concatr-computational-Id : + assoc-right-strict-concat-computational-Id : {x y z w : A} (p : x =ʲ y) (q : y =ʲ z) (r : z =ʲ w) → (p ∙ᵣʲ q) ∙ᵣʲ r = p ∙ᵣʲ (q ∙ᵣʲ r) - assoc-concatr-computational-Id p q r = refl + assoc-right-strict-concat-computational-Id p q r = refl module _ {l : Level} {A : UU l} {x y : A} where - right-unit-concatr-computational-Id : - {p : x =ʲ y} → p ∙ᵣʲ refl-computational-Id = p - right-unit-concatr-computational-Id = refl + right-unit-right-strict-concat-computational-Id : + {p : x =ʲ y} → p ∙ᵣʲ reflʲ = p + right-unit-right-strict-concat-computational-Id = refl - left-unit-concatr-computational-Id : - {p : x =ʲ y} → refl-computational-Id ∙ᵣʲ p = p - left-unit-concatr-computational-Id {z , p , q} = + left-unit-right-strict-concat-computational-Id : + {p : x =ʲ y} → reflʲ ∙ᵣʲ p = p + left-unit-right-strict-concat-computational-Id {z , p , q} = ind-yoneda-Id - ( λ _ q → refl-computational-Id ∙ᵣʲ (z , p , q) = (z , p , q)) + ( λ _ q → reflʲ ∙ᵣʲ (z , p , q) = (z , p , q)) ( refl) ( q) - left-inv-concatr-computational-Id : - (p : x =ʲ y) → inv-computational-Id p ∙ᵣʲ p = refl-computational-Id - left-inv-concatr-computational-Id (z , p , q) = + left-inv-right-strict-concat-computational-Id : + (p : x =ʲ y) → inv-computational-Id p ∙ᵣʲ p = reflʲ + left-inv-right-strict-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ p → ( inv-computational-Id (z , p , q) ∙ᵣʲ (z , p , q)) = - ( refl-computational-Id)) + ( reflʲ)) ( eq-pair-eq-fiber (eq-pair (right-inv-yoneda-Id q) refl)) ( p) - right-inv-concatr-computational-Id : - (p : x =ʲ y) → p ∙ᵣʲ inv-computational-Id p = refl-computational-Id - right-inv-concatr-computational-Id (z , p , q) = + right-inv-right-strict-concat-computational-Id : + (p : x =ʲ y) → p ∙ᵣʲ inv-computational-Id p = reflʲ + right-inv-right-strict-concat-computational-Id (z , p , q) = ind-yoneda-Id ( λ _ q → ( (z , p , q) ∙ᵣʲ inv-computational-Id (z , p , q)) = - ( refl-computational-Id)) + ( reflʲ)) ( eq-pair-eq-fiber (eq-pair (right-inv-yoneda-Id p) refl)) ( q) @@ -679,16 +693,16 @@ module _ {l : Level} {A : UU l} {x y : A} where - distributive-inv-concatr-computational-Id : + distributive-inv-right-strict-concat-computational-Id : (p : x =ʲ y) {z : A} (q : y =ʲ z) → inv-computational-Id (p ∙ᵣʲ q) = inv-computational-Id q ∙ᵣʲ inv-computational-Id p - distributive-inv-concatr-computational-Id p = + distributive-inv-right-strict-concat-computational-Id p = ind-computational-Id ( λ _ q → inv-computational-Id (p ∙ᵣʲ q) = inv-computational-Id q ∙ᵣʲ inv-computational-Id p) - ( inv left-unit-concatr-computational-Id) + ( inv left-unit-right-strict-concat-computational-Id) ``` ## Operations @@ -707,10 +721,10 @@ module _ ap-computational-Id = computational-eq-yoneda-eq ∘ ap-yoneda-Id f ∘ yoneda-eq-computational-eq - compute-ap-refl-computational-Id : + compute-ap-reflʲ : {x : A} → - ap-computational-Id (refl-computational-Id {x = x}) = refl-computational-Id - compute-ap-refl-computational-Id = refl + ap-computational-Id (reflʲ {x = x}) = reflʲ + compute-ap-reflʲ = refl module _ {l1 : Level} {A : UU l1} @@ -735,9 +749,9 @@ module _ tr-computational-Id : {x y : A} → x =ʲ y → B x → B y tr-computational-Id = tr B ∘ eq-computational-eq - compute-tr-refl-computational-Id : - {x : A} → tr-computational-Id (refl-computational-Id {x = x}) = id - compute-tr-refl-computational-Id = refl + compute-tr-reflʲ : + {x : A} → tr-computational-Id (reflʲ {x = x}) = id + compute-tr-reflʲ = refl ``` ### Function extensionality with respect to computational identifications @@ -797,4 +811,4 @@ module _ ## See also - [The strictly involutive identity types](foundation.strictly-involutive-identity-types.md) -- [The yoneda identity types](foundation.yoneda-identity-types.md) +- [The Yoneda identity types](foundation.yoneda-identity-types.md) diff --git a/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md b/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md deleted file mode 100644 index 8c56fedb91..0000000000 --- a/src/foundation/definitionally-right-unital-concatenation-identifications.lagda.md +++ /dev/null @@ -1,178 +0,0 @@ -# The definitionally right unital concatenation operation on identifications - -```agda -module foundation.definitionally-right-unital-concatenation-identifications where -``` - -
Imports - -```agda -open import foundation.action-on-identifications-functions -open import foundation.universe-levels - -open import foundation-core.identity-types -``` - -
- -## Idea - -The -{{#concept "concatenation operation on identifications" Agda=_∙_ Agda=_∙'_ Agda=concat}} -is a map - -```text - _∙_ : x = y → y = z → x = z -``` - -for all `x y z : A`. However, there are essentially three different ways we can -define concatenation of identifications, all with different computational -behaviours: - -1. We can define concatenation by induction on the equality `x = y`. This gives - us the computation rule `refl ∙ q = q`. -2. We can define concatenation by induction on the equality `y = z`. This gives - us the computation rule `p ∙ refl = p`. -3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only - gives us the computation rule `refl ∙ refl = refl`. - -While the third option may be preferred by some for its symmetry, for practical -reasons, we use the first alternative by convention. However, there are cases -where the second case may be preferred. Hence why we in this file consider the -{{#concept "definitionally right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=concatr Agda=concatr'}}. - -This definition is for instance used with the -[strictly involutive identity types](foundation.strictly-involutive-identity-types.md) -to construct a judgmentally left unital concatenation operation. - -## Definition - -```agda -module _ - {l : Level} {A : UU l} - where - - infixl 15 _∙ᵣ_ - _∙ᵣ_ : {x y z : A} → x = y → y = z → x = z - p ∙ᵣ refl = p - - concatr : {x y : A} → x = y → (z : A) → y = z → x = z - concatr p z q = p ∙ᵣ q - - concatr' : (x : A) {y z : A} → y = z → x = y → x = z - concatr' x q p = p ∙ᵣ q -``` - -### Translating between the left and right unital versions of concatenation - -```agda -module _ - {l : Level} {A : UU l} - where - - eq-concatr-concat : - {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q - eq-concatr-concat p refl = right-unit - - eq-concat-concatr : - {x y z : A} (p : x = y) (q : y = z) → p ∙ᵣ q = p ∙ q - eq-concat-concatr p q = inv (eq-concatr-concat p q) - - eq-double-concatr-concat-left-associated : - {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → - p ∙ q ∙ r = p ∙ᵣ q ∙ᵣ r - eq-double-concatr-concat-left-associated p q r = - ap (_∙ r) (eq-concatr-concat p q) ∙ eq-concatr-concat (p ∙ᵣ q) r - - eq-double-concatr-concat-right-associated : - {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → - p ∙ (q ∙ r) = p ∙ᵣ (q ∙ᵣ r) - eq-double-concatr-concat-right-associated p q r = - ap (p ∙_) (eq-concatr-concat q r) ∙ eq-concatr-concat p (q ∙ᵣ r) - - eq-double-concat-concatr-left-associated : - {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → - p ∙ᵣ q ∙ᵣ r = p ∙ q ∙ r - eq-double-concat-concatr-left-associated p q r = - ap (_∙ᵣ r) (eq-concat-concatr p q) ∙ eq-concat-concatr (p ∙ q) r - - eq-double-concat-concatr-right-associated : - {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → - p ∙ᵣ (q ∙ᵣ r) = p ∙ (q ∙ r) - eq-double-concat-concatr-right-associated p q r = - ap (p ∙ᵣ_) (eq-concat-concatr q r) ∙ eq-concat-concatr p (q ∙ r) -``` - -## Properties - -### The groupoidal laws - -```agda -module _ - {l : Level} {A : UU l} - where - - assoc-concatr : - {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → - ((p ∙ᵣ q) ∙ᵣ r) = (p ∙ᵣ (q ∙ᵣ r)) - assoc-concatr p q refl = refl - - left-unit-concatr : {x y : A} {p : x = y} → refl ∙ᵣ p = p - left-unit-concatr {p = refl} = refl - - right-unit-concatr : {x y : A} {p : x = y} → p ∙ᵣ refl = p - right-unit-concatr = refl - - left-inv-concatr : {x y : A} (p : x = y) → inv p ∙ᵣ p = refl - left-inv-concatr refl = refl - - right-inv-concatr : {x y : A} (p : x = y) → p ∙ᵣ (inv p) = refl - right-inv-concatr refl = refl - - inv-inv-concatr : {x y : A} (p : x = y) → inv (inv p) = p - inv-inv-concatr refl = refl - - distributive-inv-concatr : - {x y : A} (p : x = y) {z : A} (q : y = z) → - inv (p ∙ᵣ q) = inv q ∙ᵣ inv p - distributive-inv-concatr refl refl = refl -``` - -### Transposing inverses - -```agda -module _ - {l : Level} {A : UU l} - where - - left-transpose-eq-concatr : - {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → - p ∙ᵣ q = r → q = inv p ∙ᵣ r - left-transpose-eq-concatr refl q r s = - (inv left-unit-concatr ∙ s) ∙ inv left-unit-concatr - - right-transpose-eq-concatr : - {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → - p ∙ᵣ q = r → p = r ∙ᵣ inv q - right-transpose-eq-concatr p refl r s = s -``` - -### Concatenation is injective - -```agda -module _ - {l1 : Level} {A : UU l1} - where - - is-injective-concatr : - {x y z : A} (p : x = y) {q r : y = z} → p ∙ᵣ q = p ∙ᵣ r → q = r - is-injective-concatr refl s = (inv left-unit-concatr ∙ s) ∙ left-unit-concatr - - is-injective-concatr' : - {x y z : A} (r : y = z) {p q : x = y} → p ∙ᵣ r = q ∙ᵣ r → p = q - is-injective-concatr' refl s = s -``` - -## See also - -- [Yoneda identity types](foundation.yoneda-identity-types.md) diff --git a/src/foundation/strictly-involutive-identity-types.lagda.md b/src/foundation/strictly-involutive-identity-types.lagda.md index 935ddceeb7..e199ef7541 100644 --- a/src/foundation/strictly-involutive-identity-types.lagda.md +++ b/src/foundation/strictly-involutive-identity-types.lagda.md @@ -8,10 +8,10 @@ module foundation.strictly-involutive-identity-types where ```agda open import foundation.action-on-identifications-functions -open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.equality-cartesian-product-types open import foundation.multivariable-homotopies +open import foundation.strictly-right-unital-concatenation-identifications open import foundation.universal-property-identity-systems open import foundation.universe-levels @@ -32,7 +32,7 @@ open import foundation-core.torsorial-type-families The standard definition of [identity types](foundation-core.identity-types.md) has the limitation that many of the basic operations only satisfy algebraic laws -_weakly_. In this file, we consider the +_weakly_. On this page, we consider the {{#concept "strictly involutive identity types" Agda=involutive-Id}} ```text @@ -40,7 +40,7 @@ _weakly_. In this file, we consider the ``` This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the judgmental laws +standard identity types, but satisfies the strict laws - `inv (inv p) ≐ p` - `inv reflⁱ ≐ reflⁱ` @@ -48,13 +48,15 @@ standard identity types, but satisfies the judgmental laws where we use a superscript `i` to distinguish the strictly involutive identity type from the standard identity type. -In addition, we maintain the following judgmental laws +In addition, we maintain the following strict laws - `inv reflⁱ ≐ reflⁱ` - `ind-Id f reflⁱ ≐ f reflⁱ` - `reflⁱ ∙ p ≐ p` or `p ∙ reflⁱ ≐ p` -among other more specific ones considered in this file. +among other more specific laws considered on this page. We call elements of the +strictly involutive identity type for +{{#concept "strictly involutive identifications" Agda=involutive-Id}}. ## Definition @@ -70,8 +72,8 @@ module _ _=ⁱ_ : A → A → UU l (a =ⁱ b) = involutive-Id a b - refl-involutive-Id : {x : A} → x =ⁱ x - refl-involutive-Id {x} = (x , refl , refl) + reflⁱ : {x : A} → x =ⁱ x + reflⁱ {x} = (x , refl , refl) ``` ## Properties @@ -93,7 +95,7 @@ and from right to left by the concatenation This equivalence preserves the groupoid structure on the strictly involutive identity types as we will see later. Moreover, the composition -`eq-involutive-eq ∘ involutive-eq-eq` computes judgmentally to the identity: +`eq-involutive-eq ∘ involutive-eq-eq` computes strictly to the identity: ```text eq-involutive-eq ∘ involutive-eq-eq @@ -158,11 +160,11 @@ module _ where preserves-refl-involutive-eq-eq : - {x : A} → involutive-eq-eq (refl {x = x}) = refl-involutive-Id + {x : A} → involutive-eq-eq (refl {x = x}) = reflⁱ preserves-refl-involutive-eq-eq = refl preserves-refl-eq-involutive-eq : - {x : A} → eq-involutive-eq (refl-involutive-Id {x = x}) = refl + {x : A} → eq-involutive-eq (reflⁱ {x = x}) = refl preserves-refl-eq-involutive-eq = refl ``` @@ -191,10 +193,10 @@ module _ dependent-universal-property-identity-system-involutive-Id : dependent-universal-property-identity-system ( involutive-Id x) - ( refl-involutive-Id) + ( reflⁱ) dependent-universal-property-identity-system-involutive-Id = dependent-universal-property-identity-system-is-torsorial - ( refl-involutive-Id) + ( reflⁱ) ( is-torsorial-involutive-Id) ``` @@ -205,7 +207,7 @@ identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, `B : (y : A) (p : x =ⁱ y) → UU l2`, then to construct a dependent function `f : (y : A) (p : x =ⁱ y) → B y p` it suffices to define it at `f x reflⁱ`. The strictly involutive identity types -also satisfy the corresponding computation rule judgmentally. +also satisfy the corresponding computation rule strictly. ```agda module _ @@ -214,16 +216,16 @@ module _ where ind-involutive-Id : - B x refl-involutive-Id → (y : A) (p : x =ⁱ y) → B y p + B x reflⁱ → (y : A) (p : x =ⁱ y) → B y p ind-involutive-Id b .x (.x , refl , refl) = b compute-ind-involutive-Id : - (b : B x refl-involutive-Id) → ind-involutive-Id b x refl-involutive-Id = b + (b : B x reflⁱ) → ind-involutive-Id b x reflⁱ = b compute-ind-involutive-Id b = refl uniqueness-ind-involutive-Id : (f : (y : A) (p : x =ⁱ y) → B y p) → - ind-involutive-Id (f x refl-involutive-Id) = f + ind-involutive-Id (f x reflⁱ) = f uniqueness-ind-involutive-Id f = eq-multivariable-htpy 2 (λ where .x (.x , refl , refl) → refl) ``` @@ -234,13 +236,13 @@ uniqueness of the induction principle up to _equality_. ## Structure -The strictly involutive identity types form a judgmentally involutive weak +The strictly involutive identity types form a strictly involutive weak groupoidal structure on types. ### Inverting strictly involutive identifications We have an inversion operation on `involutive-Id` defined by swapping the -position of the identifications. This operation satisfies the judgmental laws +position of the identifications. This operation satisfies the strict laws - `inv (inv p) ≐ p`, and - `inv reflⁱ ≐ reflⁱ`. @@ -255,7 +257,7 @@ module _ compute-inv-involutive-Id-refl : {x : A} → - inv-involutive-Id (refl-involutive-Id {x = x}) = refl-involutive-Id + inv-involutive-Id (reflⁱ {x = x}) = reflⁱ compute-inv-involutive-Id-refl = refl inv-inv-involutive-Id : @@ -288,23 +290,23 @@ module _ We have, practically speaking, two definitions of the concatenation operation on strictly involutive identity types. One satisfies a strict left unit law and the other satisfies a strict right unit law. In both cases, we must use the -[definitionally right unital concatenation operation on standard identifications](foundation.definitionally-right-unital-concatenation-identifications.md) +[strictly right unital concatenation operation on standard identifications](foundation.strictly-right-unital-concatenation-identifications.md) `_∙ᵣ_`, to obtain this strict one-sided unit law. -The judgmentally left unital concatenation operation is defined by +The strictly left unital concatenation operation is defined by ```text (w , p , q) ∙ⁱ (w' , p' , q') := (w' , p' , (q' ∙ᵣ inv p) ∙ᵣ q), ``` -and the judgmentally right unital concatenation operation is defined by +and the strictly right unital concatenation operation is defined by ```text (w , p , q) ∙ᵣⁱ (w' , p' , q') = (w , (p ∙ᵣ inv q') ∙ᵣ p' , q). ``` -The following computation verifies that the judgmentally left unital -concatenation operation is indeed judgmentally left unital: +The following computation verifies that the strictly left unital concatenation +operation is indeed strictly left unital: ```text reflⁱ ∙ⁱ r @@ -317,10 +319,10 @@ concatenation operation is indeed judgmentally left unital: ``` To be consistent with the convention for the standard identity types, we take -the judgmentally left unital concatenation operation to be the default -concatenation operation on strictly involutive identity types. +the strictly left unital concatenation operation to be the default concatenation +operation on strictly involutive identity types. -#### The judgmentally left unital concatenation operation +#### The strictly left unital concatenation operation ```agda module _ @@ -348,17 +350,20 @@ module _ preserves-concat-eq-involutive-eq (w , p , q) (w' , p' , q') = ( ap ( _∙ p') - ( ( distributive-inv-concatr (q' ∙ᵣ inv p) q) ∙ + ( ( distributive-inv-right-strict-concat (q' ∙ᵣ inv p) q) ∙ ( ( ap ( inv q ∙ᵣ_) - ( ( distributive-inv-concatr q' (inv p)) ∙ + ( ( distributive-inv-right-strict-concat q' (inv p)) ∙ ( ap (_∙ᵣ inv q') (inv-inv p)))) ∙ - ( inv (assoc-concatr (inv q) p (inv q'))) ∙ - ( eq-double-concat-concatr-left-associated (inv q) p (inv q'))))) ∙ + ( inv (assoc-right-strict-concat (inv q) p (inv q'))) ∙ + ( eq-double-concat-right-strict-concat-left-associated + ( inv q) + ( p) + ( inv q'))))) ∙ ( assoc (inv q ∙ p) (inv q') p') ``` -#### The judgmentally right unital concatenation operation +#### The strictly right unital concatenation operation ```agda module _ @@ -369,40 +374,46 @@ module _ _∙ᵣⁱ_ : {x y z : A} → x =ⁱ y → y =ⁱ z → x =ⁱ z (w , p , q) ∙ᵣⁱ (w' , p' , q') = (w , (p ∙ᵣ inv q') ∙ᵣ p' , q) - concatr-involutive-Id : {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z - concatr-involutive-Id p z q = p ∙ᵣⁱ q + right-strict-concat-involutive-Id : + {x y : A} → x =ⁱ y → (z : A) → y =ⁱ z → x =ⁱ z + right-strict-concat-involutive-Id p z q = p ∙ᵣⁱ q - concatr-involutive-Id' : (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z - concatr-involutive-Id' x q p = p ∙ᵣⁱ q + right-strict-concat-involutive-Id' : + (x : A) {y z : A} → y =ⁱ z → x =ⁱ y → x =ⁱ z + right-strict-concat-involutive-Id' x q p = p ∙ᵣⁱ q - eq-concat-concatr-involutive-Id : + eq-concat-right-strict-concat-involutive-Id : {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → p ∙ᵣⁱ q = p ∙ⁱ q - eq-concat-concatr-involutive-Id (w , refl , q) (w' , p' , refl) = - eq-pair-eq-fiber (eq-pair (left-unit-concatr) (inv left-unit-concatr)) + eq-concat-right-strict-concat-involutive-Id (w , refl , q) (w' , p' , refl) = + eq-pair-eq-fiber + ( eq-pair + ( left-unit-right-strict-concat) + ( inv left-unit-right-strict-concat)) - preserves-concatr-involutive-eq-eq : + preserves-right-strict-concat-involutive-eq-eq : {x y z : A} (p : x = y) (q : y = z) → involutive-eq-eq (p ∙ q) = involutive-eq-eq p ∙ᵣⁱ involutive-eq-eq q - preserves-concatr-involutive-eq-eq p refl = ap involutive-eq-eq right-unit + preserves-right-strict-concat-involutive-eq-eq p refl = + ap involutive-eq-eq right-unit - preserves-concatr-eq-involutive-eq : + preserves-right-strict-concat-eq-involutive-eq : {x y z : A} (p : x =ⁱ y) (q : y =ⁱ z) → eq-involutive-eq (p ∙ᵣⁱ q) = eq-involutive-eq p ∙ eq-involutive-eq q - preserves-concatr-eq-involutive-eq (w , p , q) (w' , p' , q') = + preserves-right-strict-concat-eq-involutive-eq (w , p , q) (w' , p' , q') = ( ap ( inv q ∙_) - ( ( eq-double-concat-concatr-left-associated p (inv q') p') ∙ + ( ( eq-double-concat-right-strict-concat-left-associated p (inv q') p') ∙ ( assoc p (inv q') p'))) ∙ ( inv (assoc (inv q) p (inv q' ∙ p'))) ``` ### The groupoidal laws for the strictly involutive identity types -The general proof-strategy is to induct on the necessary identifications to make -the left endpoints judgmentally equal, and then proceed by reasoning with the -groupoid-laws of the underlying identity types. +The general proof strategy is to induct on the minimal number of identifications +to make the left endpoints strictly equal, and then proceed by reasoning with +the groupoid laws of the underlying identity types. -#### The groupoidal laws for the judgmentally left unital concatenation operation +#### The groupoidal laws for the strictly left unital concatenation operation ```agda module _ @@ -415,90 +426,109 @@ module _ assoc-involutive-Id (_ , p , q) (_ , p' , q') (_ , p'' , q'') = eq-pair-eq-fiber ( eq-pair-eq-fiber - ( ( inv (assoc-concatr (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ - ( ap (_∙ᵣ q) (inv (assoc-concatr (q'' ∙ᵣ inv p') q' (inv p)))))) + ( ( inv (assoc-right-strict-concat (q'' ∙ᵣ inv p') (q' ∙ᵣ inv p) q)) ∙ + ( ap + ( _∙ᵣ q) + ( inv (assoc-right-strict-concat (q'' ∙ᵣ inv p') q' (inv p)))))) +``` +**Note.** Observe that the previous proof relies solely on the associator of the +underlying identity type. This is one of the fundamental observations leading to +the construction of the +[computational identity type](foundation.computational-identity-types.md). + +```agda module _ {l : Level} {A : UU l} {x y : A} where left-unit-involutive-Id : - {p : x =ⁱ y} → refl-involutive-Id ∙ⁱ p = p + {p : x =ⁱ y} → reflⁱ ∙ⁱ p = p left-unit-involutive-Id = refl right-unit-involutive-Id : - {p : x =ⁱ y} → p ∙ⁱ refl-involutive-Id = p + {p : x =ⁱ y} → p ∙ⁱ reflⁱ = p right-unit-involutive-Id {p = .y , refl , q} = - eq-pair-eq-fiber (eq-pair-eq-fiber left-unit-concatr) + eq-pair-eq-fiber (eq-pair-eq-fiber left-unit-right-strict-concat) left-inv-involutive-Id : - (p : x =ⁱ y) → inv-involutive-Id p ∙ⁱ p = refl-involutive-Id + (p : x =ⁱ y) → inv-involutive-Id p ∙ⁱ p = reflⁱ left-inv-involutive-Id (.y , refl , q) = - eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-concatr q)) + eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-right-strict-concat q)) right-inv-involutive-Id : - (p : x =ⁱ y) → p ∙ⁱ inv-involutive-Id p = refl-involutive-Id + (p : x =ⁱ y) → p ∙ⁱ inv-involutive-Id p = reflⁱ right-inv-involutive-Id (.x , p , refl) = - eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-concatr p)) + eq-pair-eq-fiber (eq-pair-eq-fiber (right-inv-right-strict-concat p)) distributive-inv-concat-involutive-Id : (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → inv-involutive-Id (p ∙ⁱ q) = inv-involutive-Id q ∙ⁱ inv-involutive-Id p distributive-inv-concat-involutive-Id (.y , refl , q') (.y , p' , refl) = - eq-pair-eq-fiber (eq-pair (left-unit-concatr) (inv left-unit-concatr)) + eq-pair-eq-fiber + ( eq-pair + ( left-unit-right-strict-concat) + ( inv left-unit-right-strict-concat)) ``` -#### The groupoidal laws for the judgmentally right unital concatenation operation +#### The groupoidal laws for the strictly right unital concatenation operation ```agda module _ {l : Level} {A : UU l} {x y z w : A} where - assoc-concatr-involutive-Id : + assoc-right-strict-concat-involutive-Id : (p : x =ⁱ y) (q : y =ⁱ z) (r : z =ⁱ w) → ((p ∙ᵣⁱ q) ∙ᵣⁱ r) = (p ∙ᵣⁱ (q ∙ᵣⁱ r)) - assoc-concatr-involutive-Id (_ , p , q) (_ , p' , q') (_ , p'' , q'') = + assoc-right-strict-concat-involutive-Id + ( _ , p , q) (_ , p' , q') (_ , p'' , q'') = eq-pair-eq-fiber ( eq-pair - ( ( assoc-concatr (p ∙ᵣ inv q' ∙ᵣ p') (inv q'') p'') ∙ - ( assoc-concatr (p ∙ᵣ inv q') p' (inv q'' ∙ᵣ p'')) ∙ - ( ap (p ∙ᵣ inv q' ∙ᵣ_) (inv (assoc-concatr p' (inv q'') p'')))) + ( ( assoc-right-strict-concat (p ∙ᵣ inv q' ∙ᵣ p') (inv q'') p'') ∙ + ( assoc-right-strict-concat (p ∙ᵣ inv q') p' (inv q'' ∙ᵣ p'')) ∙ + ( ap + ( p ∙ᵣ inv q' ∙ᵣ_) + ( inv (assoc-right-strict-concat p' (inv q'') p'')))) ( refl)) module _ {l : Level} {A : UU l} {x y : A} where - left-unit-concatr-involutive-Id : - {p : x =ⁱ y} → refl-involutive-Id ∙ᵣⁱ p = p - left-unit-concatr-involutive-Id {p = .x , p , refl} = - eq-pair-eq-fiber (eq-pair left-unit-concatr refl) + left-unit-right-strict-concat-involutive-Id : + {p : x =ⁱ y} → reflⁱ ∙ᵣⁱ p = p + left-unit-right-strict-concat-involutive-Id {p = .x , p , refl} = + eq-pair-eq-fiber (eq-pair left-unit-right-strict-concat refl) - right-unit-concatr-involutive-Id : - {p : x =ⁱ y} → p ∙ᵣⁱ refl-involutive-Id = p - right-unit-concatr-involutive-Id = refl + right-unit-right-strict-concat-involutive-Id : + {p : x =ⁱ y} → p ∙ᵣⁱ reflⁱ = p + right-unit-right-strict-concat-involutive-Id = refl - left-inv-concatr-involutive-Id : - (p : x =ⁱ y) → inv-involutive-Id p ∙ᵣⁱ p = refl-involutive-Id - left-inv-concatr-involutive-Id (.y , refl , q) = - eq-pair-eq-fiber (eq-pair (right-inv-concatr q) refl) + left-inv-right-strict-concat-involutive-Id : + (p : x =ⁱ y) → inv-involutive-Id p ∙ᵣⁱ p = reflⁱ + left-inv-right-strict-concat-involutive-Id (.y , refl , q) = + eq-pair-eq-fiber (eq-pair (right-inv-right-strict-concat q) refl) - right-inv-concatr-involutive-Id : - (p : x =ⁱ y) → p ∙ᵣⁱ inv-involutive-Id p = refl-involutive-Id - right-inv-concatr-involutive-Id (.x , p , refl) = - eq-pair-eq-fiber (eq-pair (right-inv-concatr p) refl) + right-inv-right-strict-concat-involutive-Id : + (p : x =ⁱ y) → p ∙ᵣⁱ inv-involutive-Id p = reflⁱ + right-inv-right-strict-concat-involutive-Id (.x , p , refl) = + eq-pair-eq-fiber (eq-pair (right-inv-right-strict-concat p) refl) - distributive-inv-concatr-involutive-Id : + distributive-inv-right-strict-concat-involutive-Id : (p : x =ⁱ y) {z : A} (q : y =ⁱ z) → inv-involutive-Id (p ∙ᵣⁱ q) = inv-involutive-Id q ∙ᵣⁱ inv-involutive-Id p - distributive-inv-concatr-involutive-Id (.y , refl , q) (.y , p' , refl) = - eq-pair-eq-fiber (eq-pair (inv left-unit-concatr) (left-unit-concatr)) + distributive-inv-right-strict-concat-involutive-Id + ( .y , refl , q) (.y , p' , refl) = + eq-pair-eq-fiber + ( eq-pair + ( inv left-unit-right-strict-concat) + ( left-unit-right-strict-concat)) ``` ## See also -- [The yoneda identity types](foundation.yoneda-identity-types.md) for an +- [The Yoneda identity types](foundation.yoneda-identity-types.md) for an identity relation that is strictly associative and two-sided unital. - [The computational identity types](foundation.computational-identity-types.md) for an identity relation that is strictly involutive, associative, and diff --git a/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md b/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md new file mode 100644 index 0000000000..8e81a2d20a --- /dev/null +++ b/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md @@ -0,0 +1,178 @@ +# The strictly right unital concatenation operation on identifications + +```agda +module foundation.strictly-right-unital-concatenation-identifications where +``` + +
Imports + +```agda +open import foundation.action-on-identifications-functions +open import foundation.universe-levels + +open import foundation-core.identity-types +``` + +
+ +## Idea + +The +{{#concept "concatenation operation on identifications" Agda=_∙_ Agda=_∙'_ Agda=concat}} +is a family of binary operations + +```text + _∙_ : x = y → y = z → x = z +``` + +indexed by `x y z : A`. However, there are essentially three different ways we +can define concatenation of identifications, all with different computational +behaviours: + +1. We can define concatenation by induction on the equality `x = y`. This gives + us the computation rule `refl ∙ q ≐ q`. +2. We can define concatenation by induction on the equality `y = z`. This gives + us the computation rule `p ∙ refl ≐ p`. +3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only + gives us the computation rule `refl ∙ refl ≐ refl`. + +While the third option may be preferred by some for its symmetry, for practical +reasons, we use the first alternative by convention. However, there are cases +where the second case may be preferred. Hence why we on this page consider the +{{#concept "strictly right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=right-strict-concat Agda=right-strict-concat'}}. + +This definition is for instance used with the +[strictly involutive identity types](foundation.strictly-involutive-identity-types.md) +to construct a strictly left unital concatenation operation. + +## Definition + +```agda +module _ + {l : Level} {A : UU l} + where + + infixl 15 _∙ᵣ_ + _∙ᵣ_ : {x y z : A} → x = y → y = z → x = z + p ∙ᵣ refl = p + + right-strict-concat : {x y : A} → x = y → (z : A) → y = z → x = z + right-strict-concat p z q = p ∙ᵣ q + + right-strict-concat' : (x : A) {y z : A} → y = z → x = y → x = z + right-strict-concat' x q p = p ∙ᵣ q +``` + +### Translating between the stictly left and stricly right unital versions of concatenation + +```agda +module _ + {l : Level} {A : UU l} + where + + eq-right-strict-concat-concat : + {x y z : A} (p : x = y) (q : y = z) → p ∙ q = p ∙ᵣ q + eq-right-strict-concat-concat p refl = right-unit + + eq-concat-right-strict-concat : + {x y z : A} (p : x = y) (q : y = z) → p ∙ᵣ q = p ∙ q + eq-concat-right-strict-concat p q = inv (eq-right-strict-concat-concat p q) + + eq-double-right-strict-concat-concat-left-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + (p ∙ q) ∙ r = (p ∙ᵣ q) ∙ᵣ r + eq-double-right-strict-concat-concat-left-associated p q r = + ap (_∙ r) (eq-right-strict-concat-concat p q) ∙ eq-right-strict-concat-concat (p ∙ᵣ q) r + + eq-double-right-strict-concat-concat-right-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + p ∙ (q ∙ r) = p ∙ᵣ (q ∙ᵣ r) + eq-double-right-strict-concat-concat-right-associated p q r = + ap (p ∙_) (eq-right-strict-concat-concat q r) ∙ eq-right-strict-concat-concat p (q ∙ᵣ r) + + eq-double-concat-right-strict-concat-left-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + (p ∙ᵣ q) ∙ᵣ r = (p ∙ q) ∙ r + eq-double-concat-right-strict-concat-left-associated p q r = + ap (_∙ᵣ r) (eq-concat-right-strict-concat p q) ∙ eq-concat-right-strict-concat (p ∙ q) r + + eq-double-concat-right-strict-concat-right-associated : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + p ∙ᵣ (q ∙ᵣ r) = p ∙ (q ∙ r) + eq-double-concat-right-strict-concat-right-associated p q r = + ap (p ∙ᵣ_) (eq-concat-right-strict-concat q r) ∙ eq-concat-right-strict-concat p (q ∙ r) +``` + +## Properties + +### The groupoidal laws + +```agda +module _ + {l : Level} {A : UU l} + where + + assoc-right-strict-concat : + {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → + ((p ∙ᵣ q) ∙ᵣ r) = (p ∙ᵣ (q ∙ᵣ r)) + assoc-right-strict-concat p q refl = refl + + left-unit-right-strict-concat : {x y : A} {p : x = y} → refl ∙ᵣ p = p + left-unit-right-strict-concat {p = refl} = refl + + right-unit-right-strict-concat : {x y : A} {p : x = y} → p ∙ᵣ refl = p + right-unit-right-strict-concat = refl + + left-inv-right-strict-concat : {x y : A} (p : x = y) → inv p ∙ᵣ p = refl + left-inv-right-strict-concat refl = refl + + right-inv-right-strict-concat : {x y : A} (p : x = y) → p ∙ᵣ (inv p) = refl + right-inv-right-strict-concat refl = refl + + inv-inv-right-strict-concat : {x y : A} (p : x = y) → inv (inv p) = p + inv-inv-right-strict-concat refl = refl + + distributive-inv-right-strict-concat : + {x y : A} (p : x = y) {z : A} (q : y = z) → + inv (p ∙ᵣ q) = inv q ∙ᵣ inv p + distributive-inv-right-strict-concat refl refl = refl +``` + +### Transposing inverses + +```agda +module _ + {l : Level} {A : UU l} + where + + left-transpose-eq-right-strict-concat : + {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → + p ∙ᵣ q = r → q = inv p ∙ᵣ r + left-transpose-eq-right-strict-concat refl q r s = + (inv left-unit-right-strict-concat ∙ s) ∙ inv left-unit-right-strict-concat + + right-transpose-eq-right-strict-concat : + {x y : A} (p : x = y) {z : A} (q : y = z) (r : x = z) → + p ∙ᵣ q = r → p = r ∙ᵣ inv q + right-transpose-eq-right-strict-concat p refl r s = s +``` + +### Concatenation is injective + +```agda +module _ + {l1 : Level} {A : UU l1} + where + + is-injective-right-strict-concat : + {x y z : A} (p : x = y) {q r : y = z} → p ∙ᵣ q = p ∙ᵣ r → q = r + is-injective-right-strict-concat refl s = (inv left-unit-right-strict-concat ∙ s) ∙ left-unit-right-strict-concat + + is-injective-right-strict-concat' : + {x y z : A} (r : y = z) {p q : x = y} → p ∙ᵣ r = q ∙ᵣ r → p = q + is-injective-right-strict-concat' refl s = s +``` + +## See also + +- [Yoneda identity types](foundation.yoneda-identity-types.md) diff --git a/src/foundation/transport-along-identifications.lagda.md b/src/foundation/transport-along-identifications.lagda.md index 10b2a4ca5f..61ae11003c 100644 --- a/src/foundation/transport-along-identifications.lagda.md +++ b/src/foundation/transport-along-identifications.lagda.md @@ -30,7 +30,7 @@ element `b : B x`, we can `b` along the identification `p` to obtain an element `tr B p b : B y`. The fact that `tr B p` is an [equivalence](foundation-core.equivalences.md) is -recorded in this file. +recorded on this page. ## Properties diff --git a/src/foundation/yoneda-identity-types.lagda.md b/src/foundation/yoneda-identity-types.lagda.md index f11efe642d..50bace8a7c 100644 --- a/src/foundation/yoneda-identity-types.lagda.md +++ b/src/foundation/yoneda-identity-types.lagda.md @@ -8,10 +8,10 @@ module foundation.yoneda-identity-types where ```agda open import foundation.action-on-identifications-functions -open import foundation.definitionally-right-unital-concatenation-identifications open import foundation.dependent-pair-types open import foundation.function-extensionality open import foundation.multivariable-homotopies +open import foundation.strictly-right-unital-concatenation-identifications open import foundation.transport-along-identifications open import foundation.univalence open import foundation.universal-property-identity-systems @@ -34,8 +34,8 @@ open import foundation-core.torsorial-type-families The standard definition of [identity types](foundation-core.identity-types.md) has the limitation that many of the basic operations only satisfy algebraic laws -_weakly_. In this file, we consider the -{{#concept "yoneda identity types" Agda=yoneda-Id}} +_weakly_. On this page, we consider the +{{#concept "Yoneda identity types" Agda=yoneda-Id}} ```text (x =ʸ y) := (z : A) → (z = x) → (z = y) @@ -44,25 +44,26 @@ _weakly_. In this file, we consider the Through the interpretation of types as ∞-categories, where the hom-space `hom(x , y)` is defined to be the identity type `x = y`, we may observe that this is an instance of the Yoneda embedding. We use a superscript `y` in the -notation of the yoneda identity types. +notation of the Yoneda identity types, and similarly we call elements of the +Yoneda identity types for {{#concept "Yoneda identifications" Agda=yoneda-Id}}. -The yoneda identity types are [equivalent](foundation-core.equivalences.md) to -the standard identity types, but satisfy judgmental laws +The Yoneda identity types are [equivalent](foundation-core.equivalences.md) to +the standard identity types, but satisfy strict laws - `(p ∙ʸ q) ∙ʸ r ≐ p ∙ʸ (q ∙ʸ r)`, - `reflʸ ∙ʸ p ≐ p`, and - `p ∙ʸ reflʸ ≐ p`. -This is achieved by proxiyng to function composition and utilizing its +This is achieved by proxying to function composition and utilizing its computational properties, and relies heavily on the [function extensionality axiom](foundation.function-extensionality.md). More concretely, the reflexivity is given by the identity function, and path concatenation is given by function composition. -In addition to these strictness laws, we can make the type satisfy judgmental -law `invʸ reflʸ ≐ reflʸ`. Moreover, while the induction principle of the yoneda -identity types does not in general satisfy the computation rule judgmentally, we -can define its recursion principle such that does. +In addition to these strictness laws, we can make the type satisfy the strict +law `invʸ reflʸ ≐ reflʸ`. Moreover, while the induction principle of the Yoneda +identity types does not in general satisfy the computation rule strictly, we can +define its recursion principle such that does. ## Definition @@ -82,15 +83,15 @@ module _ We define the reflexivity to be the identity function: ```agda - refl-yoneda-Id : {x : A} → x =ʸ x - refl-yoneda-Id z = id + reflʸ : {x : A} → x =ʸ x + reflʸ z = id ``` ## Properties -### Elements of the yoneda identity type act like postconcatenation operations +### Elements of the Yoneda identity type act like postconcatenation operations -The following is a collection of properties of yoneda identifications similar to +The following is a collection of properties of Yoneda identifications similar to properties of the postconcatenation operation of identifications. ```agda @@ -112,9 +113,9 @@ module _ {x y z w : A} (f : x =ʸ y) (p : w = z) (q : z = x) → f w (p ∙ᵣ q) = p ∙ᵣ f z q commutative-preconcatr-Id-yoneda-Id {x} {y} {z} {w} f p q = - ( ap (f w) (eq-concat-concatr p q)) ∙ + ( ap (f w) (eq-concat-right-strict-concat p q)) ∙ ( commutative-preconcat-Id-yoneda-Id f p q) ∙ - ( eq-concatr-concat p (f z q)) + ( eq-right-strict-concat-concat p (f z q)) commutative-preconcatr-refl-Id-yoneda-Id : {x y z : A} (f : x =ʸ y) (q : z = x) → f z q = q ∙ᵣ f x refl @@ -143,7 +144,7 @@ module _ inv (inv-distributive-inv-Id-yoneda-Id f g) ``` -### The yoneda identity types are equivalent to the standard identity types +### The Yoneda identity types are equivalent to the standard identity types The equivalence `(x = y) ≃ (x =ʸ y)` is defined from left to right by the postconcatenation operation @@ -159,7 +160,7 @@ and from right to left by evaluation at the reflexivity ``` It should be noted that we define the map `x = y → x =ʸ y` using the -[definitionally right unital concatenation operation](foundation.definitionally-right-unital-concatenation-identifications.md). +[strictly right unital concatenation operation](foundation.strictly-right-unital-concatenation-identifications.md). While this obstructs us from showing that the homotopy `eq-yoneda-eq ∘ yoneda-eq-eq ~ id` holds by reflexivity, as demonstrated by the computation @@ -200,10 +201,10 @@ module _ The construction of the homotopy `yoneda-eq-eq ∘ eq-yoneda-eq ~ id` requires the [function extensionality axiom](foundation.function-extensionality.md). And -while we could show an analogous induction principle of the yoneda identity +while we could show an analogous induction principle of the Yoneda identity types without the use of this axiom, function extensionality will become indispensable regardless when we proceed to proving miscellaneous algebraic laws -of the yoneda identity type. +of the Yoneda identity type. ```agda is-section-eq-yoneda-eq : @@ -214,7 +215,7 @@ of the yoneda identity type. is-retraction-eq-yoneda-eq : is-retraction yoneda-eq-eq eq-yoneda-eq - is-retraction-eq-yoneda-eq p = left-unit-concatr + is-retraction-eq-yoneda-eq p = left-unit-right-strict-concat is-equiv-yoneda-eq-eq : is-equiv yoneda-eq-eq pr1 (pr1 is-equiv-yoneda-eq-eq) = eq-yoneda-eq @@ -246,22 +247,22 @@ module _ is-section-eq-yoneda-eq-refl : {x : A} → - yoneda-eq-eq (eq-yoneda-eq (refl-yoneda-Id {x = x})) = refl-yoneda-Id + yoneda-eq-eq (eq-yoneda-eq (reflʸ {x = x})) = reflʸ is-section-eq-yoneda-eq-refl = refl preserves-refl-yoneda-eq-eq : - {x : A} → yoneda-eq-eq (refl {x = x}) = refl-yoneda-Id + {x : A} → yoneda-eq-eq (refl {x = x}) = reflʸ preserves-refl-yoneda-eq-eq = refl preserves-refl-eq-yoneda-eq : - {x : A} → eq-yoneda-eq (refl-yoneda-Id {x = x}) = refl + {x : A} → eq-yoneda-eq (reflʸ {x = x}) = refl preserves-refl-eq-yoneda-eq = refl ``` Below, we consider the alternative definition of `yoneda-eq-eq` using the -definitionally left unital concatenation operation on standard identity types. -As we can see, the retracting homotopy holds judgmentally, but now -`yoneda-eq-eq refl` does not compute definitionally to `reflʸ`. +strictly left unital concatenation operation on standard identity types. As we +can see, the retracting homotopy holds strictly, but now `yoneda-eq-eq refl` +does not compute strictly to `reflʸ`. ```agda module _ @@ -286,12 +287,12 @@ module _ where preserves-refl-yoneda-eq-eq' : - {x : A} → yoneda-eq-eq' (refl {x = x}) = refl-yoneda-Id + {x : A} → yoneda-eq-eq' (refl {x = x}) = reflʸ preserves-refl-yoneda-eq-eq' = eq-multivariable-htpy 2 (λ _ p → right-unit) ``` -### Torsoriality of the yoneda identity types +### Torsoriality of the Yoneda identity types ```agda module _ @@ -306,7 +307,7 @@ module _ ( is-torsorial-Id x) ``` -### The dependent universal property of the yoneda identity types +### The dependent universal property of the Yoneda identity types ```agda module _ @@ -316,23 +317,23 @@ module _ dependent-universal-property-identity-system-yoneda-Id : dependent-universal-property-identity-system ( yoneda-Id x) - ( refl-yoneda-Id) + ( reflʸ) dependent-universal-property-identity-system-yoneda-Id = dependent-universal-property-identity-system-is-torsorial - ( refl-yoneda-Id) + ( reflʸ) ( is-torsorial-yoneda-Id) ``` -### The induction principle for the yoneda identity types +### The induction principle for the Yoneda identity types -The yoneda identity types satisfy the induction principle of the identity types. +The Yoneda identity types satisfy the induction principle of the identity types. This states that given a base point `x : A` and a family of types over the identity types based at `x`, `B : (y : A) (f : x =ʸ y) → UU l2`, then to construct a dependent function `g : (y : A) (f : x =ʸ y) → B y p` it suffices to define it at `g x reflʸ`. -**Note.** As stated before, a drawback of the yoneda identity types is that they -do not satisfy a judgmental computation rule for this induction principle. +**Note.** As stated before, a drawback of the Yoneda identity types is that they +do not satisfy a strict computation rule for this induction principle. ```agda module _ @@ -341,7 +342,7 @@ module _ where ind-yoneda-Id' : - (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y f + (b : B x reflʸ) {y : A} (f : x =ʸ y) → B y f ind-yoneda-Id' b {y} = map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) @@ -349,15 +350,15 @@ module _ ( y) compute-ind-yoneda-Id' : - (b : B x refl-yoneda-Id) → - ind-yoneda-Id' b refl-yoneda-Id = b + (b : B x reflʸ) → + ind-yoneda-Id' b reflʸ = b compute-ind-yoneda-Id' = is-section-map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) uniqueness-ind-yoneda-Id' : (b : (y : A) (f : x =ʸ y) → B y f) → - (λ y → ind-yoneda-Id' (b x refl-yoneda-Id) {y}) = b + (λ y → ind-yoneda-Id' (b x reflʸ) {y}) = b uniqueness-ind-yoneda-Id' = is-retraction-map-inv-is-equiv ( dependent-universal-property-identity-system-yoneda-Id B) @@ -375,7 +376,7 @@ module _ where ind-yoneda-Id : - (b : B x refl-yoneda-Id) {y : A} (f : x =ʸ y) → B y f + (b : B x reflʸ) {y : A} (f : x =ʸ y) → B y f ind-yoneda-Id b {y} f = tr ( B y) @@ -398,31 +399,31 @@ module _ rec-yoneda-Id b f = tr B (eq-yoneda-eq f) b compute-rec-yoneda-Id : - (b : B x) → rec-yoneda-Id b refl-yoneda-Id = b + (b : B x) → rec-yoneda-Id b reflʸ = b compute-rec-yoneda-Id b = refl uniqueness-rec-yoneda-Id : (b : (y : A) → x =ʸ y → B y) → - (λ y → rec-yoneda-Id (b x refl-yoneda-Id) {y}) = b + (λ y → rec-yoneda-Id (b x reflʸ) {y}) = b uniqueness-rec-yoneda-Id b = ( inv ( uniqueness-ind-yoneda-Id' ( λ y _ → B y) - ( λ y → rec-yoneda-Id (b x refl-yoneda-Id)))) ∙ + ( λ y → rec-yoneda-Id (b x reflʸ)))) ∙ ( uniqueness-ind-yoneda-Id' (λ y _ → B y) b) ``` ## Structure -The yoneda identity types form a judgmentally compositional weak groupoidal +The Yoneda identity types form a strictly compositional weak groupoidal structure on types. -### Inverting yoneda identifications +### Inverting Yoneda identifications -We consider two ways of defining the inversion operation on yoneda -identifications: by the definitionally right unital, and definitionally left -unital concatenation operation on the underlying identity type respectively. The -former enjoys the computational property +We consider two ways of defining the inversion operation on Yoneda +identifications: by the strictly right unital, and strictly left unital +concatenation operation on the underlying identity type respectively. The former +enjoys the computational property ```text inv reflʸ ≐ reflʸ, @@ -430,7 +431,7 @@ former enjoys the computational property hence will be preferred going. -#### The inversion operation defined by the definitionally right unital concatenation operation on identifications +#### The inversion operation defined by the strictly right unital concatenation operation on identifications ```agda module _ @@ -442,7 +443,7 @@ module _ compute-inv-yoneda-Id-refl : {x : A} → - inv-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id + inv-yoneda-Id (reflʸ {x = x}) = reflʸ compute-inv-yoneda-Id-refl = refl inv-inv-yoneda-Id : @@ -451,10 +452,15 @@ module _ inv-inv-yoneda-Id {x} f = eq-multivariable-htpy 2 ( λ _ p → - ( ap (p ∙ᵣ_) (ap inv left-unit-concatr ∙ inv-inv (f x refl))) ∙ + ( ap + ( p ∙ᵣ_) + ( ap inv left-unit-right-strict-concat ∙ inv-inv (f x refl))) ∙ ( inv (commutative-preconcatr-refl-Id-yoneda-Id f p))) ``` +The inversion operation corresponds to the standard inversion operation on +identifications: + ```agda module _ {l : Level} {A : UU l} @@ -470,38 +476,40 @@ module _ yoneda-eq-eq (inv p) = inv-yoneda-Id (yoneda-eq-eq p) preserves-inv-yoneda-eq-eq p = eq-multivariable-htpy 2 - ( λ _ q → ap (λ r → q ∙ᵣ inv r) (inv left-unit-concatr)) + ( λ _ q → ap (λ r → q ∙ᵣ inv r) (inv left-unit-right-strict-concat)) preserves-inv-eq-yoneda-eq : {x y : A} (f : x =ʸ y) → eq-yoneda-eq (inv-yoneda-Id f) = inv (eq-yoneda-eq f) - preserves-inv-eq-yoneda-eq f = left-unit-concatr + preserves-inv-eq-yoneda-eq f = left-unit-right-strict-concat ``` -#### The inversion operation defined by the definitionally left unital concatenation operation on identifications +#### The inversion operation defined by the strictly left unital concatenation operation on identifications ```agda module _ {l : Level} {A : UU l} where - invl-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x - invl-yoneda-Id {x} f z p = p ∙ inv (f x refl) + left-strict-inv-yoneda-Id : {x y : A} → x =ʸ y → y =ʸ x + left-strict-inv-yoneda-Id {x} f z p = p ∙ inv (f x refl) - compute-invl-yoneda-Id-refl : - {x : A} → invl-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id - compute-invl-yoneda-Id-refl = eq-multivariable-htpy 2 (λ _ p → right-unit) + compute-left-strict-inv-yoneda-Id-refl : + {x : A} → left-strict-inv-yoneda-Id (reflʸ {x = x}) = reflʸ + compute-left-strict-inv-yoneda-Id-refl = + eq-multivariable-htpy 2 (λ _ p → right-unit) - invl-invl-yoneda-Id : - {x y : A} (f : x =ʸ y) → invl-yoneda-Id (invl-yoneda-Id f) = f - invl-invl-yoneda-Id {x} f = + left-strict-inv-left-strict-inv-yoneda-Id : + {x y : A} (f : x =ʸ y) → + left-strict-inv-yoneda-Id (left-strict-inv-yoneda-Id f) = f + left-strict-inv-left-strict-inv-yoneda-Id {x} f = eq-multivariable-htpy 2 ( λ _ p → ( ap (p ∙_) (inv-inv (f x refl))) ∙ ( inv (commutative-preconcat-refl-Id-yoneda-Id f p))) ``` -The inversion operation corresponds to the standard inversion operation on +This inversion operation also corresponds to the standard inversion operation on identifications: ```agda @@ -509,24 +517,24 @@ module _ {l : Level} {A : UU l} where - preserves-invl-yoneda-eq-eq : + preserves-left-strict-inv-yoneda-eq-eq : {x y : A} (p : x = y) → - yoneda-eq-eq (inv p) = invl-yoneda-Id (yoneda-eq-eq p) - preserves-invl-yoneda-eq-eq p = + yoneda-eq-eq (inv p) = left-strict-inv-yoneda-Id (yoneda-eq-eq p) + preserves-left-strict-inv-yoneda-eq-eq p = eq-multivariable-htpy 2 ( λ _ q → - ( eq-concat-concatr q (inv p)) ∙ - ( ap (λ r → q ∙ inv r) (inv left-unit-concatr))) + ( eq-concat-right-strict-concat q (inv p)) ∙ + ( ap (λ r → q ∙ inv r) (inv left-unit-right-strict-concat))) - preserves-invl-eq-yoneda-eq : + preserves-left-strict-inv-eq-yoneda-eq : {x y : A} (f : x =ʸ y) → - eq-yoneda-eq (invl-yoneda-Id f) = inv (eq-yoneda-eq f) - preserves-invl-eq-yoneda-eq f = refl + eq-yoneda-eq (left-strict-inv-yoneda-Id f) = inv (eq-yoneda-eq f) + preserves-left-strict-inv-eq-yoneda-eq f = refl ``` -### Concatenation of yoneda identifications +### Concatenation of Yoneda identifications -The concatenation operation on yoneda identifications is defined by function +The concatenation operation on Yoneda identifications is defined by function composition ```text @@ -572,7 +580,7 @@ module _ commutative-preconcat-refl-Id-yoneda-Id g (f x refl) ``` -### The groupoidal laws for the yoneda identity types +### The groupoidal laws for the Yoneda identity types ```agda module _ @@ -585,43 +593,43 @@ module _ assoc-yoneda-Id f g h = refl left-unit-yoneda-Id : - {f : x =ʸ y} → refl-yoneda-Id ∙ʸ f = f + {f : x =ʸ y} → reflʸ ∙ʸ f = f left-unit-yoneda-Id = refl right-unit-yoneda-Id : - {f : x =ʸ y} → f ∙ʸ refl-yoneda-Id = f + {f : x =ʸ y} → f ∙ʸ reflʸ = f right-unit-yoneda-Id = refl left-inv-yoneda-Id : - (f : x =ʸ y) → inv-yoneda-Id f ∙ʸ f = refl-yoneda-Id + (f : x =ʸ y) → inv-yoneda-Id f ∙ʸ f = reflʸ left-inv-yoneda-Id f = eq-multivariable-htpy 2 ( λ _ p → ( commutative-preconcatr-Id-yoneda-Id f p (inv (f x refl))) ∙ ( ap (p ∙ᵣ_) (compute-inv-Id-yoneda-Id f))) - left-invl-yoneda-Id : - (f : x =ʸ y) → invl-yoneda-Id f ∙ʸ f = refl-yoneda-Id - left-invl-yoneda-Id f = + left-left-strict-inv-yoneda-Id : + (f : x =ʸ y) → left-strict-inv-yoneda-Id f ∙ʸ f = reflʸ + left-left-strict-inv-yoneda-Id f = eq-multivariable-htpy 2 ( λ _ p → ( commutative-preconcat-Id-yoneda-Id f p (inv (f x refl))) ∙ ( ap (p ∙_) (compute-inv-Id-yoneda-Id f) ∙ right-unit)) right-inv-yoneda-Id : - (f : x =ʸ y) → f ∙ʸ inv-yoneda-Id f = refl-yoneda-Id + (f : x =ʸ y) → f ∙ʸ inv-yoneda-Id f = reflʸ right-inv-yoneda-Id f = eq-multivariable-htpy 2 ( λ _ p → ( ap ( _∙ᵣ inv (f x refl)) ( commutative-preconcatr-refl-Id-yoneda-Id f p)) ∙ - ( assoc-concatr p (f x refl) (inv (f x refl))) ∙ - ( ap (p ∙ᵣ_) (right-inv-concatr (f x refl)))) + ( assoc-right-strict-concat p (f x refl) (inv (f x refl))) ∙ + ( ap (p ∙ᵣ_) (right-inv-right-strict-concat (f x refl)))) - right-invl-yoneda-Id : - (f : x =ʸ y) → f ∙ʸ invl-yoneda-Id f = refl-yoneda-Id - right-invl-yoneda-Id f = + right-left-strict-inv-yoneda-Id : + (f : x =ʸ y) → f ∙ʸ left-strict-inv-yoneda-Id f = reflʸ + right-left-strict-inv-yoneda-Id f = eq-multivariable-htpy 2 ( λ _ p → ( ap @@ -642,13 +650,15 @@ module _ ( ( ap ( inv) ( commutative-preconcatr-refl-Id-yoneda-Id g (f x refl))) ∙ - ( distributive-inv-concatr (f x refl) (g y refl)))) ∙ - ( inv (assoc-concatr p (inv (g y refl)) (inv (f x refl))))) + ( distributive-inv-right-strict-concat (f x refl) (g y refl)))) ∙ + ( inv + ( assoc-right-strict-concat p (inv (g y refl)) (inv (f x refl))))) - distributive-invl-concat-yoneda-Id : + distributive-left-strict-inv-concat-yoneda-Id : (f : x =ʸ y) {z : A} (g : y =ʸ z) → - invl-yoneda-Id (f ∙ʸ g) = invl-yoneda-Id g ∙ʸ invl-yoneda-Id f - distributive-invl-concat-yoneda-Id f g = + left-strict-inv-yoneda-Id (f ∙ʸ g) = + left-strict-inv-yoneda-Id g ∙ʸ left-strict-inv-yoneda-Id f + distributive-left-strict-inv-concat-yoneda-Id f g = eq-multivariable-htpy 2 ( λ _ p → ( ap @@ -662,10 +672,10 @@ module _ ## Operations -We can define basic operations on the yoneda identifications. They all enjoy +We can define basic operations on the Yoneda identifications. They all enjoy strict computational properties. -### Action of functions on yoneda identifications +### Action of functions on Yoneda identifications ```agda module _ @@ -678,9 +688,9 @@ module _ ap-yoneda-Id : {x y : A} → x =ʸ y → f x =ʸ f y ap-yoneda-Id = yoneda-eq-eq ∘ eq-ap-yoneda-Id - compute-ap-refl-yoneda-Id : - {x : A} → ap-yoneda-Id (refl-yoneda-Id {x = x}) = refl-yoneda-Id - compute-ap-refl-yoneda-Id = refl + compute-ap-reflʸ : + {x : A} → ap-yoneda-Id (reflʸ {x = x}) = reflʸ + compute-ap-reflʸ = refl module _ {l1 : Level} {A : UU l1} @@ -695,7 +705,7 @@ module _ ( inv (commutative-preconcatr-refl-Id-yoneda-Id p q))) ``` -### Transport along yoneda identifications +### Transport along Yoneda identifications ```agda module _ @@ -705,12 +715,12 @@ module _ tr-yoneda-Id : {x y : A} → x =ʸ y → B x → B y tr-yoneda-Id = tr B ∘ eq-yoneda-eq - compute-tr-refl-yoneda-Id : - {x : A} → tr-yoneda-Id (refl-yoneda-Id {x = x}) = id - compute-tr-refl-yoneda-Id = refl + compute-tr-reflʸ : + {x : A} → tr-yoneda-Id (reflʸ {x = x}) = id + compute-tr-reflʸ = refl ``` -### Function extensionality with respect to yoneda identifications +### Function extensionality with respect to Yoneda identifications ```agda module _ @@ -733,7 +743,7 @@ module _ funext-yoneda-Id = is-equiv-map-equiv equiv-htpy-yoneda-eq ``` -### Univalence with respect to yoneda identifications +### Univalence with respect to Yoneda identifications ```agda module _ diff --git a/src/orthogonal-factorization-systems/cd-structures.lagda.md b/src/orthogonal-factorization-systems/cd-structures.lagda.md index 6413398d29..9bba4ff279 100644 --- a/src/orthogonal-factorization-systems/cd-structures.lagda.md +++ b/src/orthogonal-factorization-systems/cd-structures.lagda.md @@ -31,7 +31,7 @@ class `𝒟` of j ``` -On this page we will consider _internal_ cd-structures, i.e., cd-structure on +In this file we will consider _internal_ cd-structures, i.e., cd-structure on types. In other words, a {{#concept "cd-structure" Agda=cd-structure}} is a family of [subtypes](foundation-core.subtypes.md) diff --git a/src/synthetic-homotopy-theory/cocones-under-sequential-diagrams.lagda.md b/src/synthetic-homotopy-theory/cocones-under-sequential-diagrams.lagda.md index 3f105a1c88..b0d4a02531 100644 --- a/src/synthetic-homotopy-theory/cocones-under-sequential-diagrams.lagda.md +++ b/src/synthetic-homotopy-theory/cocones-under-sequential-diagrams.lagda.md @@ -102,9 +102,9 @@ filling the "pinched cylinder" with the faces `Kₙ`, `Hₙ`, `Lₙ` and `Kₙ The coherence datum may be better understood by viewing a cocone as a [morphism](synthetic-homotopy-theory.morphisms-sequential-diagrams.md) from -`(A, a)` to the constant cocone `(n ↦ X, n ↦ id)` — the two types are -definitionally equal. Then a homotopy of cocones is a regular homotopy of -morphisms of sequential diagrams. +`(A, a)` to the constant cocone `(n ↦ X, n ↦ id)` — the two types are strictly +equal. Then a homotopy of cocones is a regular homotopy of morphisms of +sequential diagrams. ```agda module _ diff --git a/src/synthetic-homotopy-theory/functoriality-sequential-colimits.lagda.md b/src/synthetic-homotopy-theory/functoriality-sequential-colimits.lagda.md index ae8f4f9256..b03ced31dd 100644 --- a/src/synthetic-homotopy-theory/functoriality-sequential-colimits.lagda.md +++ b/src/synthetic-homotopy-theory/functoriality-sequential-colimits.lagda.md @@ -426,8 +426,8 @@ module _ ### A retract of sequential diagrams induces a retract of sequential colimits -Additionally, the underlying map of the retraction is definitionally equal to -the map induced by the retraction of sequential diagrams. +Additionally, the underlying map of the retraction is strictly equal to the map +induced by the retraction of sequential diagrams. ```agda module _ diff --git a/src/universal-algebra/algebraic-theory-of-groups.lagda.md b/src/universal-algebra/algebraic-theory-of-groups.lagda.md index 5645a87ba0..e6d6246392 100644 --- a/src/universal-algebra/algebraic-theory-of-groups.lagda.md +++ b/src/universal-algebra/algebraic-theory-of-groups.lagda.md @@ -50,7 +50,7 @@ pr2 group-signature inv-group-op = 1 data group-laws : UU lzero where associative-l-group-laws : group-laws - invl-l-group-laws : group-laws + left-strict-inv-l-group-laws : group-laws invr-r-group-laws : group-laws idl-l-group-laws : group-laws idr-r-group-laws : group-laws @@ -64,7 +64,7 @@ pr2 group-Theory = ( ( op mul-group-op (var 0 ∷ var 1 ∷ empty-vec)) ∷ var 2 ∷ empty-vec)) , ( op mul-group-op ( var 0 ∷ (op mul-group-op (var 1 ∷ var 2 ∷ empty-vec)) ∷ empty-vec)) - invl-l-group-laws → + left-strict-inv-l-group-laws → ( op mul-group-op ( op inv-group-op (var 0 ∷ empty-vec) ∷ var 0 ∷ empty-vec)) , ( op unit-group-op empty-vec) @@ -110,7 +110,7 @@ pr2 (pr2 (pr1 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = pr1 (pr2 (pr2 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) x = models-A inv-group-op (x ∷ empty-vec) pr1 (pr2 (pr2 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = - satisfies-A invl-l-group-laws (λ _ → x) + satisfies-A left-strict-inv-l-group-laws (λ _ → x) pr2 (pr2 (pr2 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = satisfies-A invr-r-group-laws (λ _ → x) @@ -129,7 +129,7 @@ Group-group-Algebra G = ( λ where associative-l-group-laws assign → associative-mul-Group G (assign 0) (assign 1) (assign 2) - invl-l-group-laws assign → + left-strict-inv-l-group-laws assign → left-inverse-law-mul-Group G (assign 0) invr-r-group-laws assign → right-inverse-law-mul-Group G (assign 0) diff --git a/tables/identity-types.md b/tables/identity-types.md index ae986240d9..1325abe5d8 100644 --- a/tables/identity-types.md +++ b/tables/identity-types.md @@ -1,35 +1,35 @@ -| Concept | File | -| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -| Action on higher identifications of functions | [`foundation.action-on-higher-identifications-functions`](foundation.action-on-higher-identifications-functions.md) | -| Action on identifications of binary functions | [`foundation.action-on-identifications-binary-functions`](foundation.action-on-identifications-binary-functions.md) | -| Action on identifications of dependent functions | [`foundation.action-on-identifications-dependent-functions`](foundation.action-on-identifications-dependent-functions.md) | -| Action on identifications of functions | [`foundation.action-on-identifications-functions`](foundation.action-on-identifications-functions.md) | -| Binary transport | [`foundation.binary-transport`](foundation.binary-transport.md) | -| Commuting hexagons of identifications | [`foundation.commuting-hexagons-of-identifications`](foundation.commuting-hexagons-of-identifications.md) | -| Commuting pentagons of identifications | [`foundation.commuting-pentagons-of-identifications`](foundation.commuting-pentagons-of-identifications.md) | -| Commuting squares of identifications | [`foundation.commuting-squares-of-identifications`](foundation.commuting-squares-of-identifications.md) | -| Commuting triangles of identifications | [`foundation.commuting-triangles-of-identifications`](foundation.commuting-triangles-of-identifications.md) | -| The computational identity type | [`foundation.computational-identity-types`](foundation.computational-identity-types.md) | -| The strictly involutive identity type | [`foundation.strictly-involutive-identity-types`](foundation.strictly-involutive-identity-types.md) | -| The definitionally right unital concatenation operation on identifications | [`foundation.definitionally-right-unital-concatenation-identifications`](foundation.definitionally-right-unital-concatenation-identifications.md) | -| Dependent identifications (foundation) | [`foundation.dependent-identifications`](foundation.dependent-identifications.md) | -| Dependent identifications (foundation-core) | [`foundation-core.dependent-identifications`](foundation-core.dependent-identifications.md) | -| The fundamental theorem of identity types | [`foundation.fundamental-theorem-of-identity-types`](foundation.fundamental-theorem-of-identity-types.md) | -| Identity systems | [`foundation.identity-systems`](foundation.identity-systems.md) | -| The identity type (foundation) | [`foundation.identity-types`](foundation.identity-types.md) | -| The identity type (foundation-core) | [`foundation-core.identity-types`](foundation-core.identity-types.md) | -| Large identity types | [`foundation.large-identity-types`](foundation.large-identity-types.md) | -| Negated equality | [`foundation.negated-equality`](foundation.negated-equality.md) | -| Path algebra | [`foundation.path-algebra`](foundation.path-algebra.md) | -| The Regensburg extension of the fundamental theorem of identity types | [`foundation.regensburg-extension-fundamental-theorem-of-identity-types`](foundation.regensburg-extension-fundamental-theorem-of-identity-types.md) | -| Symmetric identity types | [`foundation.symmetric-identity-types`](foundation.symmetric-identity-types.md) | -| Torsorial type families (foundation) | [`foundation.torsorial-type-families`](foundation.torsorial-type-families.md) | -| Torsorial type familes (foundation-core) | [`foundation-core.torsorial-type-families`](foundation-core.torsorial-type-families.md) | -| Transport along higher identifications | [`foundation.transport-along-higher-identifications`](foundation.transport-along-higher-identifications.md) | -| Transport along identifications (foundation) | [`foundation.transport-along-identifications`](foundation.transport-along-identifications.md) | -| Transport along identifications (foundation-core) | [`foundation-core.transport-along-identifications`](foundation-core.transport-along-identifications.md) | -| Transposition of identifications along equivalences | [`foundation.transposition-identifications-along-equivalences`](foundation.transposition-identifications-along-equivalences.md) | -| The universal property of identity systems | [`foundation.universal-property-identity-systems`](foundation.universal-property-identity-systems.md) | -| The universal property of identity types | [`foundation.universal-property-identity-types`](foundation.universal-property-identity-types.md) | -| Whiskering identifications | [`foundation.whiskering-identifications-concatenation`](foundation.whiskering-identifications-concatenation.md) | -| The yoneda identity type | [`foundation.yoneda-identity-types`](foundation.yoneda-identity-types.md) | +| Concept | File | +| --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| Action on higher identifications of functions | [`foundation.action-on-higher-identifications-functions`](foundation.action-on-higher-identifications-functions.md) | +| Action on identifications of binary functions | [`foundation.action-on-identifications-binary-functions`](foundation.action-on-identifications-binary-functions.md) | +| Action on identifications of dependent functions | [`foundation.action-on-identifications-dependent-functions`](foundation.action-on-identifications-dependent-functions.md) | +| Action on identifications of functions | [`foundation.action-on-identifications-functions`](foundation.action-on-identifications-functions.md) | +| Binary transport | [`foundation.binary-transport`](foundation.binary-transport.md) | +| Commuting hexagons of identifications | [`foundation.commuting-hexagons-of-identifications`](foundation.commuting-hexagons-of-identifications.md) | +| Commuting pentagons of identifications | [`foundation.commuting-pentagons-of-identifications`](foundation.commuting-pentagons-of-identifications.md) | +| Commuting squares of identifications | [`foundation.commuting-squares-of-identifications`](foundation.commuting-squares-of-identifications.md) | +| Commuting triangles of identifications | [`foundation.commuting-triangles-of-identifications`](foundation.commuting-triangles-of-identifications.md) | +| The computational identity type | [`foundation.computational-identity-types`](foundation.computational-identity-types.md) | +| The strictly involutive identity type | [`foundation.strictly-involutive-identity-types`](foundation.strictly-involutive-identity-types.md) | +| The strictly right unital concatenation operation on identifications | [`foundation.strictly-right-unital-concatenation-identifications`](foundation.strictly-right-unital-concatenation-identifications.md) | +| Dependent identifications (foundation) | [`foundation.dependent-identifications`](foundation.dependent-identifications.md) | +| Dependent identifications (foundation-core) | [`foundation-core.dependent-identifications`](foundation-core.dependent-identifications.md) | +| The fundamental theorem of identity types | [`foundation.fundamental-theorem-of-identity-types`](foundation.fundamental-theorem-of-identity-types.md) | +| Identity systems | [`foundation.identity-systems`](foundation.identity-systems.md) | +| The identity type (foundation) | [`foundation.identity-types`](foundation.identity-types.md) | +| The identity type (foundation-core) | [`foundation-core.identity-types`](foundation-core.identity-types.md) | +| Large identity types | [`foundation.large-identity-types`](foundation.large-identity-types.md) | +| Negated equality | [`foundation.negated-equality`](foundation.negated-equality.md) | +| Path algebra | [`foundation.path-algebra`](foundation.path-algebra.md) | +| The Regensburg extension of the fundamental theorem of identity types | [`foundation.regensburg-extension-fundamental-theorem-of-identity-types`](foundation.regensburg-extension-fundamental-theorem-of-identity-types.md) | +| Symmetric identity types | [`foundation.symmetric-identity-types`](foundation.symmetric-identity-types.md) | +| Torsorial type families (foundation) | [`foundation.torsorial-type-families`](foundation.torsorial-type-families.md) | +| Torsorial type familes (foundation-core) | [`foundation-core.torsorial-type-families`](foundation-core.torsorial-type-families.md) | +| Transport along higher identifications | [`foundation.transport-along-higher-identifications`](foundation.transport-along-higher-identifications.md) | +| Transport along identifications (foundation) | [`foundation.transport-along-identifications`](foundation.transport-along-identifications.md) | +| Transport along identifications (foundation-core) | [`foundation-core.transport-along-identifications`](foundation-core.transport-along-identifications.md) | +| Transposition of identifications along equivalences | [`foundation.transposition-identifications-along-equivalences`](foundation.transposition-identifications-along-equivalences.md) | +| The universal property of identity systems | [`foundation.universal-property-identity-systems`](foundation.universal-property-identity-systems.md) | +| The universal property of identity types | [`foundation.universal-property-identity-types`](foundation.universal-property-identity-types.md) | +| Whiskering identifications | [`foundation.whiskering-identifications-concatenation`](foundation.whiskering-identifications-concatenation.md) | +| The Yoneda identity type | [`foundation.yoneda-identity-types`](foundation.yoneda-identity-types.md) | From 7687894808ecb741b89b5e5e806559b48d04179e Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 22:02:25 +0100 Subject: [PATCH 36/39] remainder of review --- src/foundation.lagda.md | 1 + .../computational-identity-types.lagda.md | 2 +- ...trictly-involutive-identity-types.lagda.md | 16 +++++++++++++++- ...tal-concatenation-identifications.lagda.md | 16 +++++++++++----- src/foundation/yoneda-identity-types.lagda.md | 19 ++++++++++--------- 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/foundation.lagda.md b/src/foundation.lagda.md index f662c26b5b..00cfe1d5a0 100644 --- a/src/foundation.lagda.md +++ b/src/foundation.lagda.md @@ -333,6 +333,7 @@ open import foundation.spans-families-of-types public open import foundation.split-surjective-maps public open import foundation.standard-apartness-relations public open import foundation.strictly-involutive-identity-types public +open import foundation.strictly-right-unital-concatenation-identifications public open import foundation.strongly-extensional-maps public open import foundation.structure public open import foundation.structure-identity-principle public diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 4d5bd4b851..30af1ce64e 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -197,7 +197,7 @@ module _ ### The computational identity types are equivalent to the standard identity types We define the equivalence as the composite `(x = y) ≃ (x =ʸ y) ≃ (x =ʲ y)`. -Since each of these equivalences preserves the groupoid structure weakly so does +Since each of these equivalences preserve the groupoid structure weakly so does the composite. For the same reason, it preserves the reflexivities strictly. ```agda diff --git a/src/foundation/strictly-involutive-identity-types.lagda.md b/src/foundation/strictly-involutive-identity-types.lagda.md index e199ef7541..7c94ae7d61 100644 --- a/src/foundation/strictly-involutive-identity-types.lagda.md +++ b/src/foundation/strictly-involutive-identity-types.lagda.md @@ -291,7 +291,8 @@ We have, practically speaking, two definitions of the concatenation operation on strictly involutive identity types. One satisfies a strict left unit law and the other satisfies a strict right unit law. In both cases, we must use the [strictly right unital concatenation operation on standard identifications](foundation.strictly-right-unital-concatenation-identifications.md) -`_∙ᵣ_`, to obtain this strict one-sided unit law. +`_∙ᵣ_`, to obtain this strict one-sided unit law, as will momentarily be +demonstrated. The strictly left unital concatenation operation is defined by @@ -318,6 +319,19 @@ operation is indeed strictly left unital: ≐ r. ``` +While for the strictly right unital concatenation operation, we have the +computation + +```text + r ∙ᵣⁱ reflⁱ + ≐ (w , p , q) ∙ᵣⁱ (x , refl , refl) + ≐ (w , (p ∙ᵣ inv refl) ∙ᵣ refl , q) + ≐ (w , p ∙ᵣ inv refl , q) + ≐ (w , p ∙ᵣ refl , q) + ≐ (w , p , q) + ≐ r. +``` + To be consistent with the convention for the standard identity types, we take the strictly left unital concatenation operation to be the default concatenation operation on strictly involutive identity types. diff --git a/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md b/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md index 8e81a2d20a..1a36f449b1 100644 --- a/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md @@ -82,25 +82,29 @@ module _ {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → (p ∙ q) ∙ r = (p ∙ᵣ q) ∙ᵣ r eq-double-right-strict-concat-concat-left-associated p q r = - ap (_∙ r) (eq-right-strict-concat-concat p q) ∙ eq-right-strict-concat-concat (p ∙ᵣ q) r + ( ap (_∙ r) (eq-right-strict-concat-concat p q)) ∙ + ( eq-right-strict-concat-concat (p ∙ᵣ q) r) eq-double-right-strict-concat-concat-right-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → p ∙ (q ∙ r) = p ∙ᵣ (q ∙ᵣ r) eq-double-right-strict-concat-concat-right-associated p q r = - ap (p ∙_) (eq-right-strict-concat-concat q r) ∙ eq-right-strict-concat-concat p (q ∙ᵣ r) + ( ap (p ∙_) (eq-right-strict-concat-concat q r)) ∙ + ( eq-right-strict-concat-concat p (q ∙ᵣ r)) eq-double-concat-right-strict-concat-left-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → (p ∙ᵣ q) ∙ᵣ r = (p ∙ q) ∙ r eq-double-concat-right-strict-concat-left-associated p q r = - ap (_∙ᵣ r) (eq-concat-right-strict-concat p q) ∙ eq-concat-right-strict-concat (p ∙ q) r + ( ap (_∙ᵣ r) (eq-concat-right-strict-concat p q)) ∙ + ( eq-concat-right-strict-concat (p ∙ q) r) eq-double-concat-right-strict-concat-right-associated : {x y z w : A} (p : x = y) (q : y = z) (r : z = w) → p ∙ᵣ (q ∙ᵣ r) = p ∙ (q ∙ r) eq-double-concat-right-strict-concat-right-associated p q r = - ap (p ∙ᵣ_) (eq-concat-right-strict-concat q r) ∙ eq-concat-right-strict-concat p (q ∙ r) + ( ap (p ∙ᵣ_) (eq-concat-right-strict-concat q r)) ∙ + ( eq-concat-right-strict-concat p (q ∙ r)) ``` ## Properties @@ -166,7 +170,8 @@ module _ is-injective-right-strict-concat : {x y z : A} (p : x = y) {q r : y = z} → p ∙ᵣ q = p ∙ᵣ r → q = r - is-injective-right-strict-concat refl s = (inv left-unit-right-strict-concat ∙ s) ∙ left-unit-right-strict-concat + is-injective-right-strict-concat refl s = + (inv left-unit-right-strict-concat ∙ s) ∙ left-unit-right-strict-concat is-injective-right-strict-concat' : {x y z : A} (r : y = z) {p q : x = y} → p ∙ᵣ r = q ∙ᵣ r → p = q @@ -176,3 +181,4 @@ module _ ## See also - [Yoneda identity types](foundation.yoneda-identity-types.md) +- [Computational identity types](foundation.computational-identity-types.md) diff --git a/src/foundation/yoneda-identity-types.lagda.md b/src/foundation/yoneda-identity-types.lagda.md index 50bace8a7c..3e7339584c 100644 --- a/src/foundation/yoneda-identity-types.lagda.md +++ b/src/foundation/yoneda-identity-types.lagda.md @@ -161,9 +161,9 @@ and from right to left by evaluation at the reflexivity It should be noted that we define the map `x = y → x =ʸ y` using the [strictly right unital concatenation operation](foundation.strictly-right-unital-concatenation-identifications.md). -While this obstructs us from showing that the homotopy -`eq-yoneda-eq ∘ yoneda-eq-eq ~ id` holds by reflexivity, as demonstrated by the -computation +While this obstructs us from showing that the +[homotopy](foundation-core.homotopies.md) `eq-yoneda-eq ∘ yoneda-eq-eq ~ id` +holds by reflexivity, as demonstrated by the computation ```text eq-yoneda-eq ∘ yoneda-eq-eq @@ -384,9 +384,10 @@ module _ ( ind-Id x (λ y p → B y (yoneda-eq-eq p)) b y (eq-yoneda-eq f)) ``` -While the induction principle does not have the wanted reduction behaviour, the -non-dependent eliminator does. This is simply because we no longer need to -transport along `is-section-eq-yoneda-eq`. +While the induction principle does not have the desired reduction behaviour, the +nondependent eliminator does. This is simply because we no longer need to +[transport](foundation-core.transport-along-identifications.md) along +`is-section-eq-yoneda-eq`. ```agda module _ @@ -422,14 +423,14 @@ structure on types. We consider two ways of defining the inversion operation on Yoneda identifications: by the strictly right unital, and strictly left unital -concatenation operation on the underlying identity type respectively. The former -enjoys the computational property +concatenation operation on the underlying identity type respectively. In +contrast to the latter, the former enjoys the computational property ```text inv reflʸ ≐ reflʸ, ``` -hence will be preferred going. +hence will be preferred going forward. #### The inversion operation defined by the strictly right unital concatenation operation on identifications From 1a2694d3443eb5a4dcbcb4ee2dfc424e33e2b73e Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 22:26:04 +0100 Subject: [PATCH 37/39] finishing touches --- .../computational-identity-types.lagda.md | 33 +++++++----- ...trictly-involutive-identity-types.lagda.md | 54 ++++++++++--------- src/foundation/yoneda-identity-types.lagda.md | 23 ++++---- 3 files changed, 59 insertions(+), 51 deletions(-) diff --git a/src/foundation/computational-identity-types.lagda.md b/src/foundation/computational-identity-types.lagda.md index 30af1ce64e..2b19a54501 100644 --- a/src/foundation/computational-identity-types.lagda.md +++ b/src/foundation/computational-identity-types.lagda.md @@ -396,8 +396,8 @@ module _ inv-inv-computational-Id p = refl ``` -The inversion operation corresponds to the standard inversion operation on -identifications: +The inversion operation on computational identifications corresponds to the +standard inversion operation on identifications: ```agda module _ @@ -461,8 +461,9 @@ module _ concat-computational-Id' x q p = p ∙ʲ q ``` -The strictly left unital concatenation operation corresponds to the standard -strictly left unital concatenation operation on identifications. +The strictly left unital concatenation operation on computational +identifications corresponds to the strictly left unital concatenation operation +on standard identifications. ```agda module _ @@ -527,8 +528,9 @@ module _ right-strict-concat-computational-Id' x q p = p ∙ᵣʲ q ``` -The strictly right unital concatenation operation corresponds to the standard -strictly right unital concatenation operation on identifications. +The strictly right unital concatenation operation on computational +identifications corresponds to the strictly right unital concatenation operation +on standard identifications. ```agda module _ @@ -569,14 +571,14 @@ To see that `_∙ʲ_` is strictly associative, we unfold both `(P ∙ʲ Q) ∙ʲ ```text (P ∙ʲ Q) ∙ʲ R - ≐ ((u , p , p') ∙ʲ (v , q , q')) ∙ʲ (w , r , r') - ≐ ((v , q , (q' ∙ʸ invʸ p) ∙ʸ p')) ∙ʲ (w , r , r') - ≐ (w , r , (r' ∙ʸ invʸ q) ∙ʸ ((q' ∙ʸ invʸ p) ∙ʸ p')) - - ≐ (w , r , (((r' ∙ʸ invʸ q) ∙ʸ q') ∙ʸ invʸ p) ∙ʸ p') - ≐ (u , p , p') ∙ʲ ((w , r , (r' ∙ʸ invʸ q) ∙ʸ q')) - ≐ (u , p , p') ∙ʲ ((v , q , q') ∙ʲ (w , r , r')) - ≐ P ∙ʲ (Q ∙ʲ R). + ≐ ((u , p , p') ∙ʲ (v , q , q')) ∙ʲ (w , r , r') + ≐ ((v , q , (q' ∙ʸ inv p) ∙ʸ p')) ∙ʲ (w , r , r') + ≐ (w , r , (r' ∙ʸ inv q) ∙ʸ ((q' ∙ʸ inv p) ∙ʸ p')) + + ≐ (w , r , (((r' ∙ʸ inv q) ∙ʸ q') ∙ʸ inv p) ∙ʸ p') + ≐ (u , p , p') ∙ʲ ((w , r , (r' ∙ʸ inv q) ∙ʸ q')) + ≐ (u , p , p') ∙ʲ ((v , q , q') ∙ʲ (w , r , r')) + ≐ P ∙ʲ (Q ∙ʲ R). ``` ```agda @@ -707,6 +709,9 @@ module _ ## Operations +We can define a range of basic operations on computational identifications that +all enjoy strict computational properties. + ### Action of functions on computational identifications ```agda diff --git a/src/foundation/strictly-involutive-identity-types.lagda.md b/src/foundation/strictly-involutive-identity-types.lagda.md index 7c94ae7d61..4038f825c2 100644 --- a/src/foundation/strictly-involutive-identity-types.lagda.md +++ b/src/foundation/strictly-involutive-identity-types.lagda.md @@ -39,8 +39,10 @@ _weakly_. On this page, we consider the (x =ⁱ y) := Σ (z : A) ((z = y) × (z = x)) ``` -This type family is [equivalent](foundation-core.equivalences.md) to the -standard identity types, but satisfies the strict laws +whose elements we call +{{#concept "strictly involutive identifications" Agda=involutive-Id}}. This type +family is [equivalent](foundation-core.equivalences.md) to the standard identity +types, but satisfies the strict laws - `inv (inv p) ≐ p` - `inv reflⁱ ≐ reflⁱ` @@ -51,12 +53,10 @@ type from the standard identity type. In addition, we maintain the following strict laws - `inv reflⁱ ≐ reflⁱ` -- `ind-Id f reflⁱ ≐ f reflⁱ` - `reflⁱ ∙ p ≐ p` or `p ∙ reflⁱ ≐ p` +- `ind-Idⁱ B f reflⁱ ≐ f reflⁱ` -among other more specific laws considered on this page. We call elements of the -strictly involutive identity type for -{{#concept "strictly involutive identifications" Agda=involutive-Id}}. +among other more specific laws considered on this page. ## Definition @@ -93,22 +93,22 @@ and from right to left by the concatenation eq-involutive-eq := (z , p , q) ↦ inv q ∙ p : x =ⁱ y → x = y. ``` -This equivalence preserves the groupoid structure on the strictly involutive -identity types as we will see later. Moreover, the composition +This equivalence weakly preserves the groupoid structure on the strictly +involutive identity types as we will see later. Moreover, the composition `eq-involutive-eq ∘ involutive-eq-eq` computes strictly to the identity: ```text eq-involutive-eq ∘ involutive-eq-eq - ≐ p ↦ (((z , p , q) ↦ inv q ∙ p) (r ↦ (w , r , refl))) - ≐ p ↦ inv refl ∙ p - ≐ p ↦ refl ∙ p - ≐ p ↦ p + ≐ p ↦ (((z , p , q) ↦ inv q ∙ p) (r ↦ (w , r , refl))) + ≐ p ↦ inv refl ∙ p + ≐ p ↦ refl ∙ p + ≐ p ↦ p ``` and the reflexivities are preserved strictly: ```text - eq-involutive-eq reflⁱ ≐ inv refl ∙ refl ≐ refl ∙ refl ≐ refl + eq-involutive-eq reflⁱ ≐ inv refl ∙ refl ≐ refl ∙ refl ≐ refl, ``` and @@ -154,7 +154,11 @@ module _ equiv-eq-involutive-eq : (x =ⁱ y) ≃ (x = y) pr1 equiv-eq-involutive-eq = eq-involutive-eq pr2 equiv-eq-involutive-eq = is-equiv-eq-involutive-eq +``` + +This equivalence preserves the reflexivity elements strictly in both directions. +```agda module _ {l : Level} {A : UU l} where @@ -311,12 +315,12 @@ operation is indeed strictly left unital: ```text reflⁱ ∙ⁱ r - ≐ (x , refl , refl) ∙ⁱ (w , p , q) - ≐ (w , p , (q ∙ᵣ inv refl) ∙ᵣ refl) - ≐ (w , p , (q ∙ᵣ inv refl)) - ≐ (w , p , (q ∙ᵣ refl)) - ≐ (w , p , q) - ≐ r. + ≐ (x , refl , refl) ∙ⁱ (w , p , q) + ≐ (w , p , (q ∙ᵣ inv refl) ∙ᵣ refl) + ≐ (w , p , (q ∙ᵣ inv refl)) + ≐ (w , p , (q ∙ᵣ refl)) + ≐ (w , p , q) + ≐ r. ``` While for the strictly right unital concatenation operation, we have the @@ -324,12 +328,12 @@ computation ```text r ∙ᵣⁱ reflⁱ - ≐ (w , p , q) ∙ᵣⁱ (x , refl , refl) - ≐ (w , (p ∙ᵣ inv refl) ∙ᵣ refl , q) - ≐ (w , p ∙ᵣ inv refl , q) - ≐ (w , p ∙ᵣ refl , q) - ≐ (w , p , q) - ≐ r. + ≐ (w , p , q) ∙ᵣⁱ (x , refl , refl) + ≐ (w , (p ∙ᵣ inv refl) ∙ᵣ refl , q) + ≐ (w , p ∙ᵣ inv refl , q) + ≐ (w , p ∙ᵣ refl , q) + ≐ (w , p , q) + ≐ r. ``` To be consistent with the convention for the standard identity types, we take diff --git a/src/foundation/yoneda-identity-types.lagda.md b/src/foundation/yoneda-identity-types.lagda.md index 3e7339584c..c5ee6d9b9a 100644 --- a/src/foundation/yoneda-identity-types.lagda.md +++ b/src/foundation/yoneda-identity-types.lagda.md @@ -61,7 +61,7 @@ concretely, the reflexivity is given by the identity function, and path concatenation is given by function composition. In addition to these strictness laws, we can make the type satisfy the strict -law `invʸ reflʸ ≐ reflʸ`. Moreover, while the induction principle of the Yoneda +law `inv reflʸ ≐ reflʸ`. Moreover, while the induction principle of the Yoneda identity types does not in general satisfy the computation rule strictly, we can define its recursion principle such that does. @@ -80,7 +80,7 @@ module _ (a =ʸ b) = yoneda-Id a b ``` -We define the reflexivity to be the identity function: +We define the reflexivity by the identity function: ```agda reflʸ : {x : A} → x =ʸ x @@ -163,13 +163,13 @@ It should be noted that we define the map `x = y → x =ʸ y` using the [strictly right unital concatenation operation](foundation.strictly-right-unital-concatenation-identifications.md). While this obstructs us from showing that the [homotopy](foundation-core.homotopies.md) `eq-yoneda-eq ∘ yoneda-eq-eq ~ id` -holds by reflexivity, as demonstrated by the computation +holds by reflexivity as demonstrated by the computation ```text eq-yoneda-eq ∘ yoneda-eq-eq ≐ p ↦ (f ↦ f refl) (q ↦ q ∙ p) ≐ p ↦ ((q ↦ q ∙ p) refl) - ≐ p ↦ refl ∙ p + ≐ p ↦ refl ∙ p, ``` it allows us to show that reflexivities are preserved strictly in both @@ -238,24 +238,23 @@ of the Yoneda identity type. pr2 equiv-eq-yoneda-eq = is-equiv-eq-yoneda-eq ``` -The reflexivity elements are preserved strictly. +This equvialence preserves the reflexivity elements strictly in both directions. ```agda module _ - {l : Level} {A : UU l} + {l : Level} {A : UU l} {x : A} where is-section-eq-yoneda-eq-refl : - {x : A} → yoneda-eq-eq (eq-yoneda-eq (reflʸ {x = x})) = reflʸ is-section-eq-yoneda-eq-refl = refl preserves-refl-yoneda-eq-eq : - {x : A} → yoneda-eq-eq (refl {x = x}) = reflʸ + yoneda-eq-eq (refl {x = x}) = reflʸ preserves-refl-yoneda-eq-eq = refl preserves-refl-eq-yoneda-eq : - {x : A} → eq-yoneda-eq (reflʸ {x = x}) = refl + eq-yoneda-eq (reflʸ {x = x}) = refl preserves-refl-eq-yoneda-eq = refl ``` @@ -430,7 +429,7 @@ contrast to the latter, the former enjoys the computational property inv reflʸ ≐ reflʸ, ``` -hence will be preferred going forward. +hence it will be preferred going forward. #### The inversion operation defined by the strictly right unital concatenation operation on identifications @@ -673,8 +672,8 @@ module _ ## Operations -We can define basic operations on the Yoneda identifications. They all enjoy -strict computational properties. +We can define a range basic operations on the Yoneda identifications that all +enjoy strict computational properties. ### Action of functions on Yoneda identifications From b1cd48a5d3dc249d963e14dfaee582c9bd424e76 Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 23:31:48 +0100 Subject: [PATCH 38/39] fix mistakes --- src/foundation-core/identity-types.lagda.md | 16 ++++++++-------- ...unital-concatenation-identifications.lagda.md | 9 +++++---- .../cd-structures.lagda.md | 2 +- .../algebraic-theory-of-groups.lagda.md | 8 ++++---- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index 3e4962fd84..a6a0e91058 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -155,11 +155,16 @@ behaviours. us the computation rule `refl ∙ q ≐ q`. 2. We can define concatenation by induction on the equality `y = z`. This gives us the computation rule `p ∙ refl ≐ p`. -3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only - gives us the computation rule `refl ∙ refl ≐ refl`. +3. We can define concatenation by induction on both `x = y` and `y = z`. This + only gives us the computation rule `refl ∙ refl ≐ refl`. While the third option may be preferred by some for its symmetry, for practical -reasons, we use the first alternative by convention. +reasons, we prefer one of the first two, and by convention we use the first +alternative. The second option is considered in +[`foundation.strictly-right-unital-concatenation-identifications`](foundation.strictly-right-unital-concatenation-identifications.md), +and in [`foundation.yoneda-identity-types`](foundation.yoneda-identity-types.md) +we construct an identity type which satisfies both computation rules among +others. ```agda module _ @@ -177,11 +182,6 @@ module _ concat' x q p = p ∙ q ``` -#### See also - -- [The strictly right unital concatenation operation on indentifications](foundation.strictly-right-unital-concatenation-identifications.md) -- [The Yoneda identity types](foundation.yoneda-identity-types.md) - ### Inverting identifications ```agda diff --git a/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md b/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md index 1a36f449b1..f3f4dce0d8 100644 --- a/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md +++ b/src/foundation/strictly-right-unital-concatenation-identifications.lagda.md @@ -33,12 +33,13 @@ behaviours: us the computation rule `refl ∙ q ≐ q`. 2. We can define concatenation by induction on the equality `y = z`. This gives us the computation rule `p ∙ refl ≐ p`. -3. We can define `_∙_` by induction on both `x = y` and `y = z`. This only - gives us the computation rule `refl ∙ refl ≐ refl`. +3. We can define concatenation by induction on both `x = y` and `y = z`. This + only gives us the computation rule `refl ∙ refl ≐ refl`. While the third option may be preferred by some for its symmetry, for practical -reasons, we use the first alternative by convention. However, there are cases -where the second case may be preferred. Hence why we on this page consider the +reasons, we prefer one of the first two, and by convention we use the first +alternative. However, there are cases where the second case may be preferred. +Hence why we on this page consider the {{#concept "strictly right unital concatenation operation on identifications" Agda=_∙ᵣ_ Agda=right-strict-concat Agda=right-strict-concat'}}. This definition is for instance used with the diff --git a/src/orthogonal-factorization-systems/cd-structures.lagda.md b/src/orthogonal-factorization-systems/cd-structures.lagda.md index 9bba4ff279..6413398d29 100644 --- a/src/orthogonal-factorization-systems/cd-structures.lagda.md +++ b/src/orthogonal-factorization-systems/cd-structures.lagda.md @@ -31,7 +31,7 @@ class `𝒟` of j ``` -In this file we will consider _internal_ cd-structures, i.e., cd-structure on +On this page we will consider _internal_ cd-structures, i.e., cd-structure on types. In other words, a {{#concept "cd-structure" Agda=cd-structure}} is a family of [subtypes](foundation-core.subtypes.md) diff --git a/src/universal-algebra/algebraic-theory-of-groups.lagda.md b/src/universal-algebra/algebraic-theory-of-groups.lagda.md index e6d6246392..5645a87ba0 100644 --- a/src/universal-algebra/algebraic-theory-of-groups.lagda.md +++ b/src/universal-algebra/algebraic-theory-of-groups.lagda.md @@ -50,7 +50,7 @@ pr2 group-signature inv-group-op = 1 data group-laws : UU lzero where associative-l-group-laws : group-laws - left-strict-inv-l-group-laws : group-laws + invl-l-group-laws : group-laws invr-r-group-laws : group-laws idl-l-group-laws : group-laws idr-r-group-laws : group-laws @@ -64,7 +64,7 @@ pr2 group-Theory = ( ( op mul-group-op (var 0 ∷ var 1 ∷ empty-vec)) ∷ var 2 ∷ empty-vec)) , ( op mul-group-op ( var 0 ∷ (op mul-group-op (var 1 ∷ var 2 ∷ empty-vec)) ∷ empty-vec)) - left-strict-inv-l-group-laws → + invl-l-group-laws → ( op mul-group-op ( op inv-group-op (var 0 ∷ empty-vec) ∷ var 0 ∷ empty-vec)) , ( op unit-group-op empty-vec) @@ -110,7 +110,7 @@ pr2 (pr2 (pr1 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = pr1 (pr2 (pr2 (group-Algebra-Group ((A-Set , models-A) , satisfies-A)))) x = models-A inv-group-op (x ∷ empty-vec) pr1 (pr2 (pr2 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = - satisfies-A left-strict-inv-l-group-laws (λ _ → x) + satisfies-A invl-l-group-laws (λ _ → x) pr2 (pr2 (pr2 (pr2 (group-Algebra-Group (_ , satisfies-A))))) x = satisfies-A invr-r-group-laws (λ _ → x) @@ -129,7 +129,7 @@ Group-group-Algebra G = ( λ where associative-l-group-laws assign → associative-mul-Group G (assign 0) (assign 1) (assign 2) - left-strict-inv-l-group-laws assign → + invl-l-group-laws assign → left-inverse-law-mul-Group G (assign 0) invr-r-group-laws assign → right-inverse-law-mul-Group G (assign 0) From 565137d99974d01cd0e8aca2e01bc1889553abed Mon Sep 17 00:00:00 2001 From: Fredrik Bakke Date: Wed, 7 Feb 2024 23:33:14 +0100 Subject: [PATCH 39/39] line break --- src/foundation-core/identity-types.lagda.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/foundation-core/identity-types.lagda.md b/src/foundation-core/identity-types.lagda.md index a6a0e91058..c9deb7361a 100644 --- a/src/foundation-core/identity-types.lagda.md +++ b/src/foundation-core/identity-types.lagda.md @@ -160,7 +160,9 @@ behaviours. While the third option may be preferred by some for its symmetry, for practical reasons, we prefer one of the first two, and by convention we use the first -alternative. The second option is considered in +alternative. + +The second option is considered in [`foundation.strictly-right-unital-concatenation-identifications`](foundation.strictly-right-unital-concatenation-identifications.md), and in [`foundation.yoneda-identity-types`](foundation.yoneda-identity-types.md) we construct an identity type which satisfies both computation rules among